modxcms/revolution

View on GitHub

Showing 7,873 of 7,873 total issues

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

function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
Severity: Minor
Found in core/model/smarty/plugins/function.html_options.php - About 45 mins to fix

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

        public function create_object($bucket, $filename, $opt = null)
        {
            if (!$opt) $opt = array();
    
            // Add this to our request
    Severity: Minor
    Found in core/model/aws/services/s3.class.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 authenticate has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function authenticate($method = 'GET', $path = null, $opt = null, $xml = null, $etag = null, $redirects = 0)
    Severity: Minor
    Found in core/model/aws/services/cloudfront.class.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ($result === false) {
                                  $this->log(modX::LOG_LEVEL_ERROR, 'Could not set error handler.  Make sure your class has a function called handleError(). Result: ' . print_r($result, true));
                              }
      Severity: Major
      Found in core/model/modx/modx.class.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                        while ($patternMatches > 0 && $patternIterator <= $nesting) {
                                            $value= preg_replace($pattern, '', $value);
                                            $patternMatches = preg_match($pattern, $value);
                                        }
        Severity: Major
        Found in core/model/modx/modx.class.php - About 45 mins to fix

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

          function smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx)
          Severity: Minor
          Found in core/model/smarty/plugins/function.html_options.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ($property !== false) {
                                            if (property_exists($data, $property)) {
                                                $propertyType = $this->resolvedProperties[ $match[ 0 ] ][ $objType ] = 1;
                                            } elseif (property_exists($smarty, $property)) {
                                                $propertyType = $this->resolvedProperties[ $match[ 0 ] ][ $objType ] = 2;
            Severity: Major
            Found in core/model/smarty/sysplugins/smarty_internal_extension_handler.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if ($mod_array[ 0 ][ $i ] !== ':') {
                                                  $modifierlist[ $key ][] = $mod_array[ 0 ][ $i ];
                                              }

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

                    public function convertScope($_attr, $validScopes)
                    {
                        $_scope = 0;
                        if (isset($_attr[ 'scope' ])) {
                            $_scopeName = trim($_attr[ 'scope' ], '\'"');
                Severity: Minor
                Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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 deeply nested control flow statements.
                Open

                                        if ($propertyType) {
                                            $obj = $propertyType === 1 ? $data : $smarty;
                                            if ($match[ 2 ] === 'get') {
                                                return $obj->$property;
                                            } elseif ($match[ 2 ] === 'set') {
                Severity: Major
                Found in core/model/smarty/sysplugins/smarty_internal_extension_handler.php - About 45 mins to fix

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

                      public function getTags(Smarty_Internal_TemplateBase $obj, $template = null)
                      {
                          /* @var Smarty $smarty */
                          $smarty = $obj->_getSmartyObj();
                          if ($obj->_isTplObj() && !isset($template)) {
                  Severity: Minor
                  Found in core/model/smarty/sysplugins/smarty_internal_method_gettags.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 save has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      abstract protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content);
                  Severity: Minor
                  Found in core/model/smarty/sysplugins/smarty_cacheresource_custom.php - About 45 mins to fix

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

                        public function mustCompile(Smarty_Internal_Template $_template)
                        {
                            if (!$_template->source->exists) {
                                if ($_template->_isSubTpl()) {
                                    $parent_resource = " in '$_template->parent->template_resource}'";
                    Severity: Minor
                    Found in core/model/smarty/sysplugins/smarty_internal_method_mustcompile.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 clearCache has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            Smarty $smarty,
                            $template_name,
                            $cache_id = null,
                            $compile_id = null,
                            $exp_time = null,
                    Severity: Minor
                    Found in core/model/smarty/sysplugins/smarty_internal_method_clearcache.php - About 45 mins to fix

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

                          abstract protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime);
                      Severity: Minor
                      Found in core/model/smarty/sysplugins/smarty_cacheresource_custom.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ($content) {
                                                    // check if we must update file dependency
                                                    if (!preg_match("/'{$funcParam['uid']}'(.*?)'nocache_hash'/", $content, $match2)) {
                                                        $content = preg_replace("/('file_dependency'(.*?)\()/", "\\1{$match1[0]}", $content);
                                                    }
                        Severity: Major
                        Found in core/model/smarty/sysplugins/smarty_internal_runtime_tplfunction.php - About 45 mins to fix

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

                                  Smarty_Internal_TemplateBase $obj,
                                  $type,
                                  $name,
                                  $callback,
                                  $cacheable = true,
                          Severity: Minor
                          Found in core/model/smarty/sysplugins/smarty_internal_method_registerplugin.php - About 45 mins to fix

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

                                public function _assignInScope($varName, $value, $nocache = false, $scope = 0)
                                {
                                    if (isset($this->tpl_vars[ $varName ])) {
                                        $this->tpl_vars[ $varName ] = clone $this->tpl_vars[ $varName ];
                                        $this->tpl_vars[ $varName ]->value = $value;
                            Severity: Minor
                            Found in core/model/smarty/sysplugins/smarty_internal_template.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 populateCompiledFilepath has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function populateCompiledFilepath(Smarty_Internal_Template $_template)
                                {
                                    $source = &$_template->source;
                                    $smarty = &$_template->smarty;
                                    $this->filepath = $smarty->getCompileDir();
                            Severity: Minor
                            Found in core/model/smarty/sysplugins/smarty_template_compiled.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 registerObject has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    Smarty_Internal_TemplateBase $obj,
                                    $object_name,
                                    $object,
                                    $allowed_methods_properties = array(),
                                    $format = true,
                            Severity: Minor
                            Found in core/model/smarty/sysplugins/smarty_internal_method_registerobject.php - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language