Skip to content

Commit

Permalink
Correcting factors/indicators view.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariana Azevedo committed Jul 10, 2019
1 parent dd02e05 commit 1da08e4
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 85 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/bin/
/bin/
javaCompiler...args
2 changes: 1 addition & 1 deletion META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: O3SMeasures
Bundle-SymbolicName: O3SMeasures;singleton:=true
Bundle-Version: 1.3.0
Bundle-Version: 1.3.1
Bundle-Vendor: Mariana Azevedo
Require-Bundle: org.eclipse.ui,
org.eclipse.core.resources,
Expand Down
79 changes: 0 additions & 79 deletions javaCompiler...args

This file was deleted.

3 changes: 2 additions & 1 deletion src/com/o3smeasures/measures/enumeration/FactorsEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public enum FactorsEnum {
INCREASE_MODULARITY("Increase of Modularity"),
HIGH_COHESION_METHODS("High Cohesion of Methods"),
TIGHT_LOOSE_COHESION("Tight and Loose Class Cohesion"),
COMPLEXITY_REDUCTION("Complexity Reduction");
COMPLEXITY_REDUCTION("Complexity Reduction"),
NONE("None");

private String name;

Expand Down
2 changes: 1 addition & 1 deletion src/com/o3smeasures/measures/enumeration/MeasuresEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum MeasuresEnum {
NC("NC", "Number of Classes"),
NOM("NOM", "Number of Methods"),
RFC("RFC", "Response for Class"),
TCC("TCC", "Tight and Loose Class Cohesion"),
TCC("TCC", "Tight Class Cohesion"),
WMC("WMC", "Weight Methods per Class");

private String acronym;
Expand Down
3 changes: 2 additions & 1 deletion src/com/o3smeasures/plugin/chart/BarChart.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.jfree.chart.renderer.category.LineAndShapeRenderer;
import org.jfree.data.category.DefaultCategoryDataset;

import com.o3smeasures.measures.enumeration.FactorsEnum;
import com.o3smeasures.measures.enumeration.O3SMeasuresConfigurationEnum;
import com.o3smeasures.statistic.Factor;
import com.o3smeasures.statistic.Indicator;
Expand Down Expand Up @@ -143,7 +144,7 @@ private void createFactors(ItemMeasured itemsMeasured) throws FactorNotFoundExce
for (ItemMeasured item : items) {

String factorName = O3SMeasuresConfigurationEnum.searchByValue(item.getName()).getFactor();
if (!factorName.equals("None") && !factorName.equals("High Cohesion of Methods")){
if (!factorName.equals(FactorsEnum.NONE.getName()) && !factorName.equals(FactorsEnum.HIGH_COHESION_METHODS.getName())){
Factor factor = factorsMap.computeIfAbsent(factorName, f -> new Factor(factorName, factorName, 0));
factor.getIndicators().add(new Indicator(item, 0.0));
factor.setNumberOfIndicators(factor.getNumberOfIndicators()+1);
Expand Down
3 changes: 2 additions & 1 deletion src/com/o3smeasures/plugin/chart/BoxAndWhiskerChart.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset;

import com.o3smeasures.measures.enumeration.FactorsEnum;
import com.o3smeasures.measures.enumeration.O3SMeasuresConfigurationEnum;
import com.o3smeasures.statistic.Factor;
import com.o3smeasures.statistic.Indicator;
Expand Down Expand Up @@ -110,7 +111,7 @@ private void createFactors(ItemMeasured itemsMeasured) throws FactorNotFoundExce
for (ItemMeasured item : items) {

String factorName = O3SMeasuresConfigurationEnum.searchByValue(item.getName()).getFactor();
if (!factorName.equals("None") && !factorName.equals("High Cohesion of Methods")){
if (!factorName.equals(FactorsEnum.NONE.getName()) && !factorName.equals(FactorsEnum.HIGH_COHESION_METHODS.getName())){
Factor factor = factorsMap.computeIfAbsent(factorName, f -> new Factor(factorName, factorName, 0));
factor.getIndicators().add(new Indicator(item, 0.0));
}
Expand Down

0 comments on commit 1da08e4

Please sign in to comment.