heiglandreas/JUnitDiff

View on GitHub

Showing 6 of 14 total issues

Function parseFile has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseFile($filename)
    {
        if (! is_readable($filename)) {
            throw new \UnexpectedValueException(sprintf(
                'File %s is not readable',
Severity: Minor
Found in src/JUnitParser.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method execute has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln([
            $this->getApplication()->getLongVersion(),
            '',
Severity: Major
Found in src/Command/DiffCommand.php - About 2 hrs to fix

    Method parseFile has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function parseFile($filename)
        {
            if (! is_readable($filename)) {
                throw new \UnexpectedValueException(sprintf(
                    'File %s is not readable',
    Severity: Major
    Found in src/JUnitParser.php - About 2 hrs to fix

      Method execute has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $style = new DiffStyle($input, $output);
              $style->title($this->getApplication()->getLongVersion());
      
      
      Severity: Minor
      Found in src/Command/CompareCommand.php - About 1 hr to fix

        Function execute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                $output->writeln([
                    $this->getApplication()->getLongVersion(),
                    '',
        Severity: Minor
        Found in src/Command/DiffCommand.php - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function write has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function write(MergeResult $mergeResult)
            {
                $mergeResult->sort();
        
                foreach ($mergeResult as $key => $value) {
        Severity: Minor
        Found in src/Writer/Standard.php - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Severity
        Category
        Status
        Source
        Language