MPOS/php-mpos

View on GitHub
include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php

Summary

Maintainability
F
1 wk
Test Coverage

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

    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

      Function yylex5 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function yylex5()
          {
              $tokenMap = array (
                    1 => 0,
                    2 => 0,
      Severity: Minor
      Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 2 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 yylex4 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function yylex4()
          {
              $tokenMap = array (
                    1 => 0,
                    2 => 0,
      Severity: Minor
      Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 2 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 yylex2 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function yylex2()
          {
              $tokenMap = array (
                    1 => 0,
                    2 => 0,
      Severity: Minor
      Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 2 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 yylex1 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function yylex1()
          {
              $tokenMap = array (
                    1 => 0,
                    2 => 0,
      Severity: Minor
      Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 2 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 yylex6 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function yylex6()
          {
              $tokenMap = array (
                    1 => 0,
                    2 => 0,
      Severity: Minor
      Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 2 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 yylex3 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function yylex3()
          {
              $tokenMap = array (
                    1 => 0,
                  );
      Severity: Minor
      Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 2 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 53 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_configfilelexer.php - About 2 hrs to fix

        Method yylex1 has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method yylex4 has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function yylex4()
              {
                  $tokenMap = array (
                        1 => 0,
                        2 => 0,
          Severity: Minor
          Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 1 hr to fix

            Method yylex6 has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function yylex6()
                {
                    $tokenMap = array (
                          1 => 0,
                          2 => 0,
            Severity: Minor
            Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 1 hr to fix

              Method yylex5 has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function yylex5()
                  {
                      $tokenMap = array (
                            1 => 0,
                            2 => 0,
              Severity: Minor
              Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 1 hr to fix

                Method yylex3 has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function yylex3()
                    {
                        $tokenMap = array (
                              1 => 0,
                            );
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 1 hr to fix

                  Function yy_r6_2 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function yy_r6_2($yy_subpatterns)
                      {
                  
                    if ($this->mbstring_overload) {
                      $to = mb_strlen($this->data,'latin1');
                  Severity: Minor
                  Found in include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php - About 25 mins 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

                      public function yylex5()
                      {
                          $tokenMap = array (
                                1 => 0,
                                2 => 0,
                  include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php on lines 556..611

                  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 597.

                  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 yylex6()
                      {
                          $tokenMap = array (
                                1 => 0,
                                2 => 0,
                  include/smarty/libs/sysplugins/smarty_internal_configfilelexer.php on lines 484..539

                  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 597.

                  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

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

                      public function yypushstate($state)
                      {
                          if ($this->yyTraceFILE) {
                               fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
                          }
                  include/smarty/libs/sysplugins/smarty_internal_templatelexer.php on lines 112..122

                  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 146.

                  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

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

                      public function yypopstate()
                      {
                         if ($this->yyTraceFILE) {
                               fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt,  isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
                          }
                  include/smarty/libs/sysplugins/smarty_internal_templatelexer.php on lines 124..134

                  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 134.

                  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

                  There are no issues that match your filters.

                  Category
                  Status