Moose-CI runs automatic Moose analyses on software projects.
Disclaimer: This project is at a very early stage. It only has a few features and may contain bugs.
You can request features in the issues tab.
Some of features it should offer:
- run alone ("headless" mode)
- load a project (either from command line or in a configuration file)
- accept projects inany programming language that Moose can handle (C, Java, Pharo, Python, Typescript,...)
- run a list of analyses (either "standard" ones, or some specified in a configuration file)
- output the results in an appropriate format (specified on command line or configuration file: text, JSON, XML, CSV,...)
Some metrics and analyses that are envisionned:
- size (LOC, # of classes,...)
- report number of entities that fail the rules
- list too big classes (based on LOC or # members)
- list too big methods/functions (based on LOC)
- list of too complex methods/functions (based on cyclomatic complexity)
- list of too large method/function APIs (# number of parameters)
- packages/modules in cyclic dependencies
- list of code clones
In would be good to be able to output some visualizations already available in Moose:
- DSM (Dependency Structure Matrix)
- Architectural view
- System complexity
- Distribution map
The easiest way to run Moose-CI is with Docker. You do not need Pharo or any other dependency.
First, pull the image:
docker pull ghcr.io/moosetechnology/moose-ci:latestMoose-CI runs in an isolated container. Mount your project to /src:
docker run -v /path/to/your/project:/src ghcr.io/moosetechnology/moose-ci:latest analyze /srcFor the current directory:
docker run -v "$(pwd):/src" ghcr.io/moosetechnology/moose-ci:latest analyze /srcinit— create a new moose-ci config file.analyze— analyze the current directory using the existing config file.analyze <project-path>— analyze the project.
Moose-CI uses a moose-ci.ston config file. Run moose-ci init to create one.
You can update the rules list and customize each rule's threshold:
...
#rules : [
#long_file: 1000,
#no_docstring,
#too_many_parameters: 10
]
...| Key | Threshold | Description |
|---|---|---|
#long_file |
1000 | Reports files whose number of lines of code exceeds the threshold. |
#no_docstring |
N/A | Reports functions, methods and classes that are missing a docstring. |
#too_many_parameters |
10 | Reports methods whose number of parameters exceeds the threshold. |
#large_class |
20 | Reports classes that have too many methods or attributes. |
#local_var_naming |
N/A | Reports local variables and parameters whose names do not respect the naming convention. |
#unused_local_variable |
N/A | Reports local variables that are written but never read. |
#unused_parameter |
N/A | Reports function and method parameters that are never used. |
#unused_private_method |
N/A | Reports class-private methods that are never invoked. |
#shadowed_attribute |
N/A | Reports attributes whose name duplicates their containing class name. |
#function_naming |
N/A | Reports functions whose names do not comply with the naming convention. |
Load MooseCI in a Moose image with Metacello:
Metacello new
baseline: 'MooseCI';
repository: 'github://moosetechnology/MooseCI:master/src';
load.