MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Function smarty_function_html_table has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

function smarty_function_html_table($params, $template)
{
    $table_attr = 'border="1"';
    $tr_attr = '';
    $th_attr = '';
Severity: Minor
Found in include/smarty/libs/plugins/function.html_table.php - About 4 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 _hashHTMLBlocks_inHTML has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
    #
    # Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags.
    #
    # *   Calls $hash_method to convert any blocks.
Severity: Minor
Found in include/lib/Michelf/Markdown.php - About 4 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 has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function hashHTMLBlocks($text) {
        if ($this->no_markup)  return $text;

        $less_than_tab = $this->tab_width - 1;

Severity: Major
Found in include/lib/Michelf/Markdown.php - About 4 hrs to fix

    Function compile has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        public function compile($args, $compiler, $parameter, $tag)
        {
            if (!isset($tag[5]) || substr($tag,-5) != 'close') {
                // opening tag of block plugin
                // check and get attributes

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

        public function beforeSendPerformed(Swift_Events_SendEvent $evt)
        {
            $message = $evt->getMessage();
            $this->_restoreMessage($message);
            $to = array_keys($message->getTo());
    Severity: Minor
    Found in include/lib/swiftmailer/classes/Swift/Plugins/DecoratorPlugin.php - About 4 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 register has 118 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public function register($username, $coinaddress, $password1, $password2, $pin, $email1='', $email2='', $tac='', $strToken='') {
        $this->debug->append("STA " . __METHOD__, 4);
        if ($tac != 1) {
          $this->setErrorMessage('You need to accept our <a href="'.$_SERVER['SCRIPT_NAME'].'?page=tac" target="_blank">Terms and Conditions</a>');
          return false;
    Severity: Major
    Found in include/classes/user.class.php - About 4 hrs to fix

      Method doItalicsAndBold has 115 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function doItalicsAndBold($text) {
              $token_stack = array('');
              $text_stack = array('');
              $em = '';
              $strong = '';
      Severity: Major
      Found in include/lib/Michelf/Markdown.php - About 4 hrs to fix

        Function compileTemplate has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            public function compileTemplate(Smarty_Internal_Template $template, $nocache = false)
            {
                if (empty($template->properties['nocache_hash'])) {
                    $template->properties['nocache_hash'] = $this->nocache_hash;
                } else {

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

            public function loadConfigVars($sections = null, $scope = 'local')
            {
                if ($this->data instanceof Smarty_Internal_Template) {
                    $this->data->properties['file_dependency'][sha1($this->source->filepath)] = array($this->source->filepath, $this->source->timestamp, 'file');
                }
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_internal_config.php - About 4 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

        SmartyBC has 35 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class SmartyBC extends Smarty
        {
            /**
             * Smarty 2 BC
             * @var string
        Severity: Minor
        Found in include/smarty/libs/SmartyBC.class.php - About 4 hrs to fix

          Function smarty_mb_wordwrap has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

              function smarty_mb_wordwrap($str, $width=75, $break="\n", $cut=false)
              {
                  // break words into tokens using white space as a delimiter
                  $tokens = preg_split('!(\s)!S' . Smarty::$_UTF8_MODIFIER, $str, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);
                  $length = 0;
          Severity: Minor
          Found in include/smarty/libs/plugins/shared.mb_wordwrap.php - About 4 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 getTemplateVars has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getTemplateVars($varname = null, $_ptr = null, $search_parents = true)
              {
                  if (isset($varname)) {
                      $_var = $this->getVariable($varname, $_ptr, $search_parents, false);
                      if (is_object($_var)) {
          Severity: Minor
          Found in include/smarty/libs/sysplugins/smarty_internal_data.php - About 4 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 yylex2 has 110 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            File DKIMSigner.php has 347 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/Signers/DKIMSigner.php - About 4 hrs to fix

              Function compileChildBlock has a Cognitive Complexity of 29 (exceeds 5 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: Minor
              Found in include/smarty/libs/sysplugins/smarty_internal_compile_block.php - About 4 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 compile has 106 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function compile($args, $compiler, $parameter)
                  {
                      $tpl = $compiler->template;
                      // check and get attributes
                      $_attr = $this->getAttributes($compiler, $args);
              Severity: Major
              Found in include/smarty/libs/sysplugins/smarty_internal_compile_foreach.php - About 4 hrs to fix

                Statistics has 33 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Statistics extends Base {
                  protected $table = 'statistics_shares';
                  protected $table_user_stats = 'statistics_users';
                  private $getcache = true;
                
                
                Severity: Minor
                Found in include/classes/statistics.class.php - About 4 hrs to fix

                  Method buildFilepath has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function buildFilepath(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
                      {
                          $file = $source->name;
                          if ($source instanceof Smarty_Config_Source) {
                              $_directories = $source->smarty->getConfigDir();
                  Severity: Major
                  Found in include/smarty/libs/sysplugins/smarty_resource.php - About 4 hrs to fix

                    Function compileAllConfig has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function compileAllConfig($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
                        {
                            // switch off time limit
                            if (function_exists('set_time_limit')) {
                                @set_time_limit($time_limit);
                    Severity: Minor
                    Found in include/smarty/libs/sysplugins/smarty_internal_utility.php - About 4 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 28 (exceeds 5 allowed). Consider refactoring.
                    Open

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