MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Function mobileGrade has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
Open

    public function mobileGrade()
    {
        $isMobile = $this->isMobile();

        if (
Severity: Minor
Found in include/lib/Mobile_Detect.php - About 7 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 _hashHTMLBlocks_inMarkdown has 194 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
                                        $enclosing_tag_re = '', $span = false)
    {
    #
    # Parse markdown text, calling _HashHTMLBlocks_InHTML for block tags.
Severity: Major
Found in include/lib/Michelf/Markdown.php - About 7 hrs to fix

    Function __construct has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct(Smarty_Internal_Template $_template)
        {
            $this->compile_id = $_template->compile_id;
            $this->cache_id = $_template->cache_id;
            $this->source = $_template->source;
    Severity: Minor
    Found in include/smarty/libs/sysplugins/smarty_cacheresource.php - About 7 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 compile has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

        public function compile($args, $compiler)
        {
            $compiler->has_code = true;
            // check and get attributes
            $_attr = $this->getAttributes($compiler, $args);
    Severity: Minor
    Found in include/smarty/libs/sysplugins/smarty_internal_compile_block.php - About 7 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 updateAccount has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

      public function updateAccount($userID, $address, $threshold, $donate, $email, $timezone, $is_anonymous, $strToken) {
        $this->debug->append("STA " . __METHOD__, 4);
        $bUser = false;
        $donate = round($donate, 2);
        // number validation checks
    Severity: Minor
    Found in include/classes/user.class.php - About 7 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

    Markdown has 53 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Markdown {
    
        ### Version ###
    
        const  MARKDOWNLIB_VERSION  =  "1.3";
    Severity: Major
    Found in include/lib/Michelf/Markdown.php - About 7 hrs to fix

      Method compileTag has 185 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function compileTag($tag, $args, $parameter = array())
          {
              // $args contains the attributes parsed and compiled by the lexer/parser
              // assume that tag does compile into code, but creates no HTML output
              $this->has_code = true;

        File smarty_internal_templatecompilerbase.php has 473 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * Smarty Internal Plugin Smarty Template Compiler Base
         *

          File SimpleMimeEntity.php has 472 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/SimpleMimeEntity.php - About 7 hrs to fix

            Function doParse has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
            Open

                public function doParse($yymajor, $yytokenvalue)
                {
                    $yyerrorhit = 0;   /* True if yymajor has invoked an error */
            
                    if ($this->yyidx === null || $this->yyidx < 0) {
            Severity: Minor
            Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 7 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 doParse has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
            Open

                public function doParse($yymajor, $yytokenvalue)
                {
                    $yyerrorhit = 0;   /* True if yymajor has invoked an error */
            
                    if ($this->yyidx === null || $this->yyidx < 0) {
            Severity: Minor
            Found in include/smarty/libs/sysplugins/smarty_internal_templateparser.php - About 7 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

            Swift_Mime_SimpleMimeEntity has 51 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
            {
                /** A collection of Headers for this mime entity */
                private $_headers;
            
            
            Severity: Major
            Found in include/lib/swiftmailer/classes/Swift/Mime/SimpleMimeEntity.php - About 7 hrs to fix

              Function getAttributes has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getAttributes($compiler, $attributes)
                  {
                      $_indexed_attr = array();
                      // loop over attributes
                      foreach ($attributes as $key => $mixed) {
              Severity: Minor
              Found in include/smarty/libs/sysplugins/smarty_internal_compilebase.php - About 7 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 clearCompiledTemplate has a Cognitive Complexity of 45 (exceeds 5 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: Minor
              Found in include/smarty/libs/sysplugins/smarty_internal_utility.php - About 6 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 smarty_function_fetch has 171 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function smarty_function_fetch($params, $template)
              {
                  if (empty($params['file'])) {
                      trigger_error("[plugin] fetch parameter 'file' cannot be empty",E_USER_NOTICE);
              
              
              Severity: Major
              Found in include/smarty/libs/plugins/function.fetch.php - About 6 hrs to fix

                Function smarty_function_html_image has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                function smarty_function_html_image($params, $template)
                {
                    require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
                
                    $alt = '';
                Severity: Minor
                Found in include/smarty/libs/plugins/function.html_image.php - About 6 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 generateUpToDateMimeArray has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                Open

                function generateUpToDateMimeArray()
                {
                    $preamble = "<?php\n\n";
                    $preamble .= "/*\n";
                    $preamble .= " * This file is part of SwiftMailer.\n";
                Severity: Minor
                Found in include/lib/swiftmailer/swiftmailer_generate_mimes_config.php - About 6 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 smarty_function_html_radios has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                Open

                function smarty_function_html_radios($params, $template)
                {
                    require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
                
                    $name = 'radio';
                Severity: Minor
                Found in include/smarty/libs/plugins/function.html_radios.php - About 6 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 smarty_modifier_escape has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                Open

                function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true)
                {
                    static $_double_encode = null;
                    if ($_double_encode === null) {
                        $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');
                Severity: Minor
                Found in include/smarty/libs/plugins/modifier.escape.php - About 6 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 compile has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function compile($args, $compiler)
                    {
                        // check and get attributes
                        $_attr = $this->getAttributes($compiler, $args);
                        // never compile as nocache code
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_compile_insert.php - About 6 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

                Severity
                Category
                Status
                Source
                Language