2. How to ExtendΒΆ
mecoSHARK can be extended by adding new processors for other programming languages.
All processors are stored in the mecoshark/processor folder. There are conditions, which must be fulfilled by the backends so that it is accepted by the mecoSHARK:
The *.py file for this backend must be stored in the mecoshark/processor folder.
It must inherit from
thresholdand implement the methods defined there.
The process of chosing the backend is the following:
Via sloccount the number of files get calculated that have the same programming languages
In each processor a threshold is defined
()that shows when the processor will gets executed (e.g., 0.5 means that at least 50% of all files must have this programming languageAfterwards the processor calls
process()
There are several important things to note:
If you want to use a logger for your implementation, get it via
logger = logging.getLogger("processor")
The execution logic is in the application class and explained here
MecoSHARK.
3. If you want to have an example how to implement this class, look at
PythonProcessor