mambax7/pedigree

View on GitHub
class/ZervWizard.php

Summary

Maintainability
D
1 day
Test Coverage

Function process has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function process($action, $form, $process = true)
    {
        if ($action == $this->resetAction) {
            $this->clearContainer();
            $this->setCurrentStep($this->getFirstIncompleteStep());
Severity: Minor
Found in class/ZervWizard.php - About 4 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

ZervWizard has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

class ZervWizard
{
    // whether or not all steps of the form are complete
    public $_complete = false;
    // internal array to store the various steps
Severity: Minor
Found in class/ZervWizard.php - About 3 hrs to fix

    File ZervWizard.php has 274 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace XoopsModules\Pedigree;
    
    /**
    Severity: Minor
    Found in class/ZervWizard.php - About 2 hrs to fix

      Method process has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function process($action, $form, $process = true)
          {
              if ($action == $this->resetAction) {
                  $this->clearContainer();
                  $this->setCurrentStep($this->getFirstIncompleteStep());
      Severity: Major
      Found in class/ZervWizard.php - About 2 hrs to fix

        Function getFollowingStep has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getFollowingStep($step)
            {
                $ret   = null;
                $steps = \array_keys($this->_steps);
        
        
        Severity: Minor
        Found in class/ZervWizard.php - About 45 mins 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 stepCanBeProcessed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function stepCanBeProcessed($step)
            {
                $steps    = \array_keys($this->_steps);
                $numSteps = \count($steps);
        
        
        Severity: Minor
        Found in class/ZervWizard.php - About 25 mins 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

        There are no issues that match your filters.

        Category
        Status