modxcms/revolution

View on GitHub
core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php

Summary

Maintainability
F
2 wks
Test Coverage

Function compileTag2 has a Cognitive Complexity of 243 (exceeds 5 allowed). Consider refactoring.
Open

    private function compileTag2($tag, $args, $parameter)
    {
        $plugin_type = '';
        // $args contains the attributes parsed and compiled by the lexer/parser
        // assume that tag does compile into code, but creates no HTML output
Severity: Minor
Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 4 days 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_templatecompilerbase.php has 1010 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Smarty Internal Plugin Smarty Template Compiler Base
 * This file contains the basic classes and methods for compiling Smarty templates with lexer/parser
 *
Severity: Major
Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 2 days to fix

    Method compileTag2 has 258 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function compileTag2($tag, $args, $parameter)
        {
            $plugin_type = '';
            // $args contains the attributes parsed and compiled by the lexer/parser
            // assume that tag does compile into code, but creates no HTML output
    Severity: Major
    Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 1 day to fix

      Smarty_Internal_TemplateCompilerBase has 46 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class Smarty_Internal_TemplateCompilerBase
      {
          /**
           * compile tag objects cache
           *
      Severity: Minor
      Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 6 hrs to fix

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

            public function compilePHPFunctionCall($name, $parameter)
            {
                if (!$this->smarty->security_policy || $this->smarty->security_policy->isTrustedPhpFunction($name, $this)) {
                    if (strcasecmp($name, 'isset') === 0 || strcasecmp($name, 'empty') === 0
                        || strcasecmp($name, 'array') === 0 || is_callable($name)
        Severity: Minor
        Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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

        Function getPlugin has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getPlugin($plugin_name, $plugin_type)
            {
                $function = null;
                if ($this->caching && ($this->nocache || $this->tag_nocache)) {
                    if (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) {
        Severity: Minor
        Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 3 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 compileTemplateSource has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function compileTemplateSource(
                Smarty_Internal_Template $template,
                $nocache = null,
                Smarty_Internal_TemplateCompilerBase $parent_compiler = null
            ) {
        Severity: Major
        Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 2 hrs to fix

          Method trigger_template_error has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function trigger_template_error($args = null, $line = null, $tagline = null)
              {
                  $lex = $this->parser->lex;
                  if ($tagline === true) {
                      // get line number of Tag
          Severity: Major
          Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 2 hrs to fix

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

                public function compileTemplateSource(
                    Smarty_Internal_Template $template,
                    $nocache = null,
                    Smarty_Internal_TemplateCompilerBase $parent_compiler = null
                ) {
            Severity: Minor
            Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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 trigger_template_error has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                public function trigger_template_error($args = null, $line = null, $tagline = null)
                {
                    $lex = $this->parser->lex;
                    if ($tagline === true) {
                        // get line number of Tag
            Severity: Minor
            Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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 getPluginFromDefaultHandler has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getPluginFromDefaultHandler($tag, $plugin_type)
                {
                    $callback = null;
                    $script = null;
                    $cacheable = true;
            Severity: Minor
            Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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 processNocacheCode has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public function processNocacheCode($content, $is_code)
                {
                    // If the template is not evaluated and we have a nocache section and or a nocache tag
                    if ($is_code && !empty($content)) {
                        // generate replacement code
            Severity: Minor
            Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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 getPlugin has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getPlugin($plugin_name, $plugin_type)
                {
                    $function = null;
                    if ($this->caching && ($this->nocache || $this->tag_nocache)) {
                        if (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) {
            Severity: Major
            Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 2 hrs to fix

              Method processText has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function processText($text)
                  {
              
                      if (strpos($text, '<') === false) {
                          return preg_replace($this->stripRegEx, '', $text);

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

                    public function compilePHPFunctionCall($name, $parameter)
                    {
                        if (!$this->smarty->security_policy || $this->smarty->security_policy->isTrustedPhpFunction($name, $this)) {
                            if (strcasecmp($name, 'isset') === 0 || strcasecmp($name, 'empty') === 0
                                || strcasecmp($name, 'array') === 0 || is_callable($name)

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

                      public function getPluginFromDefaultHandler($tag, $plugin_type)
                      {
                          $callback = null;
                          $script = null;
                          $cacheable = true;

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

                        public function initDelimiterPreg()
                        {
                            $ldel = $this->smarty->getLeftDelimiter();
                            $this->ldelLength = strlen($ldel);
                            $this->ldelPreg = '';
                    Severity: Minor
                    Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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 isVariable has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function isVariable($value)
                        {
                            if (is_string($value)) {
                                return preg_match('/[$(]/', $value);
                            }
                    Severity: Minor
                    Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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 convertScope has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function convertScope($_attr, $validScopes)
                        {
                            $_scope = 0;
                            if (isset($_attr[ 'scope' ])) {
                                $_scopeName = trim($_attr[ 'scope' ], '\'"');
                    Severity: Minor
                    Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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

                    Consider simplifying this complex logical expression.
                    Open

                                if ((!($this->template->source->handler->recompiled) || $this->forceNocache) && $this->caching
                                    && !$this->suppressNocacheProcessing && ($this->nocache || $this->tag_nocache)
                                ) {
                                    $this->template->compiled->has_nocache_code = true;
                                    $_output = addcslashes($content, '\'\\');
                    Severity: Major
                    Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 40 mins to fix

                      Method callTagCompiler has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)
                      Severity: Minor
                      Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 35 mins to fix

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

                            public function compileCheckPlugins($requiredPlugins)
                            {
                                if (!empty($requiredPlugins)) {
                                    $plugins = array();
                                    foreach ($requiredPlugins as $plugin) {
                        Severity: Minor
                        Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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

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

                            public function processText($text)
                            {
                        
                                if (strpos($text, '<') === false) {
                                    return preg_replace($this->stripRegEx, '', $text);
                        Severity: Minor
                        Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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 $this->callTagCompiler('private_function_plugin', $args, $parameter, $tag, $function);
                        Severity: Major
                        Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                              return call_user_func_array(
                                                  $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ],
                                                  array(
                                                      $args,
                                                      $this
                          Severity: Major
                          Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                        return $plugin_object->compile($args, $this);
                            Severity: Major
                            Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                                  return $name . '(' . implode(',', $parameter) . ')';
                              Severity: Major
                              Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                            return call_user_func_array(
                                                                $this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ],
                                                                array(
                                                                    $new_args,
                                                                    $this
                                Severity: Major
                                Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                      return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag);
                                  Severity: Major
                                  Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                        return $this->callTagCompiler('private_registered_function', $args, $parameter, $tag);
                                    Severity: Major
                                    Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                                  return call_user_func_array(
                                                                      $this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ],
                                                                      array(
                                                                          $new_args,
                                                                          $this
                                      Severity: Major
                                      Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                                return $plugin($args, $this->smarty);
                                        Severity: Major
                                        Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                  return false;
                                          Severity: Major
                                          Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                                        return $plugin($new_args, $this->smarty);
                                            Severity: Major
                                            Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                                          return $this->callTagCompiler(
                                                                              'private_registered_' . $plugin_type,
                                                                              $args,
                                                                              $parameter,
                                                                              $tag
                                              Severity: Major
                                              Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                        return $this->callTagCompiler(
                                                                            'private_object_block_function',
                                                                            $args,
                                                                            $parameter,
                                                                            $tag,
                                                Severity: Major
                                                Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                              return $this->callTagCompiler(
                                                                                  'private_registered_' . $plugin_type,
                                                                                  $args,
                                                                                  $parameter,
                                                                                  $tag
                                                  Severity: Major
                                                  Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                                    return $plugin_object->compile($args, $this);
                                                    Severity: Major
                                                    Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                          return $this->callTagCompiler('private_block_plugin', $args, $parameter, $tag, $function);
                                                      Severity: Major
                                                      Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                                        return $this->callTagCompiler(
                                                                                            'private_' . $plugin_type . '_plugin',
                                                                                            $args,
                                                                                            $parameter,
                                                                                            $tag,
                                                        Severity: Major
                                                        Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 30 mins to fix

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

                                                              public function getTagCompiler($tag)
                                                              {
                                                                  // re-use object if already exists
                                                                  if (!isset(self::$_tag_objects[ $tag ])) {
                                                                      // lazy load internal compiler plugin
                                                          Severity: Minor
                                                          Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.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 3 locations. Consider refactoring.
                                                          Open

                                                                  if (preg_match_all(
                                                                      '#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is',
                                                                      $text,
                                                                      $matches,
                                                                      PREG_OFFSET_CAPTURE | PREG_SET_ORDER
                                                          core/model/smarty/plugins/outputfilter.trimwhitespace.php on lines 27..42
                                                          core/model/smarty/plugins/outputfilter.trimwhitespace.php on lines 48..63

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

                                                          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

                                                                  if (preg_match_all(
                                                                      '#@!@SMARTY:([0-9]+):SMARTY@!@#is',
                                                                      $text,
                                                                      $matches,
                                                                      PREG_OFFSET_CAPTURE | PREG_SET_ORDER
                                                          core/model/smarty/plugins/outputfilter.trimwhitespace.php on lines 79..87

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

                                                          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

                                                                  if ($this->caching && ($this->nocache || $this->tag_nocache)) {
                                                                      if (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) {
                                                                          $function =
                                                                              $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ];
                                                                      } elseif (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) {
                                                          core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php on lines 822..832

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

                                                          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

                                                                  } else {
                                                                      if (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) {
                                                                          $function =
                                                                              $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ];
                                                                      } elseif (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) {
                                                          core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php on lines 812..832

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

                                                          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

                                                                      if ($this->caching && ($this->nocache || $this->tag_nocache)) {
                                                                          $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'file' ] =
                                                                              $file;
                                                                          $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ] =
                                                                              $function;
                                                          core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php on lines 895..905

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

                                                          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

                                                                              if ($this->caching && ($this->nocache || $this->tag_nocache)) {
                                                                                  $this->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'file' ] =
                                                                                      $script;
                                                                                  $this->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'function' ] =
                                                                                      $callback;
                                                          core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php on lines 843..853

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

                                                          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