fimedinet/escudero

View on GitHub

Showing 20 of 20 total issues

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

    public function getRangeFromCategory($bmiLevel)
    {
        $this->jsonData || $this->initTable();

        // Scan the table
Severity: Minor
Found in src/Tools/Diagnose/RangeDiagnoser.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 calculate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function calculate()
    {
        $this->jsonData || $this->initTable();

        $frameSizeRatio = $this->height / $this->wrc;
Severity: Minor
Found in src/Tools/FrameSize/FrameSizeCalc.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

Blank line found at start of control structure
Open

        if ($this->app->runningInConsole()) {

Blank line found at start of control structure
Open

                if (floatval($minValue) <= $frameSizeRatio && floatval($maxValue) >= $frameSizeRatio) {

Blank line found at start of control structure
Open

                if (intval($minAge) <= $this->age && intval($maxAge) >= $this->age) {

There must be one blank line after the namespace declaration
Open

namespace FimediNET\Escudero\Tools\BMR\Formulas;

Blank line found at start of control structure
Open

            if ($row->category == $bmiLevel && $row->gender == $this->gender) {

Blank line found at start of control structure
Open

        foreach ($this->jsonData as $row) {

Blank line found at start of control structure
Open

        foreach ($this->jsonData as $row) {

There must be one blank line after the namespace declaration
Open

namespace FimediNET\Escudero\Tools\BMR\Formulas;

Avoid too many return statements within this method.
Open

                return false;
Severity: Major
Found in src/Escudero.php - About 30 mins to fix

    Line exceeds 120 characters; contains 122 characters
    Open

            self::FORMULA_HARRIS_BENEDICT_ORIGINAL => \FimediNET\Escudero\Tools\BMR\Formulas\BMROriginalHarrisBenedict::class,
    Severity: Minor
    Found in src/Tools/BMR/BMRCalc.php by phpcodesniffer

    Line exceeds 120 characters; contains 121 characters
    Open

            self::FORMULA_HARRIS_BENEDICT_R_MSJ => \FimediNET\Escudero\Tools\BMR\Formulas\BMRHarrisBenedictRevisedMSJ::class,
    Severity: Minor
    Found in src/Tools/BMR/BMRCalc.php by phpcodesniffer

    Whitespace found at end of line
    Open

         * 

    Whitespace found at end of line
    Open

         * 

    Whitespace found at end of line
    Open

         * 

    Whitespace found at end of line
    Open

         * 

    Expected 1 newline at end of file; 0 found
    Open

    }

    Whitespace found at end of line
    Open

         * 

    Whitespace found at end of line
    Open

         * 
    Severity
    Category
    Status
    Source
    Language