This package was created for the MGL843 course at ETS Montréal. It aims at detecting the proportions of certain anti-patterns in pure TypeScript and Angular projects. The detected anti-patterns are the following :
- Long Method
- Long Parameter List
- God Class
- Lazy Class
- The any Type ( bad practice in TypeScript )
A collection of scripts to conduct analysis on TypeScript Projetcs using Pharo and Moose This version is developped for Moose 8.0.2 image This Script relies heavily on the FamixTypeScript by Arezoo-Nasr. Be sure to have it ready in your image before using.
Please use Iceberg to import it in your image : Iceberg -> Add -> Clone from github.com -> Onwer name : Jean-Baptiste-E; Project Name : TypeScriptAnalizer. Be sure to choose the master branch in remote and do not forget to load the package.
Analizing prjects first require you to have genereated the JSON files for your projetcs using the FamixTypeScriptImporter. Create a folder in your image and put all the JSON in this folder. Then in a Moose Playground type :
TypeScriptAnalyzer new analyzeAllProjects: '<NameOfYourFolder>'.
After completion you will find a .csv
file in your image folder containing all the statistics relevant to the detection of the mentionned Anti-patterns.
At the moment only one visualization is available using Roassal. It allows you to see every class in your project and their inheritance tree. The size of each circle represents the size of each class in terms of number of methods. Finaly red classes have been detected as god classes :
To use this tool open a Moose Playground and type :
model:= ProjectLoader new loadProject: 'path/of/your/project/JSON.json'.
ProjectVisualisation seeGodClasses: model.