MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Method yylex3 has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function yylex3()
    {
        $tokenMap = array (
              1 => 0,
              2 => 0,
Severity: Major
Found in include/smarty/libs/sysplugins/smarty_internal_templatelexer.php - About 2 hrs to fix

    Method write has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method appendFootnotes has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function appendFootnotes($text) {
          #
          # Append footnote list to text.
          #
              $text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', 
      Severity: Major
      Found in include/lib/Michelf/Markdown.php - About 2 hrs to fix

        Method decodeProperties has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function decodeProperties($properties, $cache = false)
            {
                $this->has_nocache_code = $properties['has_nocache_code'];
                $this->properties['nocache_hash'] = $properties['nocache_hash'];
                if (isset($properties['cache_lifetime'])) {
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_internal_template.php - About 2 hrs to fix

          Method isTrustedResourceDir has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function isTrustedResourceDir($filepath)
              {
                  $_template = false;
                  $_config = false;
                  $_secure = false;
          Severity: Minor
          Found in include/smarty/libs/sysplugins/smarty_security.php - About 2 hrs to fix

            Method doTables has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function doTables($text) {
                #
                # Form HTML tables.
                #
                    $less_than_tab = $this->tab_width - 1;
            Severity: Minor
            Found in include/lib/Michelf/Markdown.php - About 2 hrs to fix

              Method smarty_function_math has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function smarty_function_math($params, $template)
              {
                  static $_allowed_funcs = array(
                      'int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true,
                      'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true,
              Severity: Minor
              Found in include/smarty/libs/plugins/function.math.php - About 1 hr to fix

                Method mobileGrade has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function mobileGrade()
                    {
                        $isMobile = $this->isMobile();
                
                        if (
                Severity: Minor
                Found in include/lib/Mobile_Detect.php - About 1 hr to fix

                  Method __construct has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function __construct($search, $replace)
                      {
                          $this->_search = $search;
                          $this->_index = array();
                          $this->_tree = array();

                    Method yylex5 has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function yylex5()
                        {
                            $tokenMap = array (
                                  1 => 0,
                                  2 => 0,
                    Severity: Minor
                    Found in include/smarty/libs/sysplugins/smarty_internal_templatelexer.php - About 1 hr to fix

                      Method yylex6 has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function yylex6()
                          {
                              $tokenMap = array (
                                    1 => 0,
                                    2 => 0,
                      Severity: Minor
                      Found in include/smarty/libs/sysplugins/smarty_internal_templatelexer.php - About 1 hr to fix

                        Method _doTable_callback has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function _doTable_callback($matches) {
                                $head        = $matches[1];
                                $underline    = $matches[2];
                                $content    = $matches[3];
                        
                        
                        Severity: Minor
                        Found in include/lib/Michelf/Markdown.php - About 1 hr to fix

                          Function smarty_function_html_options_optoutput has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
                          {
                              if (!is_array($value)) {
                                  $_key = smarty_function_escape_special_chars($key);
                                  $_html_result = '<option value="' . $_key . '"';
                          Severity: Minor
                          Found in include/smarty/libs/plugins/function.html_options.php - About 1 hr 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 compile has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function compile($args, $compiler, $parameter)
                              {
                                  $_attr = $this->getAttributes($compiler, $args);
                                  $saved_data = $this->closeTag($compiler, array('function'));
                                  $_name = trim($saved_data[0]['name'], "'\"");
                          Severity: Minor
                          Found in include/smarty/libs/sysplugins/smarty_internal_compile_function.php - About 1 hr 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 _getTemplatesTreeRecursive has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                            private function _getTemplatesTreeRecursive($path) {
                              if( !is_dir($path) ) {
                                return preg_match("/\.tpl$/", $path);
                              } else {
                                $subfiles = scandir($path);
                          Severity: Minor
                          Found in include/classes/template.class.php - About 1 hr 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 getCurrentIP has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                            public function getCurrentIP($trustremote=false, $checkcloudflare=true, $checkclient=false, $checkforwarded=true) {
                              $cf = (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : false;
                              $client = (isset($_SERVER['HTTP_CLIENT_IP'])) ? $_SERVER['HTTP_CLIENT_IP'] : false;
                              $fwd = (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : false;
                              $remote = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : @$_SERVER['REMOTE_ADDR'];
                          Severity: Minor
                          Found in include/classes/user.class.php - About 1 hr 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 invalidate has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function invalidate($cid = null, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null)
                              {
                                  $now = microtime(true);
                                  $key = null;
                                  // invalidate everything

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

                            public function updateWorkers($account_id, $data) {
                              $this->debug->append("STA " . __METHOD__, 4);
                              if (!is_array($data)) {
                                $this->setErrorMessage('No workers to update');
                                return false;
                          Severity: Minor
                          Found in include/classes/worker.class.php - About 1 hr 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 setHeaders has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function setHeaders(Swift_Mime_HeaderSet $headers)
                              {
                                  $this->_headerCanonData = '';
                                  // Loop through Headers
                                  $listHeaders = $headers->listAll();
                          Severity: Minor
                          Found in include/lib/swiftmailer/classes/Swift/Signers/DKIMSigner.php - About 1 hr 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 setHeaders has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function setHeaders(Swift_Mime_HeaderSet $headers)
                              {
                                  $this->_startHash();
                                  $this->_canonData = '';
                                  // Loop through Headers
                          Severity: Minor
                          Found in include/lib/swiftmailer/classes/Swift/Signers/DomainKeySigner.php - About 1 hr 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

                          Severity
                          Category
                          Status
                          Source
                          Language