Download the PHP package leovie/clover-crap-check without Composer

On this page you can find all versions of the php package leovie/clover-crap-check. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package clover-crap-check

clover-crap-check

This tool reads the clover.xml report from phpunit and checks, if all files have a CRAP index below a specified threshold.

Installation

PHAR (recommended)

You can download the latest PHAR from https://github.com/LeoVie/clover-crap-check/releases/latest

Composer

Install via composer as a dev dependency

Usage

The tool has two required arguments

  1. The path of the clover.xml file, that's generated by phpunit. The path can be absolute or relative to cwd.
  2. The CRAP index threshold that is acceptable (min 1)

Generate the clover.xml file by using phpunit and run clover-crap-check afterwards:

This can give you an output like the following

Baseline feature

When using clover-crap-check with legacy code, likely you don't want to refactor all your files to have a low CRAP index. At the same time you want your new code to be as less CRAPpy as possible.

To achieve this with clover-crap check, there is a baseline feature.

1. Generate the baseline

In addition to the required arguments, pass the option --generate-baseline with a path to where the baseline file should get stored. The path can be absolute or relative to cwd.

This will run clover-crap-check and generate a baseline file that contains all your files with a CRAP index over the defined threshold (50 in this case).

The baseline files looks like the following `

2. Use the baseline

After generating the baseline, you can use it in the next runs. To do this, simply pass the path to the baseline file via the option --baseline to the tool. The path can be absolute or relative to cwd.

clover-crap-check should not report anything in that case.

Now, when you add new files with a CRAP index over the defined threshold (50 in this case), you will get noticed about that. The same thing happens, when files in your baseline get CRAPpier, than they were when the baseline was generated.

This can give you an output like the following

3. Keeping the baseline up to date

You can decide to generate the baseline once and then never touch it again. This can be useful when you have very many files in the baseline and don't want to bother with improving the legacy code over the time.

But you can also decide to get noticed, when a file gets less CRAPpy. To do this, you can pass the option --report-less-crappy-methods to clover-crap-check

This will give you a hint, e.g. when a file that had a CRAP index of 100 when you generated the baseline now has a CRAP index of 60.

You can than manually update the CRAP value in the baseline file (to 60 in this case).

There's also another option --report-vanished-methods. When activated, clover-crap-check will notice you when there are methods in your baseline, that are not occurring anymore in the clover report or have a CRAP index below your threshold, now.


All versions of clover-crap-check with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
symfony/console Version ^7.2
symfony/css-selector Version ^7.2
symfony/dom-crawler Version ^7.2
symfony/filesystem Version ^7.2
thecodingmachine/safe Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package leovie/clover-crap-check contains the following files

Loading the files please wait ...