railpage/railpagecore

View on GitHub
lib/News/News.php

Summary

Maintainability
D
2 days
Test Coverage

Method guessTopic has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        static public function guessTopic($topic) {
            
            /**
             * Normalise the topic name
             */
Severity: Minor
Found in lib/News/News.php - About 1 hr to fix

    Method getStoriesFromTopic has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public function getStoriesFromTopic($id = false, $page = 0, $limit = 25, $total = true) {
                if (!$id || !$this->db) {
                    return false;
                }
                
    Severity: Minor
    Found in lib/News/News.php - About 1 hr to fix

      Function getStoriesFromTopic has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

              public function getStoriesFromTopic($id = false, $page = 0, $limit = 25, $total = true) {
                  if (!$id || !$this->db) {
                      return false;
                  }
                  
      Severity: Minor
      Found in lib/News/News.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

      Function guessTopic has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

              static public function guessTopic($topic) {
                  
                  /**
                   * Normalise the topic name
                   */
      Severity: Minor
      Found in lib/News/News.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

      Avoid too many return statements within this method.
      Open

                      return new Topic("other-rail");
      Severity: Major
      Found in lib/News/News.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return new Topic("other-rail");
        Severity: Major
        Found in lib/News/News.php - About 30 mins to fix

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

                  public function getStory($id = false, $pending = false) {
                      if (!$id || !$this->db) {
                          return false;
                      }
                      
          Severity: Minor
          Found in lib/News/News.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

          The method guessTopic() has an NPath complexity of 1024. The configured NPath complexity threshold is 200.
          Open

                  static public function guessTopic($topic) {
                      
                      /**
                       * Normalise the topic name
                       */
          Severity: Minor
          Found in lib/News/News.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 guessTopic() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
          Open

                  static public function guessTopic($topic) {
                      
                      /**
                       * Normalise the topic name
                       */
          Severity: Minor
          Found in lib/News/News.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 getStory has a boolean flag argument $id, which is a certain sign of a Single Responsibility Principle violation.
          Open

                  public function getStory($id = false, $pending = false) {
          Severity: Minor
          Found in lib/News/News.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

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

                  public function getStoriesFromTopic($id = false, $page = 0, $limit = 25, $total = true) {
          Severity: Minor
          Found in lib/News/News.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

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

                  static public function findCorrectArticle($lookup = false, $num = 5) {
          Severity: Minor
          Found in lib/News/News.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

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

                  public function getStory($id = false, $pending = false) {
          Severity: Minor
          Found in lib/News/News.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

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

                  public function getStoriesFromTopic($id = false, $page = 0, $limit = 25, $total = true) {
          Severity: Minor
          Found in lib/News/News.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

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

                      } else {
                          $query = "SELECT s.*, t.topicname, t.topicimage, t.topictext, t.topicid FROM nuke_stories s, nuke_topics t WHERE s.topic = t.topicid AND s.sid = '".$this->db->real_escape_string($id)."'";
                      }
          Severity: Minor
          Found in lib/News/News.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 getStoriesFromTopic uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                      } else {
                          trigger_error("News: unable to fetch stories from topic");
                          trigger_error($this->db->error); 
                          trigger_error($query); 
                      }
          Severity: Minor
          Found in lib/News/News.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 '133', column '18').
          Open

                  public static function getArticleJSON($article_id) {
                      
                      $key = sprintf("json:railpage.news.article=%d", $article_id);
                      
                      $Memcached = AppCore::getMemcached(); 
          Severity: Minor
          Found in lib/News/News.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 assigning values to variables in if clauses and the like (line '55', column '17').
          Open

                  public function getStory($id = false, $pending = false) {
                      if (!$id || !$this->db) {
                          return false;
                      }
                      
          Severity: Minor
          Found in lib/News/News.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 assigning values to variables in if clauses and the like (line '90', column '17').
          Open

                  public function getStoriesFromTopic($id = false, $page = 0, $limit = 25, $total = true) {
                      if (!$id || !$this->db) {
                          return false;
                      }
                      
          Severity: Minor
          Found in lib/News/News.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 getStoriesFromTopic uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                              } else {
                                  $row['time_relative'] = $row['time'];
                              }
          Severity: Minor
          Found in lib/News/News.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 getStory uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                      } else {
                          trigger_error("News: unable to fetch story id ".$id); 
                          trigger_error($this->db->error); 
                      }
          Severity: Minor
          Found in lib/News/News.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

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

                          while ($row = $rs->fetch_assoc()) {
                              if (function_exists("relative_date")) {
                                  $row['time_relative'] = relative_date(strtotime($row['time']));
                              } else {
                                  $row['time_relative'] = $row['time'];
          Severity: Major
          Found in lib/News/News.php and 1 other location - About 3 hrs to fix
          lib/News/Archive.php on lines 105..113

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

          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 ($rs = $this->db->query($query)) {
                          $total = $this->db->query("SELECT FOUND_ROWS() AS total"); 
                          $total = $total->fetch_assoc(); 
                          
                          $return = array(); 
          Severity: Major
          Found in lib/News/News.php and 1 other location - About 1 hr to fix
          lib/Forums/Permissions.php on lines 61..92

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

                      if (is_array($topic)) {
                          $topic = implode(", ", $topic);
                      }
          Severity: Minor
          Found in lib/News/News.php and 1 other location - About 55 mins to fix
          lib/Images/ImageFactory.php on lines 213..215

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

          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

                          $return['bodytext'] = str_replace($whitespace_find, $whitespace_replace, $return['bodytext']); 
          Severity: Minor
          Found in lib/News/News.php and 1 other location - About 55 mins to fix
          lib/News/News.php on lines 61..61

          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

                          $return['hometext'] = str_replace($whitespace_find, $whitespace_replace, $return['hometext']); 
          Severity: Minor
          Found in lib/News/News.php and 1 other location - About 55 mins to fix
          lib/News/News.php on lines 62..62

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

                      if (preg_match("/(uk|europe|germany|france|spain|russia|c&s america|n america|s america|north america|south america|canada|usa|asia|africa|middle east|saudi arabia|india|pakistan|china)/i", $topic)) {
                          return new Topic("international");
                      }
          Severity: Major
          Found in lib/News/News.php and 3 other locations - About 45 mins to fix
          lib/News/News.php on lines 200..202
          lib/News/News.php on lines 204..206
          lib/News/News.php on lines 216..218

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

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

                      if (preg_match("/(asciano|pacific national|pac nat)/i", $topic)) {
                          return new Topic("asciano"); 
                      }
          Severity: Major
          Found in lib/News/News.php and 3 other locations - About 45 mins to fix
          lib/News/News.php on lines 200..202
          lib/News/News.php on lines 212..214
          lib/News/News.php on lines 216..218

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

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

                      if (preg_match("/(passenger|business|policy|infrastructure|traction & rolling stock|freight|technology|urban|high speed)/i", $topic)) {
                          return new Topic("other-rail");
                      }
          Severity: Major
          Found in lib/News/News.php and 3 other locations - About 45 mins to fix
          lib/News/News.php on lines 200..202
          lib/News/News.php on lines 204..206
          lib/News/News.php on lines 212..214

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

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

                      if (preg_match("/(aurizon)/i", $topic)) {
                          return new Topic("aurizon"); 
                      }
          Severity: Major
          Found in lib/News/News.php and 3 other locations - About 45 mins to fix
          lib/News/News.php on lines 204..206
          lib/News/News.php on lines 212..214
          lib/News/News.php on lines 216..218

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

          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

                      } else {
                          $query = "SELECT s.*, t.topicname, t.topicimage, t.topictext, t.topicid FROM nuke_stories s, nuke_topics t WHERE s.topic = t.topicid AND s.sid = '".$this->db->real_escape_string($id)."'";
                      }
          Severity: Major
          Found in lib/News/News.php and 2 other locations - About 40 mins to fix
          lib/News/News.php on lines 48..53
          lib/SiteMessage/SiteMessage.php on lines 60..66

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

          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

                      if ($pending) {
                          // Get story from pending table
                          $query = "SELECT u.username, p.qid as sid, p.uname as informant, p.subject as title, p.story as hometext, p.storyext as bodytext, p.topic, p.source, t.topicname, t.topicimage, t.topictext, p.timestamp as time FROM nuke_users u, nuke_queue p, nuke_topics t WHERE p.topic = t.topicid AND p.uid = u.user_id AND p.qid = '".$this->db->real_escape_string($id)."'";
                      } else {
                          $query = "SELECT s.*, t.topicname, t.topicimage, t.topictext, t.topicid FROM nuke_stories s, nuke_topics t WHERE s.topic = t.topicid AND s.sid = '".$this->db->real_escape_string($id)."'";
          Severity: Major
          Found in lib/News/News.php and 2 other locations - About 40 mins to fix
          lib/News/News.php on lines 51..53
          lib/SiteMessage/SiteMessage.php on lines 60..66

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

          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

                      if (preg_match("/yarratrams/i", $topic)) {
                          $topic = "tram";
                      }
          Severity: Minor
          Found in lib/News/News.php and 2 other locations - About 35 mins to fix
          lib/News/News.php on lines 176..178
          lib/News/News.php on lines 180..182

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

          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

                      if (preg_match("/tasrail/i", $topic)) {
                          $topic = "tas";
                      }
          Severity: Minor
          Found in lib/News/News.php and 2 other locations - About 35 mins to fix
          lib/News/News.php on lines 180..182
          lib/News/News.php on lines 184..186

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

          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

                      if (preg_match("/puffingbillyworkshops/i", $topic)) {
                          $topic = "narrow-gauge";
                      }
          Severity: Minor
          Found in lib/News/News.php and 2 other locations - About 35 mins to fix
          lib/News/News.php on lines 176..178
          lib/News/News.php on lines 184..186

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

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

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

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

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

          Refactorings

          Further Reading

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

                      if (!$id || !$this->db) {
                          return false;
                      }
          Severity: Minor
          Found in lib/News/News.php and 1 other location - About 30 mins to fix
          lib/News/News.php on lines 42..44

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

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

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

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

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

          Refactorings

          Further Reading

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

                      if (!$id || !$this->db) {
                          return false;
                      }
          Severity: Minor
          Found in lib/News/News.php and 1 other location - About 30 mins to fix
          lib/News/News.php on lines 83..85

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

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

                          $data['article']['url']['edit'] = sprintf("/news?mode=article.edit&id=%d", $data['article']['id']);
          Severity: Major
          Found in lib/News/News.php and 3 other locations - About 30 mins to fix
          lib/Formatting/BbcodeEtc/Filters/ImageFilter.php on lines 61..61
          lib/GTFS/AU/VIC/PTV/PTV.php on lines 341..341
          lib/Jobs/Scraper.php on lines 112..112

          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

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

                      return isset($results['matches']) ? $results['matches'] : array();
          Severity: Minor
          Found in lib/News/News.php and 1 other location - About 30 mins to fix
          lib/News/Article.php on lines 989..989

          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 $article_id is not named in camelCase.
          Open

                  public static function getArticleJSON($article_id) {
                      
                      $key = sprintf("json:railpage.news.article=%d", $article_id);
                      
                      $Memcached = AppCore::getMemcached(); 
          Severity: Minor
          Found in lib/News/News.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

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

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

          The static declaration must come after the visibility declaration
          Open

                  static public function guessTopic($topic) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Blank line found at end of control structure
          Open

                          
          Severity: Minor
          Found in lib/News/News.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/News/News.php by phpcodesniffer

          The static declaration must come after the visibility declaration
          Open

                  static public function findCorrectArticle($lookup = false, $num = 5) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (!$id || !$this->db) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 16 spaces, found 20
          Open

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

          Line indented incorrectly; expected 12 spaces, found 16
          Open

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

          Line indented incorrectly; expected 12 spaces, found 16
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 16 spaces, found 20
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (!$id || !$this->db) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (!$json = $Memcached->fetch($key)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (preg_match("/(uk|europe|germany|france|spain|russia|c&s america|n america|s america|north america|south america|canada|usa|asia|africa|middle east|saudi arabia|india|pakistan|china)/i", $topic)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if ($rs = $this->db->query($query)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 16 spaces, found 20
          Open

                              if (function_exists("relative_date")) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (!isset($data['article']['url']['edit'])) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (preg_match("/yarratrams/i", $topic)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 4 spaces, found 8
          Open

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

          Line indented incorrectly; expected 0 spaces, found 4
          Open

              class News extends Base {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 4 spaces, found 8
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (preg_match("/tasrail/i", $topic)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (is_array($topic)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if ($pending) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 4 spaces, found 8
          Open

                  public function getStoriesFromTopic($id = false, $page = 0, $limit = 25, $total = true) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 4 spaces, found 8
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (preg_match("/(asciano|pacific national|pac nat)/i", $topic)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 4 spaces, found 8
          Open

                  static public function findCorrectArticle($lookup = false, $num = 5) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 4 spaces, found 8
          Open

                  public function getStory($id = false, $pending = false) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 4 spaces, found 8
          Open

                  public static function getArticleJSON($article_id) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (!filter_var($Topic->id, FILTER_VALIDATE_INT)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 4 spaces, found 8
          Open

                  public function getPopularArticles($page = 1, $limit = 25) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (preg_match("/(passenger|business|policy|infrastructure|traction & rolling stock|freight|technology|urban|high speed)/i", $topic)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 0 spaces, found 4
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if ($rs = $this->db->query($query)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 12 spaces, found 16
          Open

                          while ($row = $rs->fetch_assoc()) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 4 spaces, found 8
          Open

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

          Line indented incorrectly; expected 4 spaces, found 8
          Open

                  static public function guessTopic($topic) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (filter_var($Topic->id, FILTER_VALIDATE_INT)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 4 spaces, found 8
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (preg_match("/puffingbillyworkshops/i", $topic)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

                      if (preg_match("/(aurizon)/i", $topic)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 8 spaces, found 12
          Open

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

          Line indented incorrectly; expected 12 spaces, found 16
          Open

                          if (empty($Article->getParagraphs()) && !empty($Article->source)) {
          Severity: Minor
          Found in lib/News/News.php by phpcodesniffer

          Line indented incorrectly; expected 4 spaces, found 8
          Open

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

          There are no issues that match your filters.

          Category
          Status