nitc :: BadConceptionFinder :: _filter
nitc :: BadConceptionFinder :: _model
nitc :: BadConceptionFinder :: _phase
nitc :: BadConceptionFinder :: _score
nitc :: BadConceptionFinder :: collect
Collect code smell with selected toolcontext optionnitc :: BadConceptionFinder :: filter
nitc :: BadConceptionFinder :: filter=
nitc :: BadConceptionFinder :: mclassdef
nitc :: BadConceptionFinder :: model
nitc :: BadConceptionFinder :: model=
nitc :: BadConceptionFinder :: phase
nitc :: BadConceptionFinder :: phase=
nitc :: BadConceptionFinder :: score
nitc :: BadConceptionFinder :: score=
nitc $ BadConceptionFinder :: SELF
Type of this instance, automatically specialized in every classnitc :: BadConceptionFinder :: _filter
nitc :: BadConceptionFinder :: _model
nitc :: BadConceptionFinder :: _phase
nitc :: BadConceptionFinder :: _score
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: BadConceptionFinder :: collect
Collect code smell with selected toolcontext optioncore :: Object :: defaultinit
nitc :: BadConceptionFinder :: filter
nitc :: BadConceptionFinder :: 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 :: BadConceptionFinder :: mclassdef
nitc :: BadConceptionFinder :: model
nitc :: BadConceptionFinder :: model=
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 :: BadConceptionFinder :: phase
nitc :: BadConceptionFinder :: phase=
nitc :: BadConceptionFinder :: score
nitc :: BadConceptionFinder :: score=
class BadConceptionFinder
var mclassdef: MClassDef
var array_badconception = new Array[BadConception]
var phase: CodeSmellsMetricsPhase
var model: Model
var filter: ModelFilter
var score = 0.0
# Collect code smell with selected toolcontext option
fun collect do
var bad_conception_elements = new Array[BadConception]
# Check toolcontext option
if phase.toolcontext.opt_feature_envy.value or phase.toolcontext.opt_all.value then bad_conception_elements.add(new FeatureEnvy(phase, model, filter))
if phase.toolcontext.opt_long_method.value or phase.toolcontext.opt_all.value then bad_conception_elements.add(new LongMethod(phase, model, filter))
if phase.toolcontext.opt_long_params.value or phase.toolcontext.opt_all.value then bad_conception_elements.add(new LongParameterList(phase, model, filter))
if phase.toolcontext.opt_no_abstract_implementation.value or phase.toolcontext.opt_all.value then bad_conception_elements.add(new NoAbstractImplementation(phase, model, filter))
if phase.toolcontext.opt_large_class.value or phase.toolcontext.opt_all.value then bad_conception_elements.add(new LargeClass(phase, model, filter))
# Collected all code smell if their state is true
for bad_conception_element in bad_conception_elements do
if bad_conception_element.collect(self.mclassdef,phase.toolcontext.modelbuilder) then array_badconception.add(bad_conception_element)
end
# Compute global score
collect_global_score
end
fun print_collected_data do
if array_badconception.length != 0 then
print "--------------------"
print phase.toolcontext.format_h1("Full name: {mclassdef.full_name} Location: {mclassdef.location}")
for bad_conception in array_badconception do
bad_conception.print_result
end
end
end
fun collect_global_score do
if array_badconception.not_empty then
for bad_conception in array_badconception do
self.score += bad_conception.score
end
end
end
end
src/metrics/codesmells_metrics.nit:118,1--160,3