MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

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

    public function __call($method, $args)
    {
        foreach ($this->_handlers as $handler) {
            if (in_array(strtolower($method),
                array_map('strtolower', (array) $handler->exposeMixinMethods())
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/Transport/EsmtpTransport.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 encodeWords has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function encodeWords(Swift_Mime_Header $header, $input, $usedLength = -1)
    {
        $value = '';

        $tokens = $this->getEncodableWordTokens($input);
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/Mime/Headers/AbstractHeader.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 createPhrase has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function createPhrase(Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder = null, $shorten = false)
    {
        // Treat token as exactly what was given
        $phraseStr = $string;
        // If it's not valid
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/Mime/Headers/AbstractHeader.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 exportToByteStream has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is)
    {
        if ($this->hasKey($nsKey, $itemKey)) {
            $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START);
            if ($this->_quotes) {
Severity: Minor
Found in include/lib/swiftmailer/classes/Swift/KeyCache/DiskKeyCache.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

Consider simplifying this complex logical expression.
Open

        if ((!$this->caching || $_template->has_nocache_code || $_template->source->recompiled) && !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
            $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_output, $_template);
        }
Severity: Major
Found in include/smarty/libs/sysplugins/smarty_internal_templatebase.php - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing &&
                    ($this->nocache || $this->tag_nocache)
                ) {
                    $this->template->has_nocache_code = true;
                    $_output = addcslashes($content, '\'\\');
    Severity: Major
    Found in include/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if ($this->mustCompile === null) {
                  $this->mustCompile = (!$this->source->uncompiled && ($this->smarty->force_compile || $this->source->recompiled || $this->compiled->timestamp === false ||
                          ($this->smarty->compile_check && $this->compiled->timestamp < $this->source->timestamp)));
              }
      Severity: Major
      Found in include/smarty/libs/sysplugins/smarty_internal_template.php - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

            if ( @$_SESSION['AUTHENTICATED'] == true &&
                 !$this->isLocked($_SESSION['USERDATA']['id']) &&
                 $this->getUserIp($_SESSION['USERDATA']['id']) == $_SERVER['REMOTE_ADDR'] &&
                 ( ! $this->config['protect_session_state'] ||
                   (
        Severity: Major
        Found in include/classes/user.class.php - About 40 mins to fix

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

          function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false)
          Severity: Minor
          Found in include/smarty/libs/plugins/modifier.truncate.php - About 35 mins to fix

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

                public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
            Severity: Minor
            Found in include/smarty/libs/SmartyBC.class.php - About 35 mins to fix

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

                  public static function compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
              Severity: Minor
              Found in include/smarty/libs/sysplugins/smarty_internal_utility.php - About 35 mins to fix

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

                        public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_cacheresource_file.php - About 35 mins to fix

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

                      public static function compileAllConfig($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
                  Severity: Minor
                  Found in include/smarty/libs/sysplugins/smarty_internal_utility.php - About 35 mins to fix

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

                        public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)
                    Severity: Minor
                    Found in include/smarty/libs/Smarty.class.php - About 35 mins to fix

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

                          public function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
                      Severity: Minor
                      Found in include/smarty/libs/sysplugins/smarty_internal_templatebase.php - About 35 mins to fix

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

                            abstract public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time);
                        Severity: Minor
                        Found in include/smarty/libs/sysplugins/smarty_cacheresource.php - About 35 mins to fix

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

                              public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null)
                          Severity: Minor
                          Found in include/smarty/libs/sysplugins/smarty_internal_templatebase.php - About 35 mins to fix

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

                                public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
                            Severity: Minor
                            Found in include/smarty/libs/sysplugins/smarty_cacheresource_custom.php - About 35 mins to fix

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

                                  public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)
                              Severity: Minor
                              Found in include/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php - About 35 mins to fix

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

                                    public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
                                Severity: Minor
                                Found in include/smarty/libs/Smarty.class.php - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language