Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools

Smells and Metrics

The following smells and metrics are sorted alphabetically and grouped by the internal cultivate structure.

Have a look at our tutorial to see how you find the smells and metrics in Eclipse and to read our tribute to one of the most recent books on the topic.


A software metric, maps parts of the code structure to a positive numerical value. For example lines of code is a (very simple) software metric.

List of Metrics

1 mean_relative_height_in_inheritance_tree (dsp) improved ratio of abstract classes.
2 Ca afferent_couplings [Martin94] Number of afferent coupelings that means the number of classes outside of this package that depend on classes inside of this package.
3 average_method_weight [Lanza06] average cyclomatic complexity.
4 base_class_overriding_ratio [Lanza06] ratio of overridden to total members of baseclass.
5 base_class_usage_ratio [Lanza06] ratio of used to total inheritance-specific members of baseclass.
6 changing_classes [Lanza06] number of classes calling this method.
7 changing_methods [Lanza06] number of methods calling this method.
8 class_instability [Martin94]? degree of class instability.
9 co [Briand98]? normalized count of the number of edges of G of lcom4.
10 coupling_dispersion [Lanza06] number of classes called divided by coupling_intensity.
11 coupling_intensity [Lanza06] number of distinct methods called.
12 cyclomatic_complexity McCabe Number of linear indipendent path through the control flow.
13 D distance [Martin94] distance from the main line.
14 DIT depth_of_inheritance_tree [CK94] depth of inheritance tree.
15 TDOI temporal_degree_of_interest [Jancke10] temporal degree of interest (T-DOI).
16 Ce efferent_couplings [Martin94] number of classes inside this package that depend on classes outside this package.
17 lines_of_code_in_file ??? Lines of Code for every file.
18 I instability [Martin94] degree of instability.
19 LCOM1 lack_of_cohesion_of_methods_1 [CK94] number of methods that not refer to same field.
20 LCOM2 lack_of_cohesion_of_methods_2 [Briand98]? lack of cohesion of methods.
21 LCOM3 lack_of_cohesion_of_methods_3 [Briand98]? number of connected components.
22 LCOM4 lack_of_cohesion_of_methods_4 [Briand98]? number of connected components (modified edge definition).
23 LCOM5 lack_of_cohesion_of_methods_5 [Briand98]? lack of cohesion of methods.
24 max_depth_of_nesting [Lanza06] Maximal nesting depth of a method.
25 mean_variable_usage [Gasper10] Mean usage of all variables.
26 method_access_to_foreign_data [Lanza06] number of attributes from unrelated classes that are accessed by a method.
27 method_delegation_ratio [Lanza06]? ratio of delegating methods in a class.
28 method_foreign_data_providers [Lanza06] number of attributes from unrelated classes that are accessed by a method.
29 method_local_attribute_usage [Lanza06] number of used local attributes.
30 method_locality_of_attribute_access [Lanza06] ratio of used local attributes to accessed foreign attributes.
31 newCoh [Briand98]? alternative for lcom5 modified by briand.
32 NOC number_of_children [CK94] number of children.
33 NOD number_of_descendants ??? number of descendants.
34 NORM number_of_overriden_methods [Lanza06]? number of overridden methods.
35 number_of_accessed_variables [Lanza06]? number of accessed variables (inc. locals arguments and instance fields).
36 number_of_added_services [Lanza06]? number of public methods that do not override or specialize the baseclass.
37 number_of_delegating_methods [Lanza06]? number of delegating methods in a class.
38 NOM number_of_methods [Lanza06]? number of methods in a class.
39 number_of_private_methods [Lanza06]? number of private methods in a type.
40 number_of_protected_members [Lanza06]? number of protected members and fields.
41 number_of_public_accessor_methods [Lanza06]? number of public accessor methods.
42 number_of_public_attributes [Lanza06]? number of public attributes.
43 number_of_public_methods [Lanza06]? number of public methods in a type.
44 number_of_statements ??? The number of statements in a method.
45 number_of_statements_in_class ??? alternative for lcom5 modified by briand.
46 number_of_abstract_classes [Martin94]? number of abstract classes.
47 number_of_interfaces [Martin94]? number of interfaces.
48 number_of_classes [Martin94]? number of classes.
49 paths [Fenton1997]? Number of paths though the controlflow of a method.
50 percentage_of_newly_added_services [Lanza06]? ratio of added public services.
51 private_class_complexity [Lanza06]? cyclomatic complexity of private methods.
52 lines_of_code_in_project ??? Lines of Code in the project.
53 rcm_abstractness [Martin94] ratio of abstract classes.
54 SIX specialization_index ???! specialisation index.
55 percentage_of_tested_methods [dsp] percentage of tested methods.
56 tight_class_cohesion [Briand98]? relative number of method pairs in a class accessing at least one common attribute.
57 type_access_to_foreign_data [Lanza06]? number of attributes from unrelated classes that are accessed by a class.
58 variable_usage_ratio [Gasper10] Number of linear indipendent path through the control flow.
59 weight_of_a_class [Lanza06]? number of “functional” public methods divided by total number of public members (Mar02a).
60 weighted_method_count [CK94] sum of CYCLO metric for a class over all methods of the class.

