Skip to content

Commit

Permalink
Refactoring the baseline code, fixed the bin, added DI (#6) (#7)
Browse files Browse the repository at this point in the history
* Fixing the bin to run on the app itself
* Moving the delta calculation to the metrics object
* Refactoring the baseline handling.
* Fixing a bug in the visitor
* Added DI
  • Loading branch information
floriankraemer authored Sep 24, 2024
1 parent 34c8fe3 commit fd296a5
Show file tree
Hide file tree
Showing 28 changed files with 1,212 additions and 667 deletions.
13 changes: 0 additions & 13 deletions analyse.php

This file was deleted.

16 changes: 7 additions & 9 deletions bin/cognitive-analysis
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/usr/bin/env php
<?php

require_once __DIR__ . '/../../../autoload.php';
if (file_exists(__DIR__ . '/../../../autoload.php')) {
require_once __DIR__ . '/../../../autoload.php';
} else {
require_once __DIR__ . '/../vendor/autoload.php';
}

use Phauthentic\CodeQualityMetrics\Command\CognitiveMetricsCommand;
use Phauthentic\CodeQualityMetrics\Command\HalsteadMetricsCommand;
use Symfony\Component\Console\Application;
use Phauthentic\CodeQualityMetrics\Application;

$application = new Application();
$application->add(new CognitiveMetricsCommand());
$application->add(new HalsteadMetricsCommand());

$application->run();
(new Application())->run();
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"nikic/php-parser": "^5.1",
"symfony/console": "^7.1",
"symfony/config": "^7.1",
"symfony/yaml": "^7.1"
"symfony/yaml": "^7.1",
"symfony/dependency-injection": "^7.1"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit fd296a5

Please sign in to comment.