What is Code Analyser ?
#
AboutIt is a tool that scrapes your code and returns useful insights like Databases, Frameworks, Dependencies, Runtime, Environment variables, ORMs, Test Cases, Docker files, Procfile, Makefile & also Commands like build, test, startUp, seeds, migration, and many more...
#
How does it work?It uses Plug-In architecture, A plug-in is a bundle that adds functionality to an application, called the host application, through some well-defined architecture for extensibility. This allows third-party developers to add functionality to an application without having access to the source code.
#
Go-PluginHere it is using a go-plugin from hashicorp.
go-plugin
is a Go (golang) plugin system over RPC that works over a local [reliable] network.
Hashicorp Plugins are Go interface implementations.
#
WorkflowNow lets conitnue to understand our basic flow
- Firstly it loads all the plugins available and makes them available for further use by storing the connection in memory.
- It analyses the provided code base with enry and gets languages with their usage percent.
- Then our core extracts all the necessary plugins and executes them.
- There is mainly two categories of plugins :-
- Language plugin:- They are language-specific plugins for example if it is made for JS it will only work when JS code detected
- Global plugin:- They are language-independent plugins
- It stores the final results & error generated by plugins and returns all the insights.
#
Where can be used ?- If you want automate the scrapping of projects without going thorugh the code .
#
WorkflowThis is how Code Analyser Works under the hood.