nitc :: nitsmells $ ToolContext
For force nit to do the good linéarisation to remove the toolcontext redef warningnitc :: nitsmells $ ToolContext
For force nit to do the good linéarisation to remove the toolcontext redef warningnitc :: actors_injection_phase
Injects model for the classes annotated with "is actor" sonitc :: astbuilder
Instantiation and transformation of semantic nodes in the AST of expressions and statementsnitc :: i18n_phase
Basic support of internationalization through the generation of id-to-string tablesSerializable::inspect
to show more useful information
nitc :: modelbuilder
more_collections :: more_collections
Highly specific, but useful, collections-related classes.threaded
annotation
serialization :: serialization_core
Abstract services to serialize Nit objects to different formatsnitc :: serialization_model_phase
Phase generating methods (model-only) to serialize Nit objectsnitc :: toolcontext
Common command-line tool infrastructure than handle options and error messagescore :: union_find
union–find algorithm using an efficient disjoint-set data structure
import nitsmell_toolcontext
import semantize
import codesmells_metrics
# For force nit to do the good linéarisation to remove the toolcontext redef warning
redef class ToolContext
redef init do super
end
# Create a tool context to handle options and paths
var toolcontext = new ToolContext
toolcontext.tooldescription = "Usage: nitsmells [OPTION]... <file.nit>...\n Computes code smells on Nit programs."
# We do not add other options, so process them now!
toolcontext.process_options(args)
# Get arguments
var arguments = toolcontext.option_context.rest
# We need a model to collect stufs
var model = new Model
# An a model builder to parse files
var modelbuilder = new ModelBuilder(model, toolcontext)
# Here we load an process all modules passed on the command line
var mmodules = modelbuilder.parse_full(arguments)
modelbuilder.run_phases
print "*** CODE SMELLS METRICS ***"
toolcontext.run_global_phases(mmodules)
src/nitsmells.nit:15,1--39,39