List of Term Metrics

1 term_idf (jn) Returns two list with the terms and their corresponding nr of occurence.
2 termfrequency (jn) Returns two list with the terms and their corresponding nr of occurence.
3 termsurprise (jn) Returns two list with the terms and tf x idf suprisingness.

List of Relation Metrics

1 package_dependency_degree (dsp) dependency degree between two packages.
2 term_dependency_degree (dsp) dependency degree between two packages based on terms.


Kent Beck defines a “Smell” as structures in code that possibly need a refactoring.

List of Smells

1 assignment_to_parameter [Gasper10] assigning a value to a parameter.
2 brain_class [Lanza06] complex class accumulating excessive intelligence amounts.
3 brain_method [Lanza06] complex method that is very long and accesses many variables.
4 complex_method_in_godclass complex method contributing to a godclass.
5 consistencyViolation
6 data_class [Lanza06] indicates a class with lots of public data and reduced complexity.
7 dispersed_coupling [Lanza06] calls too many classes and methods.
8 feature_envy [Lanza06] indicates a method with feature envy: using more foreign attributes from only some classes than own attributes.
9 forbidden_access
10 only_used_by_tests method only called by tests.
11 god_class [Lanza06] indicates a godclass: non-cohesive overly complex accessing to many foreign attributes.
12 iceberg_class class with significant more private than public methods opportunity to extract class.
13 intensive_coupling [Lanza06] calls too many methods from few classes.
14 law_of_demeter_violation law of demeter violation.
15 method_chain chained method calls ignores external (library) methods.
16 middle_man class delegates more than taking responsibility.
17 test_class_misnamed test class with invalid name.
18 attribute_has_no_accessor a class variable should be private and have getter/setter.
19 unused_method method is not called.
20 package_assigned_to_multiple_layers Every package has to be assigned to at most one layer.
21 package_assigned_to_no_layer Every package has to be assigned to at least one layer.
22 no_operation empty statement.
23 public_variable a class variable should be private and have getter/setter.
24 public_variable_has_accessors
25 refused_parent_bequest [Lanza06] refusing its bequest: protected members not used or overridden.
26 shotgun_surgery [Lanza06] too many incoming method calls.
27 getter_has_sideeffect direct or indirect sideeffect in getter method.
28 tradition_breaker [Lanza06] excessive increase of child class interface where bequest was already substantial.
29 layer_access_rules_violated Dependency of given package violates layer access rule.

List of Relationsmells

1 forbidden_access Dependency from given type violates layer access rule for the containing package
2 consistencyViolation consistency violation.
3 rcm_adp Acyclic Dependencies Principle Violation.
4 rcm_dip Dependency Inversion Principle Violation.
5 rcm_sdp Stable Dependencies Principle Violation.
research/cultivate/smells_and_metrics.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024