mambax7/songlist

View on GitHub

Showing 264 of 3,642 total issues

Function loadFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadFields($force_update = false)
    {
        static $fields = [];
        if (!empty($force_update) || 0 == \count($fields)) {
            $criteria = new \Criteria('field_id', 0, '!=');
Severity: Minor
Found in class/FieldHandler.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

Function checkMaxWidth has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkMaxWidth(): bool
    {
        if (!isset($this->maxWidth) || $this->maxWidth < 1) {
            return true;
        }
Severity: Minor
Found in class/Uploader.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

Function checkMaxHeight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkMaxHeight(): bool
    {
        if (!isset($this->maxHeight) || $this->maxHeight < 1) {
            return true;
        }
Severity: Minor
Found in class/Uploader.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

Function createLogo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function createLogo($dirname): bool
    {
        if (!\extension_loaded('gd')) {
            return false;
        }
Severity: Minor
Found in class/Common/Cloner.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

Severity
Category
Status
Source
Language