MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Method salsa208Core32 has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected static function salsa208Core32($b)
    {
        $b32 = array();
        for ($i = 0; $i < 16; $i++) {
           list(, $b32[$i]) = unpack("V", substr($b, $i * 4, 4));
Severity: Major
Found in include/lib/scrypt.php - About 3 hrs to fix

    Method salsa208Core64 has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected static function salsa208Core64($b)
        {
            $b32 = array();
            for ($i = 0; $i < 16; $i++) {
                list(, $b32[$i]) = unpack("V", substr($b, $i * 4, 4));
    Severity: Major
    Found in include/lib/scrypt.php - About 3 hrs to fix

      File SimpleMessage.php has 297 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /*
       * This file is part of SwiftMailer.
       * (c) 2004-2009 Chris Corbyn
      Severity: Minor
      Found in include/lib/swiftmailer/classes/Swift/Mime/SimpleMessage.php - About 3 hrs to fix

        Function smarty_function_html_checkboxes_output has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

        function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape=true)
        {
            $_output = '';
        
            if (is_object($value)) {
        Severity: Minor
        Found in include/smarty/libs/plugins/function.html_checkboxes.php - About 3 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 getPlugin has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getPlugin($plugin_name, $plugin_type)
            {
                $function = null;
                if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
                    if (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) {

        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 load has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function load(Smarty $smarty, $type)
            {
                // try smarty's cache
                if (isset($smarty->_resource_handlers[$type])) {
                    return $smarty->_resource_handlers[$type];
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_resource.php - About 3 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 getNotificationSettings has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

          public function getNotificationSettings($account_id) {
            // Some defaults, we cover them here so we can avoid adding default settings on user creation
            $aDefaults = array( 'newsletter' => 1 );
            $this->debug->append("STA " . __METHOD__, 4);
            $stmt = $this->mysqli->prepare("SELECT * FROM $this->tableSettings WHERE account_id = ?");
        Severity: Minor
        Found in include/classes/notification.class.php - About 3 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 _canonicalizeBody has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _canonicalizeBody($string)
            {
                $len = strlen($string);
                $canon = '';
                $nofws = ($this->_canon == "nofws");
        Severity: Minor
        Found in include/lib/swiftmailer/classes/Swift/Signers/DomainKeySigner.php - About 3 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 jquery.metisMenu.js has 293 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * metismenu - v2.5.2
         * A jQuery menu plugin
         * https://github.com/onokumus/metisMenu#readme
         *
        Severity: Minor
        Found in public/site_assets/bootstrap/js/plugins/metisMenu/jquery.metisMenu.js - About 3 hrs to fix

          Method getTopContributors has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public function getTopContributors($type='shares', $limit=15) {
              $this->debug->append("STA " . __METHOD__, 4);
              switch ($type) {
              case 'shares':
                if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__ . $type . $limit)) return $data;
          Severity: Major
          Found in include/classes/statistics.class.php - About 3 hrs to fix

            Swift_Mime_SimpleHeaderSet has 26 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Swift_Mime_SimpleHeaderSet implements Swift_Mime_HeaderSet
            {
                /** HeaderFactory */
                private $_factory;
            
            
            Severity: Minor
            Found in include/lib/swiftmailer/classes/Swift/Mime/SimpleHeaderSet.php - About 3 hrs to fix

              Swift_Mime_Headers_AbstractHeader has 26 functions (exceeds 20 allowed). Consider refactoring.
              Open

              abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header
              {
                  /**
                   * The name of this Header.
                   *
              Severity: Minor
              Found in include/lib/swiftmailer/classes/Swift/Mime/Headers/AbstractHeader.php - About 3 hrs to fix

                Method clearCompiledTemplate has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty)
                    {
                        $_compile_dir = $smarty->getCompileDir();
                        $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
                        $_dir_sep = $smarty->use_sub_dirs ? DS : '^';
                Severity: Major
                Found in include/smarty/libs/sysplugins/smarty_internal_utility.php - About 2 hrs to fix

                  Method compileChildBlock has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      static function compileChildBlock($compiler, $_name = null)
                      {
                          if ($compiler->inheritance_child) {
                              $name1 = Smarty_Internal_Compile_Block::$nested_block_names[0];
                              if (isset($compiler->template->block_data[$name1])) {
                  Severity: Major
                  Found in include/smarty/libs/sysplugins/smarty_internal_compile_block.php - About 2 hrs to fix

                    Method compile has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function compile($args, $compiler)
                        {
                            // check and get attributes
                            $_attr = $this->getAttributes($compiler, $args);
                            // never compile as nocache code
                    Severity: Major
                    Found in include/smarty/libs/sysplugins/smarty_internal_compile_insert.php - About 2 hrs to fix

                      Method checkLogin has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        public function checkLogin($username, $password) {
                          $this->debug->append("STA " . __METHOD__, 4);
                          $this->debug->append("Checking login for $username with password $password", 2);
                          if (empty($username) || empty($password)) {
                            $this->setErrorMessage("Invalid username or password.");
                      Severity: Major
                      Found in include/classes/user.class.php - About 2 hrs to fix

                        Function getPluginFromDefaultHandler has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function getPluginFromDefaultHandler($tag, $plugin_type)
                            {
                                $callback = null;
                                $script = null;
                                $cacheable = true;

                        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 write has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function write($chars)
                            {
                                if (!isset($this->_charReader)) {
                                    $this->_charReader = $this->_charReaderFactory->getReaderFor(
                                        $this->_charset);

                        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 _restoreMessage has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function _restoreMessage(Swift_Mime_Message $message)
                            {
                                if ($this->_lastMessage === $message) {
                                    if (isset($this->_originalBody)) {
                                        $message->setBody($this->_originalBody);
                        Severity: Minor
                        Found in include/lib/swiftmailer/classes/Swift/Plugins/DecoratorPlugin.php - About 2 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 encodeByteStream has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0)
                            {
                                if ($maxLineLength > 76 || $maxLineLength <= 0) {
                                    $maxLineLength = 76;
                                }

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language