railpage/railpagecore

View on GitHub
lib/Template.php

Summary

Maintainability
F
6 days
Test Coverage

The class Template has 13 public methods. Consider refactoring Template to keep number of public methods under 10.
Open

class Template extends Smarty {
    
    /**
     * Sub theme - eg handheld
     * @var string $subtheme
Severity: Minor
Found in lib/Template.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class Template has an overall complexity of 85 which is very high. The configured complexity threshold is 50.
Open

class Template extends Smarty {
    
    /**
     * Sub theme - eg handheld
     * @var string $subtheme
Severity: Minor
Found in lib/Template.php by phpmd

Function resolveTemplate has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function resolveTemplate($template) {
        
        if (pathinfo($template, PATHINFO_EXTENSION) == "tpl" && file_exists($template)) {
            return $template;
        }
Severity: Minor
Found in lib/Template.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

File Template.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Templating engine
 * Simple wrapper for Smarty, in this case allowing for subthemes (eg handheld, kiosk, etc)
Severity: Minor
Found in lib/Template.php - About 2 hrs to fix

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

        public function getStylesheets() {
            $tags = array(); 
            
            $minify = array(); 
            
    Severity: Minor
    Found in lib/Template.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 getHeadTags has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getHeadTags() {
            $tags = array(); 
            
            if (count($this->rp_meta_tags)) {
                
    Severity: Minor
    Found in lib/Template.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 resolveTemplate has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function resolveTemplate($template) {
            
            if (pathinfo($template, PATHINFO_EXTENSION) == "tpl" && file_exists($template)) {
                return $template;
            }
    Severity: Minor
    Found in lib/Template.php - About 1 hr to fix

      Function available_themes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function available_themes() {
              $theme_dir = dirname(__DIR__) . DS . "themes";
              
              $themes = array(); 
              
      Severity: Minor
      Found in lib/Template.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 getStylesheets has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getStylesheets() {
              $tags = array(); 
              
              $minify = array(); 
              
      Severity: Minor
      Found in lib/Template.php - About 1 hr to fix

        Method getHeadTags has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getHeadTags() {
                $tags = array(); 
                
                if (count($this->rp_meta_tags)) {
                    
        Severity: Minor
        Found in lib/Template.php - About 1 hr to fix

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

              function display($template = null, $cache_id = null, $compile_id = null, $parent = null) {
              
                  if (RP_DEBUG) {
                      global $site_debug;
                      $debug_timer_start = microtime(true);
          Severity: Minor
          Found in lib/Template.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 $prop;
          Severity: Major
          Found in lib/Template.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return $prop;
            Severity: Major
            Found in lib/Template.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $prop;
              Severity: Major
              Found in lib/Template.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return $prop;
                Severity: Major
                Found in lib/Template.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return $prop;
                  Severity: Major
                  Found in lib/Template.php - About 30 mins to fix

                    The method resolveTemplate() has an NPath complexity of 5616. The configured NPath complexity threshold is 200.
                    Open

                        public function resolveTemplate($template) {
                            
                            if (pathinfo($template, PATHINFO_EXTENSION) == "tpl" && file_exists($template)) {
                                return $template;
                            }
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    NPathComplexity

                    Since: 0.1

                    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                    Example

                    class Foo {
                        function bar() {
                            // lots of complicated code
                        }
                    }

                    Source https://phpmd.org/rules/codesize.html#npathcomplexity

                    The method resolveTemplate() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
                    Open

                        public function resolveTemplate($template) {
                            
                            if (pathinfo($template, PATHINFO_EXTENSION) == "tpl" && file_exists($template)) {
                                return $template;
                            }
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    CyclomaticComplexity

                    Since: 0.1

                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                    Example

                    // Cyclomatic Complexity = 11
                    class Foo {
                    1   public function example() {
                    2       if ($a == $b) {
                    3           if ($a1 == $b1) {
                                    fiddle();
                    4           } elseif ($a2 == $b2) {
                                    fiddle();
                                } else {
                                    fiddle();
                                }
                    5       } elseif ($c == $d) {
                    6           while ($c == $d) {
                                    fiddle();
                                }
                    7        } elseif ($e == $f) {
                    8           for ($n = 0; $n < $h; $n++) {
                                    fiddle();
                                }
                            } else {
                                switch ($z) {
                    9               case 1:
                                        fiddle();
                                        break;
                    10              case 2:
                                        fiddle();
                                        break;
                    11              case 3:
                                        fiddle();
                                        break;
                                    default:
                                        fiddle();
                                        break;
                                }
                            }
                        }
                    }

                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                    The method getStylesheets() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                    Open

                        public function getStylesheets() {
                            $tags = array(); 
                            
                            $minify = array(); 
                            
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    CyclomaticComplexity

                    Since: 0.1

                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                    Example

                    // Cyclomatic Complexity = 11
                    class Foo {
                    1   public function example() {
                    2       if ($a == $b) {
                    3           if ($a1 == $b1) {
                                    fiddle();
                    4           } elseif ($a2 == $b2) {
                                    fiddle();
                                } else {
                                    fiddle();
                                }
                    5       } elseif ($c == $d) {
                    6           while ($c == $d) {
                                    fiddle();
                                }
                    7        } elseif ($e == $f) {
                    8           for ($n = 0; $n < $h; $n++) {
                                    fiddle();
                                }
                            } else {
                                switch ($z) {
                    9               case 1:
                                        fiddle();
                                        break;
                    10              case 2:
                                        fiddle();
                                        break;
                    11              case 3:
                                        fiddle();
                                        break;
                                    default:
                                        fiddle();
                                        break;
                                }
                            }
                        }
                    }

                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                    The method getHeadTags() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                    Open

                        public function getHeadTags() {
                            $tags = array(); 
                            
                            if (count($this->rp_meta_tags)) {
                                
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    CyclomaticComplexity

                    Since: 0.1

                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                    Example

                    // Cyclomatic Complexity = 11
                    class Foo {
                    1   public function example() {
                    2       if ($a == $b) {
                    3           if ($a1 == $b1) {
                                    fiddle();
                    4           } elseif ($a2 == $b2) {
                                    fiddle();
                                } else {
                                    fiddle();
                                }
                    5       } elseif ($c == $d) {
                    6           while ($c == $d) {
                                    fiddle();
                                }
                    7        } elseif ($e == $f) {
                    8           for ($n = 0; $n < $h; $n++) {
                                    fiddle();
                                }
                            } else {
                                switch ($z) {
                    9               case 1:
                                        fiddle();
                                        break;
                    10              case 2:
                                        fiddle();
                                        break;
                    11              case 3:
                                        fiddle();
                                        break;
                                    default:
                                        fiddle();
                                        break;
                                }
                            }
                        }
                    }

                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                    The method addHeadTag has a boolean flag argument $tag, which is a certain sign of a Single Responsibility Principle violation.
                    Open

                        public function addHeadTag($tag = false) {
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    BooleanArgumentFlag

                    Since: 1.4.0

                    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                    Example

                    class Foo {
                        public function bar($flag = true) {
                        }
                    }

                    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                    Avoid assigning values to variables in if clauses and the like (line '569', column '13').
                    Open

                        public function prerender($url = null, $first = null) {
                            
                            if ($url =! null && !in_array($url, $this->preload['prerender'])) {
                                if ($first != null) {
                                    array_unshift($this->preload['prerender'], $url); 
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    IfStatementAssignment

                    Since: 2.7.0

                    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                    Example

                    class Foo
                    {
                        public function bar($flag)
                        {
                            if ($foo = 'bar') { // possible typo
                                // ...
                            }
                            if ($baz = 0) { // always false
                                // ...
                            }
                        }
                    }

                    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                    The method getStylesheets uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                    Open

                                } else {
                                    
                                    if (file_exists(RP_SITE_ROOT . str_replace(".css", ".min.css", $data['href']))) {
                                        $data['href'] = str_replace(".css", ".min.css", $data['href']);
                                    }
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    ElseExpression

                    Since: 1.4.0

                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                    Example

                    class Foo
                    {
                        public function bar($flag)
                        {
                            if ($flag) {
                                // one branch
                            } else {
                                // another branch
                            }
                        }
                    }

                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                    The method theme_exists uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                    Open

                            } else {
                                return false;
                            }
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    ElseExpression

                    Since: 1.4.0

                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                    Example

                    class Foo
                    {
                        public function bar($flag)
                        {
                            if ($flag) {
                                // one branch
                            } else {
                                // another branch
                            }
                        }
                    }

                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                    Avoid assigning values to variables in if clauses and the like (line '379', column '17').
                    Open

                        public function available_themes() {
                            $theme_dir = dirname(__DIR__) . DS . "themes";
                            
                            $themes = array(); 
                            
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    IfStatementAssignment

                    Since: 2.7.0

                    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                    Example

                    class Foo
                    {
                        public function bar($flag)
                        {
                            if ($foo = 'bar') { // possible typo
                                // ...
                            }
                            if ($baz = 0) { // always false
                                // ...
                            }
                        }
                    }

                    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                    Avoid unused local variables such as '$pathinfo'.
                    Open

                            $pathinfo = pathinfo($template); 
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    UnusedLocalVariable

                    Since: 0.2

                    Detects when a local variable is declared and/or assigned, but not used.

                    Example

                    class Foo {
                        public function doSomething()
                        {
                            $i = 5; // Unused
                        }
                    }

                    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

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

                            if (count($this->preload['prefetch'])) {
                                foreach ($this->preload['prefetch'] as $href) {
                                    $tag = '<link rel="prefetch" href="' . htmlentities($href) . '">';
                                    
                                    $tags[] = $tag;
                    Severity: Major
                    Found in lib/Template.php and 1 other location - About 2 hrs to fix
                    lib/Template.php on lines 260..266

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

                    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 (count($this->preload['prerender'])) {
                                foreach ($this->preload['prerender'] as $href) {
                                    $tag = '<link rel="prerender" href="' . htmlentities($href) . '">';
                                    
                                    $tags[] = $tag;
                    Severity: Major
                    Found in lib/Template.php and 1 other location - About 2 hrs to fix
                    lib/Template.php on lines 252..258

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

                    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 addMetaTag($property = null, $content = null) {
                            
                            if ($property == null || $content == null) {
                                return;
                            }
                    Severity: Major
                    Found in lib/Template.php and 1 other location - About 2 hrs to fix
                    lib/Template.php on lines 213..220

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

                    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 addMetaLink($rel = null, $href = null) {
                            
                            if ($rel == null || $href == null) {
                                return;
                            }
                    Severity: Major
                    Found in lib/Template.php and 1 other location - About 2 hrs to fix
                    lib/Template.php on lines 196..204

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

                    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

                                $prop = RP_SITE_ROOT . DS . "themes" . DS . $this->user_theme . DS . "html" . DS . $template . "-" . $this->subtheme . ".tpl";
                    Severity: Major
                    Found in lib/Template.php and 1 other location - About 2 hrs to fix
                    lib/Template.php on lines 498..498

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

                    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

                            $prop = RP_SITE_ROOT . DS . "themes" . DS . $this->user_theme . DS . "html" . DS . $template . ".tpl"; 
                    Severity: Major
                    Found in lib/Template.php and 1 other location - About 2 hrs to fix
                    lib/Template.php on lines 491..491

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

                    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 ($url =! null && !in_array($url, $this->preload['prerender'])) {
                                if ($first != null) {
                                    array_unshift($this->preload['prerender'], $url); 
                                    return $this;
                                }
                    Severity: Major
                    Found in lib/Template.php and 1 other location - About 1 hr to fix
                    lib/Template.php on lines 592..601

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

                    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 ($url != null && !in_array($url, $this->preload['prefetch'])) {
                                if ($first != null) {
                                    array_unshift($this->preload['prefetch'], $url);
                                    
                                    return $this;
                    Severity: Major
                    Found in lib/Template.php and 1 other location - About 1 hr to fix
                    lib/Template.php on lines 569..577

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

                    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 3 locations. Consider refactoring.
                    Open

                        function display($template = null, $cache_id = null, $compile_id = null, $parent = null) {
                        
                            if (RP_DEBUG) {
                                global $site_debug;
                                $debug_timer_start = microtime(true);
                    Severity: Major
                    Found in lib/Template.php and 2 other locations - About 1 hr to fix
                    lib/Locos/LocoClass.php on lines 689..717
                    lib/Submenu.php on lines 103..153

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

                    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 3 locations. Consider refactoring.
                    Open

                                return $this->fetch(RP_SITE_ROOT . DS . "content" . DS . "inc.ad.banner.custom.tpl");
                    Severity: Major
                    Found in lib/Template.php and 2 other locations - About 1 hr to fix
                    lib/Submenu.php on lines 184..184
                    lib/Template.php on lines 439..439

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

                    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 3 locations. Consider refactoring.
                    Open

                                return $this->fetch(RP_SITE_ROOT . DS . "content" . DS . "inc.ad.banner.tpl");
                    Severity: Major
                    Found in lib/Template.php and 2 other locations - About 1 hr to fix
                    lib/Submenu.php on lines 184..184
                    lib/Template.php on lines 433..433

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

                    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 3 locations. Consider refactoring.
                    Open

                            $prop = dirname(__DIR__) . DS . "etc" . DS . "templates" . DS . $template. ".tpl";
                    Severity: Major
                    Found in lib/Template.php and 2 other locations - About 1 hr to fix
                    lib/AppCore.php on lines 547..547
                    lib/AppCore.php on lines 549..549

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

                    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

                                $prop = RP_SITE_ROOT . DS . "content" . DS . $template . "-" . $this->subtheme . ".tpl";
                    Severity: Minor
                    Found in lib/Template.php and 1 other location - About 1 hr to fix
                    lib/Template.php on lines 516..516

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

                    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

                            $prop = RP_SITE_ROOT . DS . "content" . DS . $template . ".tpl";
                    Severity: Minor
                    Found in lib/Template.php and 1 other location - About 1 hr to fix
                    lib/Template.php on lines 509..509

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

                    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

                                    $tags[] = sprintf("<link href='%s' rel='%s' media='%s'>", $data['href'], $data['rel'], $data['media']);
                    Severity: Minor
                    Found in lib/Template.php and 1 other location - About 1 hr to fix
                    lib/Users/Utility/AvatarUtility.php on lines 166..166

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 30.

                    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 12 locations. Consider refactoring.
                    Open

                            if (RP_DEBUG) {
                                global $site_debug;
                                $debug_timer_start = microtime(true);
                            }
                    Severity: Major
                    Found in lib/Template.php and 11 other locations - About 55 mins to fix
                    lib/Events/Event.php on lines 341..344
                    lib/Events/Event.php on lines 381..384
                    lib/Forums/Post.php on lines 434..437
                    lib/Forums/Thread.php on lines 209..212
                    lib/Images/Image.php on lines 611..614
                    lib/Links/Links.php on lines 278..281
                    lib/News/Article.php on lines 365..368
                    lib/News/Base.php on lines 310..313
                    lib/PrivateMessages/Folder.php on lines 86..89
                    lib/API.php on lines 128..131
                    lib/API.php on lines 260..263

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

                    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 7 locations. Consider refactoring.
                    Open

                                        $data['href'] = str_replace(".css", ".min.css", $data['href']);
                    Severity: Major
                    Found in lib/Template.php and 6 other locations - About 55 mins to fix
                    lib/Newsletters/Weekly.php on lines 408..408
                    lib/Prerender/Home.php on lines 153..153
                    lib/PrivateMessages/Folder.php on lines 126..126
                    lib/RSS/Consume.php on lines 279..279
                    lib/RSS/Consume.php on lines 280..280
                    lib/RSS/Consume.php on lines 364..364

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

                    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

                                    $prop = $dir . DS . "html" . DS . $tpl . "-" . $this->subtheme . ".tpl";
                    Severity: Minor
                    Found in lib/Template.php and 1 other location - About 50 mins to fix
                    lib/Template.php on lines 479..479

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

                    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

                                $prop = $dir . DS . "html" . DS . $tpl . ".tpl";
                    Severity: Minor
                    Found in lib/Template.php and 1 other location - About 50 mins to fix
                    lib/Template.php on lines 472..472

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

                    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 (substr($data['href'], 0, 4) == "http") {
                                    $tags[] = sprintf("<link href='%s' rel='%s' media='%s'>", $data['href'], $data['rel'], $data['media']);
                                } else {
                                    
                                    if (file_exists(RP_SITE_ROOT . str_replace(".css", ".min.css", $data['href']))) {
                    Severity: Minor
                    Found in lib/Template.php and 1 other location - About 40 mins to fix
                    lib/Template.php on lines 295..295

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

                    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

                                    $str = substr($data['href'], 0, 1) == "/" ? substr($data['href'], 1) : $data['href'];
                    Severity: Minor
                    Found in lib/Template.php and 1 other location - About 40 mins to fix
                    lib/Template.php on lines 287..301

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

                    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 setUser(User $User) {
                            $this->User = $User;
                        }
                    Severity: Minor
                    Found in lib/Template.php and 1 other location - About 30 mins to fix
                    lib/Template.php on lines 127..129

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

                    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 setRailpageConfig(stdClass $RailpageConfig) {
                            $this->RailpageConfig = $RailpageConfig;
                        }
                    Severity: Minor
                    Found in lib/Template.php and 1 other location - About 30 mins to fix
                    lib/Template.php on lines 117..119

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

                    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

                    The parameter $RailpageConfig is not named in camelCase.
                    Open

                        public function setRailpageConfig(stdClass $RailpageConfig) {
                            $this->RailpageConfig = $RailpageConfig;
                        }
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    CamelCaseParameterName

                    Since: 0.2

                    It is considered best practice to use the camelCase notation to name parameters.

                    Example

                    class ClassName {
                        public function doSomething($user_name) {
                        }
                    }

                    Source

                    The parameter $cache_id is not named in camelCase.
                    Open

                        function display($template = null, $cache_id = null, $compile_id = null, $parent = null) {
                        
                            if (RP_DEBUG) {
                                global $site_debug;
                                $debug_timer_start = microtime(true);
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    CamelCaseParameterName

                    Since: 0.2

                    It is considered best practice to use the camelCase notation to name parameters.

                    Example

                    class ClassName {
                        public function doSomething($user_name) {
                        }
                    }

                    Source

                    The parameter $compile_id is not named in camelCase.
                    Open

                        function display($template = null, $cache_id = null, $compile_id = null, $parent = null) {
                        
                            if (RP_DEBUG) {
                                global $site_debug;
                                $debug_timer_start = microtime(true);
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    CamelCaseParameterName

                    Since: 0.2

                    It is considered best practice to use the camelCase notation to name parameters.

                    Example

                    class ClassName {
                        public function doSomething($user_name) {
                        }
                    }

                    Source

                    The parameter $User is not named in camelCase.
                    Open

                        public function setUser(User $User) {
                            $this->User = $User;
                        }
                    Severity: Minor
                    Found in lib/Template.php by phpmd

                    CamelCaseParameterName

                    Since: 0.2

                    It is considered best practice to use the camelCase notation to name parameters.

                    Example

                    class ClassName {
                        public function doSomething($user_name) {
                        }
                    }

                    Source

                    Blank line found at start of control structure
                    Open

                                } else {
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    Function closing brace must go on the next line following the body; found 1 blank lines before brace
                    Open

                        }
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    There must be one blank line after the namespace declaration
                    Open

                    namespace Railpage;
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    Visibility must be declared on method "display"
                    Open

                        function display($template = null, $cache_id = null, $compile_id = null, $parent = null) {
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    Function closing brace must go on the next line following the body; found 1 blank lines before brace
                    Open

                        }
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    Blank line found at end of control structure
                    Open

                                
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    Function closing brace must go on the next line following the body; found 1 blank lines before brace
                    Open

                        }
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    Blank line found at start of control structure
                    Open

                            if (count($this->rp_meta_tags)) {
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    Blank line found at start of control structure
                    Open

                            if ($this->subtheme && !is_null($template)) {
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    Blank line found at start of control structure
                    Open

                            if ($showjobs && rand(0, 5) % 2) {
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    Blank line found at end of control structure
                    Open

                                
                    Severity: Minor
                    Found in lib/Template.php by phpcodesniffer

                    There are no issues that match your filters.

                    Category
                    Status