You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Results of the detection of Small classes: Threshold NMD+NAD = -1.0
-Problem: CodeSmell identified by name; does not allow distinguishing two methods with the same name but different signatures.
Replace with IEntity.
-Remove contexts.
-Most HashMap objects should be removed as they provide no value.
Replace them with Set.
-Exclude and methods from metric calculations.
-Not all code smells necessarily require:
private final HashMap values, thresholdValues; Public interface ICodeSmell : remove the following signatures:
public HashMap<String, Double> getValues();
// TODO: TO BE REMOVED!!! public HashMap<String, Double> getThresholdValues();
Once removed, ensure these methods are also removed from all classes implementing ICodeSmell.
final HashMap thresholdMap = new HashMap();
// TODO: Problem here: thresholds for NAD and NMD are the same
// because mapOfLargeClassesValues.put(anClass, new Double(NMD + NAD)); thresholdMap.put("NAD", new Double(this.boxPlot.getMaxBound())); thresholdMap.put("NMD", new Double(this.boxPlot.getMaxBound()));
Define threshold values for design defect detection.
Otherwise, anti-patterns present in the code in the first version may appear in the second version as new patterns, even though this is not the case.
Conclusion:
The boxplot is misleading.
Add a class attribute to Antipattern.
Add a method:
IAntipattern getAntipattern(IClass iClass)
Write a method to compare whether two anti-patterns are identical.
Write a method to compare whether two code smells are identical.
Rewrite Differentiator without codelevelmodel, instead differentiating between anti-pattern classes.
In Codesmell.java
/**
Compares the specified code smell with this one for equality.
A code smell is considered equal to another if they involve the same class.
In
org.swt
Results of the detection of Small classes:
Threshold NMD+NAD = -1.0
-Problem: CodeSmell identified by name; does not allow distinguishing two methods with the same name but different signatures.
Replace with
IEntity
.-Remove contexts.
-Most HashMap objects should be removed as they provide no value.
Replace them with Set.
-Exclude and methods from metric calculations.
-Not all code smells necessarily require:
private final HashMap values, thresholdValues;
Public interface ICodeSmell
: remove the following signatures:public HashMap<String, Double> getValues();
// TODO: TO BE REMOVED!!!
public HashMap<String, Double> getThresholdValues();
Once removed, ensure these methods are also removed from all classes implementing ICodeSmell.
final HashMap thresholdMap = new HashMap();
// TODO: Problem here: thresholds for NAD and NMD are the same
// because mapOfLargeClassesValues.put(anClass, new Double(NMD + NAD));
thresholdMap.put("NAD", new Double(this.boxPlot.getMaxBound()));
thresholdMap.put("NMD", new Double(this.boxPlot.getMaxBound()));
Define threshold values for design defect detection.
Otherwise, anti-patterns present in the code in the first version may appear in the second version as new patterns, even though this is not the case.
Conclusion:
The boxplot is misleading.
Add a class attribute to Antipattern.
Add a method:
IAntipattern getAntipattern(IClass iClass)
Write a method to compare whether two anti-patterns are identical.
Write a method to compare whether two code smells are identical.
Rewrite Differentiator without codelevelmodel, instead differentiating between anti-pattern classes.
In
Codesmell.java
/**
*/
public boolean equalsCodeSmell(final ICodeSmell cs)
Add to BlobDetection:
Add the detection of LowCohesionDetection + ControllerClassDetection.
Extract the methods from
detect()
inBlobDetection.java
.In
LongMethodDetection.java
final Integer value = this.annotator.getInstructionCount(aClass.getName(), aMethod.getID());
With the following values:
aClass.getName(): javax.xml.parsers.DocumentBuilder
aMethod.getID(): isNamespaceAware()
Result:
value = null
Problem:
The boxplot gives the same value for both NAD and NMD.
Blob:
Large Class
NameClass:
org.argouml.uml.diagram.collaboration.ui.UMLCollaborationDiagram
Values: {NAD=13.0, NMD=9.0}
Threshold: {NAD=13.0, NMD=13.0}
Data Class
NameClass:
org.argouml.uml.diagram.ui.ActionAddAssociationRole
Values: {NAD=1.0, NMD=1.0}
Blob:
Data Class
NameClass:
org.apache.xerces.validators.common.InsertableElementsInfo
Values: {NAD=8.0, NMD=1.0}
Large Class
NameClass:
org.apache.xerces.validators.common.DFAContentModel
Values: {NAD=22.0, NMD=13.0}
Threshold: {NAD=23.0, NMD=23.0}
Moreover, getHigherValues does not work!
The text was updated successfully, but these errors were encountered: