symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

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

    public function __construct($message, $code = -1, Exception $ex = null)
    {
        switch ($code) {
            case JSON_ERROR_NONE:
                $message = __('No errors.');
Severity: Minor
Found in symphony/lib/toolkit/class.jsonexception.php - About 55 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 data has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function data($data)
    {
        if ($this->_rcpt == false) {
            throw new SMTPException(__('Must call RCPT before calling DATA'));
        }
Severity: Minor
Found in symphony/lib/toolkit/class.smtp.php - About 55 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 execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute(array &$param_pool = null)
    {
        $result = new XMLElement($this->dsParamROOTELEMENT);

        // Build the query
Severity: Minor
Found in symphony/lib/toolkit/data-sources/class.datasource.navigation.php - About 55 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 __getPageParams has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function __getPageParams()
    {
        $params = array();
        $pages = (new PageManager)->select(['params'])->includeTypes()->execute()->rows();

Severity: Minor
Found in symphony/content/content.ajaxparameters.php - About 55 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 view has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function view()
    {
        $params = array();
        $filter = $_GET['query'];

Severity: Minor
Found in symphony/content/content.ajaxparameters.php - About 55 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 __actionEdit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function __actionEdit()
    {
        if (is_array($_POST['action']) && array_key_exists('save', $_POST['action'])) {
            return $this->__formAction();
        } elseif (is_array($_POST['action']) && array_key_exists('delete', $_POST['action'])) {
Severity: Minor
Found in symphony/content/content.blueprintsdatasources.php - About 55 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 __injectVarList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function __injectVarList(&$shell, $vars)
    {
        if (!is_array($vars) || empty($vars)) {
            return;
        }
Severity: Minor
Found in symphony/content/content.blueprintsdatasources.php - About 55 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 listStructure has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function listStructure($dir = ".", $filters = array(), $recurse = true, $sort = "asc", $strip_root = null, $exclude = array(), $ignore_hidden = true)
Severity: Major
Found in symphony/lib/toolkit/class.general.php - About 50 mins to fix

    Method Drawer has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function Drawer($id = '', $label = '', XMLElement $content = null, $default_state = 'closed', $context = '', array $attributes = array())
    Severity: Minor
    Found in symphony/lib/toolkit/class.widget.php - About 45 mins to fix

      Method createSectionAssociation has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function createSectionAssociation($parent_section_id = null, $child_field_id = null, $parent_field_id = null, $show_association = true, $interface = null, $editor = null)
      Severity: Minor
      Found in symphony/lib/toolkit/class.sectionmanager.php - About 45 mins to fix

        Method Table has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function Table(XMLElement $header = null, XMLElement $footer = null, XMLElement $body = null, $class = null, $id = null, Array $attributes = null)
        Severity: Minor
        Found in symphony/lib/toolkit/class.widget.php - About 45 mins to fix

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

              public function fetchAllAssociatedEntryCounts($associated_sections = null)
              {
                  if (is_null($this->get('section_id'))) {
                      return null;
                  }
          Severity: Minor
          Found in symphony/lib/toolkit/class.entry.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 Anchor has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function Anchor($value, $href, $title = null, $class = null, $id = null, array $attributes = null)
          Severity: Minor
          Found in symphony/lib/toolkit/class.widget.php - About 45 mins to fix

            Method displayPublishPanel has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
            Severity: Minor
            Found in symphony/lib/toolkit/class.field.php - About 45 mins to fix

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

                  public static function create($type)
                  {
                      if (!isset(self::$_pool[$type])) {
                          $classname = self::__getClassName($type);
                          $path = self::__getDriverPath($type);
              Severity: Minor
              Found in symphony/lib/toolkit/class.fieldmanager.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 contentInfoArray has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function contentInfoArray($type = null, $file = null, $filename = null, $charset = null, $cid = false, $disposition = 'attachment')
              Severity: Minor
              Found in symphony/lib/toolkit/class.emailgateway.php - About 45 mins to fix

                Method fetch has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static function fetch($sortby = 'id', $sortdirection = 'ASC', $limit = null, $start = null, $where = null, $joins = null)
                Severity: Minor
                Found in symphony/lib/toolkit/class.authormanager.php - About 45 mins to fix

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

                      public static function uploadFile($dest_path, $dest_name, $tmp_name, $perm = 0644)
                      {
                          // Upload the file
                          if (@is_uploaded_file($tmp_name)) {
                              $dest_path = rtrim($dest_path, '/') . '/';
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.general.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 execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function execute(DatabaseStatement $stm)
                      {
                          $this->autoConnect();
                  
                          if ($this->isLoggingEnabled()) {
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.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 listDirStructure has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static function listDirStructure($dir = '.', $filter = null, $recurse = true, $strip_root = null, $exclude = array(), $ignore_hidden = true)
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.general.php - About 45 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language