symphonycms/symphony-2

View on GitHub

Showing 844 of 844 total issues

Function processParametersInString has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function processParametersInString($value, array $env, $includeParenthesis = true, $escape = false)
    {
        if (trim($value) == '') {
            return null;
        }
Severity: Minor
Found in symphony/lib/toolkit/class.datasource.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 execute has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute(array &$param_pool = null)
    {
        $authorsQuery = (new AuthorManager)
            ->select()
            ->sort((string)$this->dsParamSORT, $this->dsParamORDER);
Severity: Major
Found in symphony/lib/toolkit/data-sources/class.datasource.author.php - About 4 hrs to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        public function parseContext(array &$context, array $parts)
        {
            // Order is important!
            $params = array_fill_keys(array('action', 'id', 'flag'), null);
    
    
    Severity: Major
    Found in symphony/content/content.systemauthors.php and 1 other location - About 4 hrs to fix
    symphony/content/content.blueprintspages.php on lines 25..37

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 174.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        public function parseContext(array &$context, array $parts)
        {
            // Order is important!
            $params = array_fill_keys(array('action', 'id', 'flag'), null);
    
    
    Severity: Major
    Found in symphony/content/content.blueprintspages.php and 1 other location - About 4 hrs to fix
    symphony/content/content.systemauthors.php on lines 25..37

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 174.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function processRawFieldData has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        public function processRawFieldData($data, &$status, &$message = null, $simulate = false, $entry_id = null)
        {
            $status = self::__OK__;
    
            // No file given, save empty data:
    Severity: Minor
    Found in symphony/lib/toolkit/fields/field.upload.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

    Function processParameters has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        public function processParameters(array $env = null)
        {
            if ($env) {
                $this->_env = $env;
            }
    Severity: Minor
    Found in symphony/lib/toolkit/class.datasource.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

    Function Filtering has 110 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Symphony.Interface.Filtering = function() {
            var filtering, duplicator, apply,
                actions = [];
    
            /**
    Severity: Major
    Found in symphony/assets/js/src/symphony.filtering.js - About 4 hrs to fix

      Method viewConfiguration has 110 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function viewConfiguration()
          {
              // Populating fields array
              $fields = isset($_POST['fields']) ? $_POST['fields'] : $this->params['default-config'];
      
      
      Severity: Major
      Found in install/lib/class.installerpage.php - About 4 hrs to fix

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

        <?php
        
        /**
         * @package toolkit
         */
        Severity: Minor
        Found in symphony/lib/toolkit/class.entryquery.php - About 4 hrs to fix

          DatabaseStatement has 34 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class DatabaseStatement
          {
              /**
               * List of element delimiter
               * @var string
          Severity: Minor
          Found in symphony/lib/toolkit/class.databasestatement.php - About 4 hrs to fix

            AdministrationPage has 34 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class AdministrationPage extends HTMLPage
            {
                /**
                 * An array of `Alert` objects used to display page level
                 * messages to Symphony backend users one by one. Prior to Symphony 2.3
            Severity: Minor
            Found in symphony/lib/toolkit/class.administrationpage.php - About 4 hrs to fix

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

              <?php
              
              /**
               * @package toolkit
               */
              Severity: Minor
              Found in symphony/lib/toolkit/class.entrymanager.php - About 4 hrs to fix

                Function processSendMailFilter has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function processSendMailFilter(XMLElement $result, array $send_email, array &$fields, Section $section, Entry $entry)
                    {
                        $fields['recipient']        = self::replaceFieldToken($send_email['recipient'], $fields);
                        $fields['recipient']        = preg_split('/\,/i', $fields['recipient'], -1, PREG_SPLIT_NO_EMPTY);
                        $fields['recipient']        = array_map('trim', $fields['recipient']);
                Severity: Minor
                Found in symphony/lib/toolkit/events/class.event.section.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

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

                <?php
                
                /**
                 * @package toolkit
                 */
                Severity: Minor
                Found in symphony/lib/toolkit/class.fieldmanager.php - About 4 hrs to fix

                  PageManager has 33 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class PageManager
                  {
                      /**
                       * Given an associative array of data, where the key is the column name
                       * in `tbl_pages` and the value is the data, this function will create a new
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.pagemanager.php - About 4 hrs to fix

                    Function resolvePage has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function resolvePage($page = null)
                        {
                            if ($page) {
                                $this->_page = $page;
                            }
                    Severity: Minor
                    Found in symphony/lib/toolkit/class.frontendpage.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

                    Function listStructure has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function listStructure($dir = ".", $filters = array(), $recurse = true, $sort = "asc", $strip_root = null, $exclude = array(), $ignore_hidden = true)
                        {
                            if (!is_dir($dir)) {
                                return null;
                            }
                    Severity: Minor
                    Found in symphony/lib/toolkit/class.general.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

                    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

                    Function __viewIndex has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function __viewIndex()
                        {
                            $this->setPageType('table');
                            $this->setTitle(__('%1$s &ndash; %2$s', array(__('Pages'), __('Symphony'))));
                    
                    
                    Severity: Minor
                    Found in symphony/content/content.blueprintspages.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 checkConfiguration has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function checkConfiguration()
                        {
                            $db = null;
                            $errors = [];
                            $fields = $this->extendDatabaseFields(self::$POST['fields']);
                    Severity: Major
                    Found in install/lib/class.installer.php - About 4 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language