Skip to main content

What is Code Analyser ?

About#

It 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-Plugin#

Here 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.

Workflow#

Now lets conitnue to understand our basic flow

  1. Firstly it loads all the plugins available and makes them available for further use by storing the connection in memory.
  2. It analyses the provided code base with enry and gets languages with their usage percent.
  3. Then our core extracts all the necessary plugins and executes them.
  4. There is mainly two categories of plugins :-
    1. Language plugin:- They are language-specific plugins for example if it is made for JS it will only work when JS code detected
    2. Global plugin:- They are language-independent plugins
  5. 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 .

Workflow#

This is how Code Analyser Works under the hood. Workflow