MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

Function register has a Cognitive Complexity of 42 (exceeds 5 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: Minor
Found in include/classes/user.class.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 41 (exceeds 5 allowed). Consider refactoring.
Open

    public function compile($args, $compiler)
    {
        // check and get attributes
        $_attr = $this->getAttributes($compiler, $args);
        // save possible attributes
Severity: Minor
Found in include/smarty/libs/sysplugins/smarty_internal_compile_call.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 MetisMenu has 153 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var MetisMenu = function () {
      function MetisMenu(element, config) {
        _classCallCheck(this, MetisMenu);

        this._element = element;
Severity: Major
Found in public/site_assets/bootstrap/js/plugins/metisMenu/jquery.metisMenu.js - About 6 hrs to fix

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

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

      File smarty_internal_template.php has 420 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Smarty Internal Plugin Template
       *
       * This file contains the Smarty template engine
      Severity: Minor
      Found in include/smarty/libs/sysplugins/smarty_internal_template.php - About 6 hrs to fix

        File smarty_resource.php has 413 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * Smarty Resource Plugin
         *
         * @package Smarty
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_resource.php - About 5 hrs to fix

          Smarty has 42 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Smarty extends Smarty_Internal_TemplateBase
          {
              /**#@+
               * constant definitions
               */
          Severity: Minor
          Found in include/smarty/libs/Smarty.class.php - About 5 hrs to fix

            Base has 42 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Base {
              private $sError = '';
              private $sCronError = '';
              protected $table = '';
              private $values = array(), $types = ''; 
            Severity: Minor
            Found in include/classes/base.class.php - About 5 hrs to fix

              Method _hashHTMLBlocks_inHTML has 140 lines of code (exceeds 25 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: Major
              Found in include/lib/Michelf/Markdown.php - About 5 hrs to fix

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

                    public function compile($args, $compiler, $parameter)
                    {
                        $tpl = $compiler->template;
                        // check and get attributes
                        $_attr = $this->getAttributes($compiler, $args);
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_compile_foreach.php - About 5 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 generateUpToDateMimeArray has 139 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function generateUpToDateMimeArray()
                {
                    $preamble = "<?php\n\n";
                    $preamble .= "/*\n";
                    $preamble .= " * This file is part of SwiftMailer.\n";
                Severity: Major
                Found in include/lib/swiftmailer/swiftmailer_generate_mimes_config.php - About 5 hrs to fix

                  Smarty_Internal_Configfileparser has 41 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Smarty_Internal_Configfileparser#line 80 "smarty_internal_configfileparser.php"
                  {
                  #line 14 "smarty_internal_configfileparser.y"
                  
                      // states whether the parse was successful or not
                  Severity: Minor
                  Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 5 hrs to fix

                    _MarkdownExtra_TmpImpl has 41 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
                    
                        ### Configuration Variables ###
                    
                        # Prefix for footnote ids.
                    Severity: Minor
                    Found in include/lib/Michelf/Markdown.php - About 5 hrs to fix

                      Function decodeProperties has a Cognitive Complexity of 36 (exceeds 5 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 5 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 transaction.class.php has 383 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      $defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
                      
                      class Transaction extends Base {
                        protected $table = 'transactions';
                      Severity: Minor
                      Found in include/classes/transaction.class.php - About 5 hrs to fix

                        File NTLMAuthenticator.php has 380 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        /*
                         * This file is part of SwiftMailer.
                         * (c) 2004-2009 Chris Corbyn

                          Function to_smarty_php has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function to_smarty_php()
                              {
                                  $code = '';
                                  for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
                                      if ($key + 2 < $cnt) {
                          Severity: Minor
                          Found in include/smarty/libs/sysplugins/smarty_internal_parsetree.php - About 5 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_modifier_escape has 126 lines of code (exceeds 25 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: Major
                          Found in include/smarty/libs/plugins/modifier.escape.php - About 5 hrs to fix

                            Smarty_Internal_Configfilelexer has 38 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class Smarty_Internal_Configfilelexer
                            {
                            
                                public $data;
                                public $counter;
                            Severity: Minor
                            Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 5 hrs to fix

                              Swift_Mime_SimpleMessage has 38 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime_Message
                              {
                                  /**
                                   * Create a new SimpleMessage with $headers, $encoder and $cache.
                                   *
                              Severity: Minor
                              Found in include/lib/swiftmailer/classes/Swift/Mime/SimpleMessage.php - About 5 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language