Skip to main content

Prototyping a Quality Assessment Tool with Parameterized Quality Models

Project description

Quality Tool

Setup

Make sure you have Poetry >= 1.2.0 installed. You can then get started by running:

poetry install

Code duplication - cpd

As of this moment, we are using copy paste detector to find duplicate code. This requires you to download cpd and place the bin/ and lib/ folder (and their files) in a cpd subfolder in metrics (metrics/cpd/<cpd folders goes here>).

You can download cpd from the following link (check if there is a newer release): https://github.com/pmd/pmd/releases/tag/pmd_releases/6.54.0

Programming Language Detection - GitHub Linguist

To detect the programming languages of source code files we use GitHub linguist by running it in a docker container. Make sure you have Docker >= 23.0.4 installed. You will also need to pull the docker image for GitHub Linguist:

docker pull toffernator/linguist

Running, Testing, and Formatting

This is all done using poetry. To run:

poetry run core <path/to/source/code> <Quality_model>

e.g.

poetry run core . code_climate

To see supported languages please refer to: byoqm/source_coordinator/languages.py

Optional values can be gotten by running:

poetry run core --help

To test:

poetry run test

To format:

poetry run black .

Building Tree-Sitter Grammars

Make sure you have a build/ and grammars/ folders in the root of the project:

mkdir build grammars

Clone the python grammar into grammars/:

cd grammars && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-python && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-c-sharp && git clone --depth 1 https://github.com/tree-sitter/tree-sitter-java && cd -

Build the grammar file:

poetry run python core/build_treesitter.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

milkfrog-0.1.0.tar.gz (24.4 kB view hashes)

Uploaded Source

Built Distribution

milkfrog-0.1.0-py3-none-any.whl (29.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page