MPOS/php-mpos

View on GitHub

Showing 1,089 of 1,089 total issues

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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  function run_0013() {
                    // Ugly but haven't found a better way
                    global $setting, $config, $user, $mysqli;
                  
                  
                  Severity: Major
                  Found in upgrade/definitions/0.0.12_to_0.0.13.inc.php and 1 other location - About 5 hrs to fix
                  upgrade/definitions/0.0.13_to_0.0.14.inc.php on lines 1..30

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 189.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  function run_0014() {
                    // Ugly but haven't found a better way
                    global $setting, $config, $user, $mysqli;
                  
                  
                  Severity: Major
                  Found in upgrade/definitions/0.0.13_to_0.0.14.inc.php and 1 other location - About 5 hrs to fix
                  upgrade/definitions/0.0.12_to_0.0.13.inc.php on lines 1..39

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 189.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  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

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                              public function getLastRegisteredUsers($limit=10,$start=0) {
                                $this->debug->append("STA " . __METHOD__, 4);
                                $invitation = new Invitation();
                                $invitation->setMysql($this->mysqli);
                                $invitation->setDebug($this->debug);
                            Severity: Major
                            Found in include/classes/user.class.php and 1 other location - About 5 hrs to fix
                            include/classes/user.class.php on lines 173..191

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 183.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                              public function getTopInviters($limit=10,$start=0) {
                                $this->debug->append("STA " . __METHOD__, 4);
                                $invitation = new Invitation();
                                $invitation->setMysql($this->mysqli);
                                $invitation->setDebug($this->debug);
                            Severity: Major
                            Found in include/classes/user.class.php and 1 other location - About 5 hrs to fix
                            include/classes/user.class.php on lines 150..166

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 183.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language