bronek/code-complexity

Simple tool to measure code cyclomatic complexity as described on https://phpmd.org/rules/codesize.html

Installs: 19

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

pkg:composer/bronek/code-complexity

v0.1.0 2017-09-05 14:08 UTC

This package is auto-updated.

Last update: 2025-09-21 01:26:44 UTC


README

Class for check code complexity score of php code.

Install

composer require bronek/code-complexity

Usage

<?php

$calculator = new \Bronek\CodeComplexity\CodeComplexityCalculator();
$complexityScore = $calculator->calculate(file_get_contents('file.php'));

echo "Code Complexity of file file.php is $complexityScore"