MPOS/php-mpos

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

Summary

Maintainability
F
3 wks
Test Coverage

File smarty_internal_configfileparser.php has 745 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
* Smarty Internal Plugin Configfileparser
*
* This is the config file parser.
Severity: Major
Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 1 day to fix

    Function doParse has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

        public function doParse($yymajor, $yytokenvalue)
        {
            $yyerrorhit = 0;   /* True if yymajor has invoked an error */
    
            if ($this->yyidx === null || $this->yyidx < 0) {
    Severity: Minor
    Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 7 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

    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

      Method doParse has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function doParse($yymajor, $yytokenvalue)
          {
              $yyerrorhit = 0;   /* True if yymajor has invoked an error */
      
              if ($this->yyidx === null || $this->yyidx < 0) {
      Severity: Major
      Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 3 hrs to fix

        Function yy_is_expected_token has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            public function yy_is_expected_token($token)
            {
                if ($token === 0) {
                    return true; // 0 is not part of this
                }
        Severity: Minor
        Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.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 yy_is_expected_token has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function yy_is_expected_token($token)
            {
                if ($token === 0) {
                    return true; // 0 is not part of this
                }
        Severity: Major
        Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 2 hrs to fix

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

              public function yy_get_expected_tokens($token)
              {
                  $state = $this->yystack[$this->yyidx]->stateno;
                  $expected = self::$yyExpectedTokens[$state];
                  if (in_array($token, self::$yyExpectedTokens[$state], true)) {
          Severity: Minor
          Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.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 yy_get_expected_tokens has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function yy_get_expected_tokens($token)
              {
                  $state = $this->yystack[$this->yyidx]->stateno;
                  $expected = self::$yyExpectedTokens[$state];
                  if (in_array($token, self::$yyExpectedTokens[$state], true)) {
          Severity: Major
          Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 2 hrs to fix

            Function yy_find_shift_action has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

               public function yy_find_shift_action($iLookAhead)
                {
                    $stateno = $this->yystack[$this->yyidx]->stateno;
            
                    /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */
            Severity: Minor
            Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 1 hr 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 yy_reduce has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function yy_reduce($yyruleno)
                {
                    $yymsp = $this->yystack[$this->yyidx];
                    if ($this->yyTraceFILE && $yyruleno >= 0
                          && $yyruleno < count(self::$yyRuleName)) {
            Severity: Minor
            Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 1 hr to fix

              Method yy_shift has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function yy_shift($yyNewState, $yyMajor, $yypMinor)
                  {
                      $this->yyidx++;
                      if ($this->yyidx >= self::YYSTACKDEPTH) {
                          $this->yyidx--;
              Severity: Minor
              Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 1 hr to fix

                Method yy_find_shift_action has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                   public function yy_find_shift_action($iLookAhead)
                    {
                        $stateno = $this->yystack[$this->yyidx]->stateno;
                
                        /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */
                Severity: Minor
                Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 1 hr to fix

                  Function yy_shift has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function yy_shift($yyNewState, $yyMajor, $yypMinor)
                      {
                          $this->yyidx++;
                          if ($this->yyidx >= self::YYSTACKDEPTH) {
                              $this->yyidx--;
                  Severity: Minor
                  Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 55 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

                  Function yy_reduce has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function yy_reduce($yyruleno)
                      {
                          $yymsp = $this->yystack[$this->yyidx];
                          if ($this->yyTraceFILE && $yyruleno >= 0
                                && $yyruleno < count(self::$yyRuleName)) {
                  Severity: Minor
                  Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 55 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

                  Function offsetSet has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function offsetSet($offset, $value)
                      {
                          if ($offset === null) {
                              if (isset($value[0])) {
                                  $x = ($value instanceof TPC_yyToken) ?
                  Severity: Minor
                  Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 45 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

                  Function parse_single_quoted_string has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static function parse_single_quoted_string($qstr) {
                          $escaped_string = substr($qstr, 1, strlen($qstr)-2); //remove outer quotes
                  
                          $ss = preg_split('/(\\\\.)/', $escaped_string, -1, PREG_SPLIT_DELIM_CAPTURE);
                  
                  
                  Severity: Minor
                  Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 35 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

                  Avoid too many return statements within this method.
                  Open

                                          return true;
                  Severity: Major
                  Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return self::$yy_action[$i];
                    Severity: Major
                    Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return true;
                      Severity: Major
                      Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return array_unique($expected);
                        Severity: Major
                        Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return self::$yy_default[$stateno];
                          Severity: Major
                          Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                    return false;
                            Severity: Major
                            Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return self::$yy_action[$i];
                              Severity: Major
                              Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                        return $expected;
                                Severity: Major
                                Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                              return true;
                                  Severity: Major
                                  Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.php - About 30 mins to fix

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

                                        public function yy_find_reduce_action($stateno, $iLookAhead)
                                        {
                                            /* $stateno = $this->yystack[$this->yyidx]->stateno; */
                                    
                                            if (!isset(self::$yy_reduce_ofst[$stateno])) {
                                    Severity: Minor
                                    Found in include/smarty/libs/sysplugins/smarty_internal_configfileparser.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

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

                                        public function doParse($yymajor, $yytokenvalue)
                                        {
                                            $yyerrorhit = 0;   /* True if yymajor has invoked an error */
                                    
                                            if ($this->yyidx === null || $this->yyidx < 0) {
                                    include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 3155..3243

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

                                    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 yy_get_expected_tokens($token)
                                        {
                                            $state = $this->yystack[$this->yyidx]->stateno;
                                            $expected = self::$yyExpectedTokens[$state];
                                            if (in_array($token, self::$yyExpectedTokens[$state], true)) {
                                    include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 1494..1562

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

                                    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 yy_is_expected_token($token)
                                        {
                                            if ($token === 0) {
                                                return true; // 0 is not part of this
                                            }
                                    include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 1564..1635

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

                                    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 yy_reduce($yyruleno)
                                        {
                                            $yymsp = $this->yystack[$this->yyidx];
                                            if ($this->yyTraceFILE && $yyruleno >= 0
                                                  && $yyruleno < count(self::$yyRuleName)) {
                                    include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 3079..3118

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

                                    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

                                    class TPC_yyToken implements ArrayAccess
                                    {
                                        public $string = '';
                                        public $metadata = array();
                                    
                                    
                                    include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 12..75

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

                                    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 yy_shift($yyNewState, $yyMajor, $yypMinor)
                                        {
                                            $this->yyidx++;
                                            if ($this->yyidx >= self::YYSTACKDEPTH) {
                                                $this->yyidx--;
                                    include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 1696..1730

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

                                    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 yy_find_shift_action($iLookAhead)
                                        {
                                            $stateno = $this->yystack[$this->yyidx]->stateno;
                                    
                                            /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */
                                    include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 1637..1671

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

                                    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 yy_find_reduce_action($stateno, $iLookAhead)
                                        {
                                            /* $stateno = $this->yystack[$this->yyidx]->stateno; */
                                    
                                            if (!isset(self::$yy_reduce_ofst[$stateno])) {
                                    include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 1673..1694

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

                                    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 yy_pop_parser_stack()
                                        {
                                            if (!count($this->yystack)) {
                                                return;
                                            }
                                    include/smarty/libs/sysplugins/smarty_internal_templateparser.php on lines 1466..1482

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

                                    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

                                        static public $yy_lookahead = array(
                                     /*     0 */     7,    8,    9,   10,   11,   12,    5,   27,   15,   16,
                                     /*    10 */    20,   21,   23,   23,   17,   18,   13,   14,   17,   18,
                                     /*    20 */    15,    2,   17,    4,   25,   26,    6,    3,    3,   14,
                                     /*    30 */    23,    1,   24,   17,    2,   25,   22,   25,
                                    include/smarty/libs/sysplugins/smarty_internal_configfileparser.php on lines 206..211

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

                                    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

                                    static public $yy_action = array(
                                     /*     0 */    29,   30,   34,   33,   24,   13,   19,   25,   35,   21,
                                     /*    10 */    59,    8,    3,    1,   20,   12,   14,   31,   20,   12,
                                     /*    20 */    15,   17,   23,   18,   27,   26,    4,    5,    6,   32,
                                     /*    30 */     2,   11,   28,   22,   16,    9,    7,   10,
                                    include/smarty/libs/sysplugins/smarty_internal_configfileparser.php on lines 212..217

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

                                    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