Showing 20 of 20 total issues
Function getRangeFromCategory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getRangeFromCategory($bmiLevel)
{
$this->jsonData || $this->initTable();
// Scan the table
- Read upRead up
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
Open
public function calculate()
{
$this->jsonData || $this->initTable();
$frameSizeRatio = $this->height / $this->wrc;
- Read upRead up
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
Open
if ($this->app->runningInConsole()) {
- Exclude checks
Blank line found at start of control structure Open
Open
if (floatval($minValue) <= $frameSizeRatio && floatval($maxValue) >= $frameSizeRatio) {
- Exclude checks
Blank line found at start of control structure Open
Open
if (intval($minAge) <= $this->age && intval($maxAge) >= $this->age) {
- Exclude checks
There must be one blank line after the namespace declaration Open
Open
namespace FimediNET\Escudero\Tools\BMR\Formulas;
- Exclude checks
Blank line found at start of control structure Open
Open
if ($row->category == $bmiLevel && $row->gender == $this->gender) {
- Exclude checks
Blank line found at start of control structure Open
Open
foreach ($this->jsonData as $row) {
- Exclude checks
Blank line found at start of control structure Open
Open
foreach ($this->jsonData as $row) {
- Exclude checks
There must be one blank line after the namespace declaration Open
Open
namespace FimediNET\Escudero\Tools\BMR\Formulas;
- Exclude checks
Avoid too many return
statements within this method. Open
Open
return false;
Line exceeds 120 characters; contains 122 characters Open
Open
self::FORMULA_HARRIS_BENEDICT_ORIGINAL => \FimediNET\Escudero\Tools\BMR\Formulas\BMROriginalHarrisBenedict::class,
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
Open
self::FORMULA_HARRIS_BENEDICT_R_MSJ => \FimediNET\Escudero\Tools\BMR\Formulas\BMRHarrisBenedictRevisedMSJ::class,
- Exclude checks
Whitespace found at end of line Open
Open
*
- Exclude checks
Whitespace found at end of line Open
Open
*
- Exclude checks
Whitespace found at end of line Open
Open
*
- Exclude checks
Whitespace found at end of line Open
Open
*
- Exclude checks
Expected 1 newline at end of file; 0 found Open
Open
}
- Exclude checks
Whitespace found at end of line Open
Open
*
- Exclude checks
Whitespace found at end of line Open
Open
*
- Exclude checks