hnhdigital-os/php-linode-api

View on GitHub

Showing 3 of 224 total issues

Instance has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

class Instance extends Base
{
    /**
     * Endpoint.
     *
Severity: Minor
Found in src/endpoints/Linode/Instance.php - About 2 hrs to fix

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

        public function __construct(...$args)
        {
            // Model is set be fillable, last item is our fill data or
            // indicator to run the fill method.
            if ($this->fillable) {
    Severity: Minor
    Found in src/foundation/Base.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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function get()
        {
            // Return cached results for this page.
            if (isset($this->page_results[$this->current_page])) {
                $this->current_result = $this->page_results[$this->current_page];
    Severity: Minor
    Found in src/foundation/ApiSearch.php - About 35 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