Code Monkey home page Code Monkey logo

stottlerhenke / cbri-calculation Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 39 KB

This project contains scripts that use the Understand static analysis tool to calculate key metrics associated with technical debt for a list of GitHub repositories and compiles the results into a single file.

License: GNU Affero General Public License v3.0

Python 8.54% Shell 1.81% Perl 89.65%
static-analysis architecture-evaluation source-code-analysis source-code-metrics

cbri-calculation's Introduction

CBRI-Calculation

This project contains scripts that use the Understand static analysis tool to calculate key metrics associated with technical debt for a list of GitHub repositories and compiles the results into a single file.

Installation

  1. Download the repository. The location of the script files is referred to as <current directory>.
  2. Install Understand. Download Understand (https://scitools.com) and install to <current directory>/scitools.
  • Alternately, install to a different location and change cloneAndAnalyze.sh to point to the correct locations of und and uperl (default relative path: scitools/bin/linux64/und, same for uperl).
  1. Run Understand. Run the Understand application and ensure licensing is working correctly. Drag and drop the file CoreMetrics_v1.10.upl into the main window of understand to install the core metrics plugin.

To run the analysis script and compile the output

  • bash cloneAndAnalyze.sh <input file>
    • <input file> is a text file containing a list of projects in username/projectname form (matching https://github.com/username/projectname), one project per line.
      • E.g. example_projects.txt.
    • The script will:
      • Clone repositories into cloned_projects/.
      • Analyze the code with Understand and put the results into created_dbs/.
      • Run the core metrics plugin on each cloned project and put those results (classMetrics.csv, fileMetrics.csv, index.html) into repository-specific folder in data/
        • E.g. data/WorldWindJava/
      • Collect repository details queried using the GitHub API.
        • E.g. data/WorldWindJava/fromGitHub.json
  • python csvConverter.py <input file>
    • <input file> is the same form as used in cloneAndAnalyze.sh. It can be identical but it doesn't have to be (e.g. if you want to show only a subset of the cloned projects).
    • Results are compiled to the file output.csv.

cbri-calculation's People

Contributors

jeremyludwig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

doytsujin

cbri-calculation's Issues

tweaks for running in macOS

Hi!
Following the installation instructions, using macOS Mojave, some tweaks had to be done to get the tool to run properly on my machine:

By default, using the Understand installer, Understand is installed in the Applications folder. Had to manually move the folder to <current directory>/scitools and then edit the cloneAndAnalyze.sh to instead point to
scitools/Understand.app/Contents/MacOS/und
and
scitools/Understand.app/Contents/MacOS/uperl

Further, errors appeared when und tried to create a database. By manually creating the folder <current directory>/created_dbs this error was bypassed & now the tool runs perfectly fine :)

tldr:

  • Copy/move Understand.app to <current directory>/scitools
  • Change the cloneAndAnalyze.sh script to point to und and uperl that now resides in <current directory>/scitools/Understand.app/Contents/MacOS/
  • Create a folder <current directory>/created_dbs

Thanks for a great tool! :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.