symphonycms/symphony-2

View on GitHub
symphony/lib/core/class.administration.php

Summary

Maintainability
D
2 days
Test Coverage

Function __buildPage has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    private function __buildPage($page)
    {
        $is_logged_in = static::isLoggedIn();

        if (empty($page) || is_null($page)) {
Severity: Minor
Found in symphony/lib/core/class.administration.php - About 1 day 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 getPageCallback has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPageCallback($page = null)
    {
        if (!$page && $this->_callback) {
            return $this->_callback;
        } elseif (!$page && !$this->_callback) {
Severity: Minor
Found in symphony/lib/core/class.administration.php - About 4 hrs 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 getPageCallback has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getPageCallback($page = null)
    {
        if (!$page && $this->_callback) {
            return $this->_callback;
        } elseif (!$page && !$this->_callback) {
Severity: Major
Found in symphony/lib/core/class.administration.php - About 3 hrs to fix

    Method __buildPage has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function __buildPage($page)
        {
            $is_logged_in = static::isLoggedIn();
    
            if (empty($page) || is_null($page)) {
    Severity: Major
    Found in symphony/lib/core/class.administration.php - About 2 hrs to fix

      File class.administration.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * @package core
       */
      Severity: Minor
      Found in symphony/lib/core/class.administration.php - About 2 hrs to fix

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

            public function checkExtensionsForUpdates()
            {
                $extensions = Symphony::ExtensionManager()->listInstalledHandles();
        
                if (is_array($extensions) && !empty($extensions)) {
        Severity: Minor
        Found in symphony/lib/core/class.administration.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

        Avoid too many return statements within this method.
        Open

                    return false;
        Severity: Major
        Found in symphony/lib/core/class.administration.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $callback;
          Severity: Major
          Found in symphony/lib/core/class.administration.php - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status