MPOS/php-mpos

View on GitHub

Showing 889 of 1,089 total issues

File statistics.class.php has 720 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;


/*
Severity: Major
Found in include/classes/statistics.class.php - About 1 day to fix

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

        public function compile($args, $compiler, $parameter)
        {
            // check and get attributes
            $_attr = $this->getAttributes($compiler, $args);
            // nocache option

    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 smarty_internal_utility.php has 668 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Project:     Smarty: the PHP compiling template engine
     * File:        smarty_internal_utility.php
     * SVN:         $Id: $
    Severity: Major
    Found in include/smarty/libs/sysplugins/smarty_internal_utility.php - About 1 day to fix

      File Smarty.class.php has 656 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Project:     Smarty: the PHP compiling template engine
       * File:        Smarty.class.php
       * SVN:         $Id: Smarty.class.php 4800 2013-12-15 15:19:01Z Uwe.Tews@googlemail.com $
      Severity: Major
      Found in include/smarty/libs/Smarty.class.php - About 1 day to fix

        Method fetch has 282 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)
            {
                if ($template === null && $this instanceof $this->template_class) {
                    $template = $this;
                }
        Severity: Major
        Found in include/smarty/libs/sysplugins/smarty_internal_templatebase.php - About 1 day to fix

          Method smarty_function_html_select_time has 279 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function smarty_function_html_select_time($params, $template)
          {
              $prefix = "Time_";
              $field_array = null;
              $field_separator = "\n";
          Severity: Major
          Found in include/smarty/libs/plugins/function.html_select_time.php - About 1 day to fix

            Method smarty_function_html_select_date has 277 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function smarty_function_html_select_date($params, $template)
            {
                // generate timestamps used for month names only
                static $_month_timestamps = null;
                static $_current_year = null;
            Severity: Major
            Found in include/smarty/libs/plugins/function.html_select_date.php - About 1 day to fix

              Function _hashHTMLBlocks_inMarkdown has a Cognitive Complexity of 66 (exceeds 5 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: Minor
              Found in include/lib/Michelf/Markdown.php - About 1 day 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 244 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                var MetisMenu = function ($) {
              
                  var NAME = 'metisMenu';
                  var DATA_KEY = 'metisMenu';
                  var EVENT_KEY = '.' + DATA_KEY;
              Severity: Major
              Found in public/site_assets/bootstrap/js/plugins/metisMenu/jquery.metisMenu.js - About 1 day to fix

                Function buildFilepath has a Cognitive Complexity of 62 (exceeds 5 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: Minor
                Found in include/smarty/libs/sysplugins/smarty_resource.php - About 1 day 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 Mobile_Detect.php has 561 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Mobile Detect Library
                 * =====================
                 *
                Severity: Major
                Found in include/lib/Mobile_Detect.php - About 1 day to fix

                  Function createTemplateCodeFrame has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function createTemplateCodeFrame($content = '', $cache = false)
                      {
                          $plugins_string = '';
                          // include code for plugins
                          if (!$cache) {
                  Severity: Minor
                  Found in include/smarty/libs/sysplugins/smarty_internal_template.php - About 1 day 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 admin_settings.inc.php has 546 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  $defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
                  
                  $aThemes = $template->getThemes();
                  $aDesigns = $template->getDesigns();
                  Severity: Major
                  Found in include/config/admin_settings.inc.php - About 1 day to fix

                    Function doItalicsAndBold has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function doItalicsAndBold($text) {
                            $token_stack = array('');
                            $text_stack = array('');
                            $em = '';
                            $strong = '';
                    Severity: Minor
                    Found in include/lib/Michelf/Markdown.php - About 1 day 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_checkboxes has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function smarty_function_html_checkboxes($params, $template)
                    {
                        require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
                    
                        $name = 'checkbox';
                    Severity: Minor
                    Found in include/smarty/libs/plugins/function.html_checkboxes.php - About 1 day 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 append has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function append($tpl_var, $value = null, $merge = false, $nocache = false)
                        {
                            if (is_array($tpl_var)) {
                                // $tpl_var is an array, ignore $value
                                foreach ($tpl_var as $_key => $_val) {
                    Severity: Minor
                    Found in include/smarty/libs/sysplugins/smarty_internal_data.php - About 1 day 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 smarty_internal_configfilelexer.php has 523 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                    * Smarty Internal Plugin Configfilelexer
                    *
                    * This is the lexer to break the config file source into tokens 
                    Severity: Major
                    Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 1 day to fix

                      File smarty_internal_templatebase.php has 522 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * Smarty Internal Plugin Smarty Template  Base
                       *
                       * This file contains the basic shared methodes for template handling
                      Severity: Major
                      Found in include/smarty/libs/sysplugins/smarty_internal_templatebase.php - About 1 day to fix

                        Function smarty_function_html_options has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function smarty_function_html_options($params, $template)
                        {
                            require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
                        
                            $name = null;
                        Severity: Minor
                        Found in include/smarty/libs/plugins/function.html_options.php - About 1 day 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

                        User has 56 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class User extends Base {
                          protected $table = 'accounts';
                          private $userID = false;
                          private $user = array();
                        
                        
                        Severity: Major
                        Found in include/classes/user.class.php - About 1 day to fix
                          Severity
                          Category
                          Status
                          Source
                          Language