All Collections
Tutorials
Running analysis for ad-hoc code directories locally
Running analysis for ad-hoc code directories locally

This simple how-to shows how you can analyze for any codebases

Ville Laitila avatar
Written by Ville Laitila
Updated over a week ago

The most simple way to run analysis on local (Developer) installation of Softagram, is to create an empty directory, copy the codebase into it, run analysis and use the outputs.

# Create the directory
mkdir -p /opt/softagram/input/projects/mycodes/mycodes

# Copy files
cp -r mycodes /opt/softagram/input/projects/mycodes/mycodes/

# Run analysis
docker exec -ti softagram python3 ui/cli/softagramtools.py fullanalysis --input-dir /opt/softagram/input/projects/mycodes/mycodes

After waiting for some time, (e.g. 1 MLOC of code to be analyzed = 1 hour), you can open up the results in Softagram Desktop by this.
Once the output is ready, you can use Softagram Desktop to open the freshly generated model file, .e.g
​    /opt/softagram/output/projects/mycodes/master/2019-09-16_10-47-40Z/dependency/modelfile.xml.zip

Later want to add new repos and re-run analysis for the dir?

  • Just cd to /opt/softagram/input/projects/mycodes/mycodes and do some git clone runs there to get clones into the directory, and re-run the analysis.

Is your Softagram Desktop running in a different machine?

  • Usually this case is handled by using the usual method of creating the project in web UI, adding Git repository for the project, etc. But you can also scp the output directory to the machine Softagram Desktop is running at.

your-pc-with-Softagram-Desktop $  scp user@softagram-installation:/opt/softagram/output/projects/mycodes/master/2019-09-16_10-47-40Z .

When the whole timestamp-based directory is available in your local PC, you may open the model file and all the supplementary attribute files with a single click in Softagram Desktop, by pointing it the modelfile.xml.zip from the dependency directory.

Did this answer your question?