nitc :: CodeSmellsMetricsPhase :: _average_number_of_attribute
nitc :: CodeSmellsMetricsPhase :: _average_number_of_parameter
nitc :: CodeSmellsMetricsPhase :: average_number_of_attribute=
nitc :: CodeSmellsMetricsPhase :: average_number_of_parameter=
nitc $ CodeSmellsMetricsPhase :: SELF
Type of this instance, automatically specialized in every classnitc $ CodeSmellsMetricsPhase :: process_mainmodule
Specific action to execute on the whole program.nitc :: CodeSmellsMetricsPhase :: _average_number_of_attribute
nitc :: CodeSmellsMetricsPhase :: _average_number_of_parameter
nitc :: Phase :: _in_hierarchy
The dependence relation of the phase with the other phasesnitc :: Phase :: _toolcontext
The toolcontext instance attached to the phasenitc :: CodeSmellsMetricsPhase :: average_number_of_attribute=
nitc :: CodeSmellsMetricsPhase :: average_number_of_parameter=
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
nitc :: Phase :: defaultinit
nitc :: Phase :: in_hierarchy
The dependence relation of the phase with the other phasesnitc :: Phase :: in_hierarchy=
The dependence relation of the phase with the other phasescore :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: Phase :: process_annotated_node
Specific actions to execute on annotated nodesnitc :: Phase :: process_mainmodule
Specific action to execute on the whole program.nitc :: Phase :: process_nclassdef
Specific actions to execute on the tree of a class definitionnitc :: Phase :: process_nmodule
Specific actions to execute on the whole tree of a modulenitc :: Phase :: process_nmodule_after
Specific actions to execute on the whole tree of a modulenitc :: Phase :: process_npropdef
Specific actions to execute on the tree of a propertynitc :: Phase :: toolcontext
The toolcontext instance attached to the phasenitc :: Phase :: toolcontext=
The toolcontext instance attached to the phase
class CodeSmellsMetricsPhase
super Phase
var average_number_of_lines = 0.0
var average_number_of_parameter = 0.0
var average_number_of_method = 0.0
var average_number_of_attribute = 0.0
redef fun process_mainmodule(mainmodule, given_mmodules) do
print toolcontext.format_h1("--- Code Smells Metrics ---")
var model = toolcontext.modelbuilder.model
var filter = new ModelFilter(private_visibility)
self.set_all_average_metrics(model)
var mclass_codesmell = new BadConceptonController(model, filter)
var collect = new Counter[MClassDef]
var mclassdefs = new Array[MClassDef]
for mclass in mainmodule.flatten_mclass_hierarchy do
mclass_codesmell.collect(mclass.mclassdefs,self)
end
if toolcontext.opt_get_all.value then
mclass_codesmell.print_all
else
mclass_codesmell.print_top(10)
end
end
fun set_all_average_metrics(model: Model) do
var model_builder = toolcontext.modelbuilder
self.average_number_of_lines = model.get_avg_linenumber(model_builder)
self.average_number_of_parameter = model.get_avg_parameter
self.average_number_of_method = model.get_avg_method
self.average_number_of_attribute = model.get_avg_attribut
end
end
src/metrics/codesmells_metrics.nit:27,1--61,3