nitc :: LargeClass
nitc :: LargeClass :: _number_attribut
nitc :: LargeClass :: _number_method
nitc :: LargeClass :: defaultinit
nitc :: LargeClass :: number_attribut
nitc :: LargeClass :: number_attribut=
nitc :: LargeClass :: number_method
nitc :: LargeClass :: number_method=
nitc $ LargeClass :: SELF
Type of this instance, automatically specialized in every classnitc $ LargeClass :: collect
Collection methodnitc :: BadConception :: _filter
nitc :: BadConception :: _model
nitc :: LargeClass :: _number_attribut
nitc :: LargeClass :: _number_method
nitc :: BadConception :: _phase
nitc :: BadConception :: _score
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: BadConception :: collect
Collection methodnitc :: LargeClass :: defaultinit
nitc :: BadConception :: defaultinit
core :: Object :: defaultinit
nitc :: BadConception :: filter
nitc :: BadConception :: filter=
core :: 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.
nitc :: BadConception :: model
nitc :: BadConception :: model=
core :: Object :: native_class_name
The class name of the object in CString format.nitc :: LargeClass :: number_attribut
nitc :: LargeClass :: number_attribut=
nitc :: LargeClass :: number_method
nitc :: LargeClass :: number_method=
core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: BadConception :: phase
nitc :: BadConception :: phase=
nitc :: BadConception :: score
nitc :: BadConception :: score=
class LargeClass
super BadConception
var number_attribut = 0
var number_method = 0
redef fun name do return "LARGC"
redef fun desc do return "Large class"
redef fun collect(mclassdef, model_builder): Bool do
self.number_attribut = mclassdef.collect_intro_and_redef_mattributes(filter).length
# Get the number of methods (Accessor include) (subtract the get and set of attibutes with (numberAtribut*2))
self.number_method = mclassdef.collect_intro_and_redef_methods(filter).length
self.score_rate
return self.number_method.to_f > phase.average_number_of_method and self.number_attribut.to_f > phase.average_number_of_attribute
end
redef fun print_result do
print phase.toolcontext.format_h2("{desc}: {number_attribut} attributes and {number_method} methods ({phase.average_number_of_attribute}A {phase.average_number_of_method}M Average)")
end
redef fun score_rate do
score = (number_method.to_f + number_attribut.to_f) / (phase.average_number_of_method + phase.average_number_of_attribute)
end
end
src/metrics/codesmells_metrics.nit:189,1--214,3