Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Commit

Permalink
Experiment in TC
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Aug 17, 2020
1 parent 5529245 commit 86d9648
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions tests/ConverterTeamCityInspectionsTest.php
Expand Up @@ -17,7 +17,6 @@

use JBZoo\ToolboxCI\Converters\CheckStyleConverter;
use JBZoo\ToolboxCI\Converters\JUnitConverter;
use JBZoo\ToolboxCI\Converters\PhpMdJsonConverter;
use JBZoo\ToolboxCI\Converters\TeamCityInspectionsConverter;

/**
Expand Down Expand Up @@ -46,31 +45,6 @@ public function testPhpCsCodestyle()
]), $actual);
}

public function testPhpMdJson()
{
$source = (new PhpMdJsonConverter())
->setRootPath('/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/')
->toInternal(file_get_contents(Fixtures::PHPMD_JSON));

$actual = (new TeamCityInspectionsConverter(['show-datetime' => false]))
->setFlowId(1)
->fromInternal($source);

isSame(implode('', [
"\n##teamcity[inspectionType id='PHPmd' name='UnusedFormalParameter' category='PHPmd' description='Issues found while checking coding standards' flowId='1']\n",
"\n##teamcity[inspection typeId='PHPmd' file='/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Application.php' line='26' message='------------------------------------------------------------------------------------------------------------------------|nsrc/Console/Application.php line 26|nAvoid unused parameters such as |'\$input|'.|n Rule : Unused Code Rules / UnusedFormalParameter / Priority: 3|n PHP Mute : @SuppressWarnings(PHPMD.UnusedFormalParameter)|n File Path: /Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Application.php:26|n Docs : https://phpmd.org/rules/unusedcode.html#unusedformalparameter' SEVERITY='ERROR' flowId='1']\n",
"\n##teamcity[inspection typeId='PHPmd' file='/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Application.php' line='26' message='------------------------------------------------------------------------------------------------------------------------|nsrc/Console/Application.php line 26|nAvoid unused parameters such as |'\$input|'.|n Rule : Unused Code Rules / UnusedFormalParameter / Priority: 3|n PHP Mute : @SuppressWarnings(PHPMD.UnusedFormalParameter)|n File Path: /Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Application.php:26|n Docs : https://phpmd.org/rules/unusedcode.html#unusedformalparameter' SEVERITY='ERROR' flowId='1']\n",
"\n##teamcity[inspection typeId='PHPmd' file='/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php' line='24' message='------------------------------------------------------------------------------------------------------------------------|nsrc/Console/Command.php line 24|nThe class Command has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.|n Rule : Design Rules / CouplingBetweenObjects / Priority: 2|n PHP Mute : @SuppressWarnings(PHPMD.CouplingBetweenObjects)|n File Path: /Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php:24|n Docs : https://phpmd.org/rules/design.html#couplingbetweenobjects' SEVERITY='ERROR' flowId='1']\n",
"\n##teamcity[inspection typeId='PHPmd' file='/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php' line='29' message='------------------------------------------------------------------------------------------------------------------------|nsrc/Console/Command.php line 29|nThe method configure() has 114 lines of code. Current threshold is set to 100. Avoid really long methods.|n Rule : Code Size Rules / ExcessiveMethodLength / Priority: 3|n PHP Mute : @SuppressWarnings(PHPMD.ExcessiveMethodLength)|n Func : Povils\PHPMND\Console\Command->configure()|n File Path: /Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php:29|n Docs : https://phpmd.org/rules/codesize.html#excessivemethodlength' SEVERITY='ERROR' flowId='1']\n",
"\n##teamcity[inspection typeId='PHPmd' file='/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php' line='144' message='------------------------------------------------------------------------------------------------------------------------|nsrc/Console/Command.php line 144|nThe method execute() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.|n Rule : Code Size Rules / CyclomaticComplexity / Priority: 3|n PHP Mute : @SuppressWarnings(PHPMD.CyclomaticComplexity)|n Func : Povils\PHPMND\Console\Command->execute()|n File Path: /Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php:144|n Docs : https://phpmd.org/rules/codesize.html#cyclomaticcomplexity' SEVERITY='ERROR' flowId='1']\n",
"\n##teamcity[inspection typeId='PHPmd' file='/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php' line='144' message='------------------------------------------------------------------------------------------------------------------------|nsrc/Console/Command.php line 144|nThe method execute() has an NPath complexity of 2736. The configured NPath complexity threshold is 200.|n Rule : Code Size Rules / NPathComplexity / Priority: 3|n PHP Mute : @SuppressWarnings(PHPMD.NPathComplexity)|n Func : Povils\PHPMND\Console\Command->execute()|n File Path: /Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php:144|n Docs : https://phpmd.org/rules/codesize.html#npathcomplexity' SEVERITY='ERROR' flowId='1']\n",
"\n##teamcity[inspection typeId='PHPmd' file='/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php' line='256' message='------------------------------------------------------------------------------------------------------------------------|nsrc/Console/Command.php line 256|nAvoid unused private methods such as |'castToNumber|'.|n Rule : Unused Code Rules / UnusedPrivateMethod / Priority: 3|n PHP Mute : @SuppressWarnings(PHPMD.UnusedPrivateMethod)|n Func : Povils\PHPMND\Console\Command->castToNumber()|n File Path: /Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php:256|n Docs : https://phpmd.org/rules/unusedcode.html#unusedprivatemethod' SEVERITY='ERROR' flowId='1']\n",
"\n##teamcity[inspection typeId='PHPmd' file='/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php' line='256' message='------------------------------------------------------------------------------------------------------------------------|nsrc/Console/Command.php line 256|nAvoid unused private methods such as |'castToNumber|'.|n Rule : Unused Code Rules / UnusedPrivateMethod / Priority: 3|n PHP Mute : @SuppressWarnings(PHPMD.UnusedPrivateMethod)|n Func : Povils\PHPMND\Console\Command->castToNumber()|n File Path: /Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Command.php:256|n Docs : https://phpmd.org/rules/unusedcode.html#unusedprivatemethod' SEVERITY='ERROR' flowId='1']\n",
"\n##teamcity[inspection typeId='PHPmd' file='/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Option.php' line='49' message='------------------------------------------------------------------------------------------------------------------------|nsrc/Console/Option.php line 49|nAvoid excessively long variable names like \$includeNumericStrings. Keep variable name length under 20.|n Rule : Naming Rules / LongVariable / Priority: 3|n PHP Mute : @SuppressWarnings(PHPMD.LongVariable)|n File Path: /Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Option.php:49|n Docs : https://phpmd.org/rules/naming.html#longvariable' SEVERITY='ERROR' flowId='1']\n",
"\n##teamcity[inspection typeId='PHPmd' file='/Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Option.php' line='121' message='------------------------------------------------------------------------------------------------------------------------|nsrc/Console/Option.php line 121|nAvoid excessively long variable names like \$includeNumericStrings. Keep variable name length under 20.|n Rule : Naming Rules / LongVariable / Priority: 3|n PHP Mute : @SuppressWarnings(PHPMD.LongVariable)|n File Path: /Users/smetdenis/Work/projects/jbzoo-toolbox-ci/vendor/povils/phpmnd/src/Console/Option.php:121|n Docs : https://phpmd.org/rules/naming.html#longvariable' SEVERITY='ERROR' flowId='1']\n",
]), $actual);
}

public function testJUnitSimple()
{
$source = (new JUnitConverter())
Expand Down

0 comments on commit 86d9648

Please sign in to comment.