whitecube/nova-page

View on GitHub

Showing 4 of 5 total issues

Template has 32 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class Template implements ArrayAccess
{
    use HasAttributes;
    use Concerns\HasJsonAttributes;

Severity: Minor
Found in src/Pages/Template.php - About 4 hrs to fix

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

        protected function getParsedAttributes(Template $template, $attributes)
        {
            foreach ($attributes as $key => $value) {
                if(!is_array($value) && !is_object($value)) continue;
                if($template->isJsonAttribute($key)) continue;
    Severity: Minor
    Found in src/Sources/Database.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

    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function __construct($key, $class, $path, $code = 0, Exception $previous = null) {
    Severity: Minor
    Found in src/Exceptions/ValueNotFoundException.php - About 35 mins to fix

      Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function __construct($source, $type, $name, $code = 0, Exception $previous = null) {
      Severity: Minor
      Found in src/Exceptions/TemplateContentNotFoundException.php - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language