railpage/railpagecore

View on GitHub
lib/News/Article.php

Summary

Maintainability
F
1 wk
Test Coverage

File Article.php has 543 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
    /**
     * News classes
     * @since     Version 3.0.1
     * @version   3.8.7
Severity: Major
Found in lib/News/Article.php - About 1 day to fix

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

        class Article extends Base {
            
            /**
             * Cache key to store and fetch the formatted lead text from the cache
             * @since Version 3.10.0
    Severity: Minor
    Found in lib/News/Article.php by phpmd

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

            public function commit() {
    
                $this->validate();
    
                if (function_exists("prepare_submit")) {
    Severity: Minor
    Found in lib/News/Article.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

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

            public function validate() {
                if (empty( $this->title )) {
                    throw new Exception("Validation failed: title is empty");
                }
    
    Severity: Minor
    Found in lib/News/Article.php - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method commit has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public function commit() {
    
                $this->validate();
    
                if (function_exists("prepare_submit")) {
    Severity: Major
    Found in lib/News/Article.php - About 2 hrs to fix

      Method fetch has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public function fetch($id = false) {
                  if ($id) {
                      $this->id = $id;
                  }
      
      Severity: Major
      Found in lib/News/Article.php - About 2 hrs to fix

        Function fetch has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

                public function fetch($id = false) {
                    if ($id) {
                        $this->id = $id;
                    }
        
        Severity: Minor
        Found in lib/News/Article.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 makeJSON has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function makeJSON() {
        
                    if ($this->date instanceof DateTime) {
                        $timezone = $this->date->getTimezone();
                    } else {
        Severity: Major
        Found in lib/News/Article.php - About 2 hrs to fix

          Method validate has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public function validate() {
                      if (empty( $this->title )) {
                          throw new Exception("Validation failed: title is empty");
                      }
          
          Severity: Major
          Found in lib/News/Article.php - About 2 hrs to fix

            The class Article has 29 fields. Consider redesigning Article to keep the number of fields under 15.
            Open

                class Article extends Base {
                    
                    /**
                     * Cache key to store and fetch the formatted lead text from the cache
                     * @since Version 3.10.0
            Severity: Minor
            Found in lib/News/Article.php by phpmd

            TooManyFields

            Since: 0.1

            Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

            Example

            class Person {
               protected $one;
               private $two;
               private $three;
               [... many more fields ...]
            }

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

            Method getChangelog has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public function getChangelog() {
            
                        $query = "SELECT u.username, u.user_id, u.user_avatar, s.time AS timestamp, 'Article created' AS title, '' AS args
                                    FROM nuke_stories AS s
                                    LEFT JOIN nuke_users AS u ON u.user_id = s.user_id
            Severity: Minor
            Found in lib/News/Article.php - About 1 hr to fix

              Method isDuplicate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public function isDuplicate() {
              
                          $Sphinx = $this->getSphinx();
              
                          /**
              Severity: Minor
              Found in lib/News/Article.php - About 1 hr to fix

                Method approve has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public function approve($user_id) {
                            if (!$this->id || !$this->db) {
                                return false;
                            }
                
                Severity: Minor
                Found in lib/News/Article.php - About 1 hr to fix

                  The class Article has 48 public methods and attributes. Consider reducing the number of public items to less than 45.
                  Open

                      class Article extends Base {
                          
                          /**
                           * Cache key to store and fetch the formatted lead text from the cache
                           * @since Version 3.10.0
                  Severity: Minor
                  Found in lib/News/Article.php by phpmd

                  ExcessivePublicCount

                  Since: 0.1

                  A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

                  Example

                  public class Foo {
                      public $value;
                      public $something;
                      public $var;
                      // [... more more public attributes ...]
                  
                      public function doWork() {}
                      public function doMoreWork() {}
                      public function doWorkAgain() {}
                      // [... more more public methods ...]
                  }

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

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

                          public function makeJSON() {
                  
                              if ($this->date instanceof DateTime) {
                                  $timezone = $this->date->getTimezone();
                              } else {
                  Severity: Minor
                  Found in lib/News/Article.php - About 55 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                          public function approve($user_id) {
                              if (!$this->id || !$this->db) {
                                  return false;
                              }
                  
                  Severity: Minor
                  Found in lib/News/Article.php - About 55 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  The class Article has 1149 lines of code. Current threshold is 1000. Avoid really long classes.
                  Open

                      class Article extends Base {
                          
                          /**
                           * Cache key to store and fetch the formatted lead text from the cache
                           * @since Version 3.10.0
                  Severity: Minor
                  Found in lib/News/Article.php by phpmd

                  The method validate() has an NPath complexity of 497664. The configured NPath complexity threshold is 200.
                  Open

                          public function validate() {
                              if (empty( $this->title )) {
                                  throw new Exception("Validation failed: title is empty");
                              }
                  
                  Severity: Minor
                  Found in lib/News/Article.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 commit() has 109 lines of code. Current threshold is set to 100. Avoid really long methods.
                  Open

                          public function commit() {
                  
                              $this->validate();
                  
                              if (function_exists("prepare_submit")) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpmd

                  The method makeJSON() has an NPath complexity of 512. The configured NPath complexity threshold is 200.
                  Open

                          public function makeJSON() {
                  
                              if ($this->date instanceof DateTime) {
                                  $timezone = $this->date->getTimezone();
                              } else {
                  Severity: Minor
                  Found in lib/News/Article.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 fetch() has 114 lines of code. Current threshold is set to 100. Avoid really long methods.
                  Open

                          public function fetch($id = false) {
                              if ($id) {
                                  $this->id = $id;
                              }
                  
                  Severity: Minor
                  Found in lib/News/Article.php by phpmd

                  The method commit() has an NPath complexity of 638976. The configured NPath complexity threshold is 200.
                  Open

                          public function commit() {
                  
                              $this->validate();
                  
                              if (function_exists("prepare_submit")) {
                  Severity: Minor
                  Found in lib/News/Article.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 fetch() has an NPath complexity of 1474656. The configured NPath complexity threshold is 200.
                  Open

                          public function fetch($id = false) {
                              if ($id) {
                                  $this->id = $id;
                              }
                  
                  Severity: Minor
                  Found in lib/News/Article.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 commit() has a Cyclomatic Complexity of 24. The configured cyclomatic complexity threshold is 10.
                  Open

                          public function commit() {
                  
                              $this->validate();
                  
                              if (function_exists("prepare_submit")) {
                  Severity: Minor
                  Found in lib/News/Article.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 fetch() has a Cyclomatic Complexity of 27. The configured cyclomatic complexity threshold is 10.
                  Open

                          public function fetch($id = false) {
                              if ($id) {
                                  $this->id = $id;
                              }
                  
                  Severity: Minor
                  Found in lib/News/Article.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 makeJSON() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                  Open

                          public function makeJSON() {
                  
                              if ($this->date instanceof DateTime) {
                                  $timezone = $this->date->getTimezone();
                              } else {
                  Severity: Minor
                  Found in lib/News/Article.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 validate() has a Cyclomatic Complexity of 25. The configured cyclomatic complexity threshold is 10.
                  Open

                          public function validate() {
                              if (empty( $this->title )) {
                                  throw new Exception("Validation failed: title is empty");
                              }
                  
                  Severity: Minor
                  Found in lib/News/Article.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 class Article has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13.
                  Open

                      class Article extends Base {
                          
                          /**
                           * Cache key to store and fetch the formatted lead text from the cache
                           * @since Version 3.10.0
                  Severity: Minor
                  Found in lib/News/Article.php by phpmd

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

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

                          public function __construct($id = false, $pending = false) {
                  Severity: Minor
                  Found in lib/News/Article.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 fetch has a boolean flag argument $id, which is a certain sign of a Single Responsibility Principle violation.
                  Open

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

                  Missing class import via use statement (line '511', column '40').
                  Open

                                  "weeklycounter" => new \Zend_Db_Expr('weeklycounter + 1')
                  Severity: Minor
                  Found in lib/News/Article.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

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

                  Missing class import via use statement (line '589', column '41').
                  Open

                                      $data['time'] = new \Zend_Db_Expr('NOW()');
                  Severity: Minor
                  Found in lib/News/Article.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

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

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

                          public function __construct($id = false, $pending = false) {
                  Severity: Minor
                  Found in lib/News/Article.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 commit uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $this->db->insert("nuke_stories", $dataArray);
                                  $this->id = $this->db->lastInsertId();
                              }
                  Severity: Minor
                  Found in lib/News/Article.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 reject uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $where = array( "sid = ?" => $this->id );
                  
                                  $this->db->delete("nuke_stories", $where);
                              }
                  Severity: Minor
                  Found in lib/News/Article.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 '586', column '21').
                  Open

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

                              } else {
                                  $timezone = new DateTimeZone("Australia/Melbourne");
                              }
                  Severity: Minor
                  Found in lib/News/Article.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 approve uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $this->approved = 1;
                                  $this->staff_user_id = $user_id;
                                  $this->setStaff(UserFactory::CreateUser($this->staff_user_id));
                                  $this->date = new DateTime;
                  Severity: Minor
                  Found in lib/News/Article.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 makeJSON uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                  } else {
                                      $this->url = $this->source;
                                  }
                  Severity: Minor
                  Found in lib/News/Article.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 getJSON uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  return $this->makeJSON();
                              }
                  Severity: Minor
                  Found in lib/News/Article.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 getParagraphs uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $paragraphs = empty( $this->body ) || is_null($this->body) ? $this->paragraphs : $this->blurb . "\n\n" . $this->body;
                              }
                  Severity: Minor
                  Found in lib/News/Article.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 '913', column '17').
                  Open

                          public function getJSON() {
                              if ($json = $this->Memcached->fetch(sprintf("json:railpage.news.article=%d", $this->id))) {
                                  return $json;
                              } else {
                                  return $this->makeJSON();
                  Severity: Minor
                  Found in lib/News/Article.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 fetch uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  throw new Exception(sprintf("Cannot find news article #%d", $this->id));
                              }
                  Severity: Minor
                  Found in lib/News/Article.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 '375', column '18').
                  Open

                          public function fetch($id = false) {
                              if ($id) {
                                  $this->id = $id;
                              }
                  
                  Severity: Minor
                  Found in lib/News/Article.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 '$mcexp'.
                  Open

                              $mcexp = strtotime("+1 hour");
                  Severity: Minor
                  Found in lib/News/Article.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

                                  try {
                                      if (!empty( $this->body )) {
                                          $this->body = prepare_submit($this->body);
                                      }
                      
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 3 hrs to fix
                  lib/News/Article.php on lines 631..641

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

                  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

                                  try {
                                      if (!empty( $this->blurb )) {
                                          $this->blurb = prepare_submit($this->blurb);
                                      }
                      
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 3 hrs to fix
                  lib/News/Article.php on lines 644..654

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

                  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 (RP_DEBUG) {
                                  $site_debug[] = "Railpage: " . __CLASS__ . "(" . $this->id . ") instantiated in " . round(microtime(true) - $debug_timer_start, 5) . "s";
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 2 hrs to fix
                  lib/PrivateMessages/Folder.php on lines 152..154

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

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

                              if (!$return = $this->Memcached->fetch($this->mckey)) {
                  
                                  $query = "SELECT s.*, t.topicname, t.topicimage, t.topictext, t.topicid
                                              FROM nuke_stories AS s 
                                              LEFT JOIN nuke_topics AS t ON s.topic = t.topicid
                  Severity: Major
                  Found in lib/News/Article.php and 4 other locations - About 2 hrs to fix
                  lib/Glossary/Entry.php on lines 152..158
                  lib/Organisations/Organisation.php on lines 215..220
                  lib/PrivateMessages/Message.php on lines 250..261
                  lib/Timetables/Train.php on lines 164..169

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

                  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

                                      "staff"    => array(
                                          "id"       => $this->Staff->id,
                                          "username" => $this->Staff->username,
                                          "url"      => array(
                                              "view" => $this->Staff->url instanceof Url ? $this->Staff->url->url : $this->Staff->url
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 2 hrs to fix
                  lib/News/Article.php on lines 877..883

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

                  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

                                      "author"   => array(
                                          "id"       => $this->Author->id,
                                          "username" => $this->Author->username,
                                          "url"      => array(
                                              "view" => $this->Author->url instanceof Url ? $this->Author->url->url : $this->Author->url
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 2 hrs to fix
                  lib/News/Article.php on lines 885..891

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

                  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 (empty( $this->getParagraphs() ) && !empty( $this->source )) {
                                      $this->url->url = $this->source;
                                      $this->url->canonical = $this->source;
                                  }
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/News/Article.php on lines 495..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 46.

                  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 (empty( $this->getParagraphs() ) && !empty( $this->source )) {
                                  $this->url->url = $this->source;
                                  $this->url->canonical = $this->source;
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/News/Article.php on lines 449..452

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

                  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

                                  require_once( "vendor" . DS . "scottmac" . DS . "opengraph" . DS . "OpenGraph.php" );
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/ContentUtility.php on lines 443..443

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

                  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_null($this->blurb) || !empty( $this->lead )) {
                                  $this->blurb = "";
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/News/Article.php on lines 762..764

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

                  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

                              $dataArray['bodytext'] = is_object($this->body) ? $this->body->__toString() : $this->body;
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/News/Article.php on lines 676..676

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

                  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

                              $dataArray['hometext'] = is_object($this->blurb) ? $this->blurb->__toString() : $this->blurb;
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/News/Article.php on lines 677..677

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

                  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_null($this->body) || !empty( $this->paragraphs )) {
                                  $this->body = "";
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/News/Article.php on lines 758..760

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

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

                              if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
                                  throw new Exception("Cannot make a JSON object for the requested news article beacause no valid article ID was found. Something's wrong....");
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 24 other locations - About 1 hr to fix
                  lib/Downloads/Download.php on lines 313..315
                  lib/Events/Event.php on lines 425..427
                  lib/Events/Events.php on lines 130..132
                  lib/Images/Competition.php on lines 624..626
                  lib/Images/Competition.php on lines 654..656
                  lib/Images/Competition.php on lines 823..825
                  lib/Images/Competition.php on lines 860..862
                  lib/Images/Favourites.php on lines 112..114
                  lib/Images/Favourites.php on lines 178..180
                  lib/Jobs/Classification.php on lines 80..82
                  lib/Locations/Location.php on lines 406..408
                  lib/Locations/Location.php on lines 410..412
                  lib/Locos/Locomotive.php on lines 622..624
                  lib/Locos/Locomotive.php on lines 626..628
                  lib/Locos/Locomotive.php on lines 897..899
                  lib/News/Article.php on lines 361..363
                  lib/Newsletters/Newsletters.php on lines 135..137
                  lib/PrivateMessages/Message.php on lines 244..246
                  lib/PrivateMessages/Message.php on lines 452..454
                  lib/Railcams/Photo.php on lines 330..332
                  lib/Railcams/Storage.php on lines 224..226
                  lib/Sightings/Sighting.php on lines 133..135
                  lib/Users/Group.php on lines 236..238
                  lib/Warnings/Warning.php on lines 209..211

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 32.

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

                              if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
                                  throw new Exception("Cannot fetch news article - no ID given");
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 24 other locations - About 1 hr to fix
                  lib/Downloads/Download.php on lines 313..315
                  lib/Events/Event.php on lines 425..427
                  lib/Events/Events.php on lines 130..132
                  lib/Images/Competition.php on lines 624..626
                  lib/Images/Competition.php on lines 654..656
                  lib/Images/Competition.php on lines 823..825
                  lib/Images/Competition.php on lines 860..862
                  lib/Images/Favourites.php on lines 112..114
                  lib/Images/Favourites.php on lines 178..180
                  lib/Jobs/Classification.php on lines 80..82
                  lib/Locations/Location.php on lines 406..408
                  lib/Locations/Location.php on lines 410..412
                  lib/Locos/Locomotive.php on lines 622..624
                  lib/Locos/Locomotive.php on lines 626..628
                  lib/Locos/Locomotive.php on lines 897..899
                  lib/News/Article.php on lines 834..836
                  lib/Newsletters/Newsletters.php on lines 135..137
                  lib/PrivateMessages/Message.php on lines 244..246
                  lib/PrivateMessages/Message.php on lines 452..454
                  lib/Railcams/Photo.php on lines 330..332
                  lib/Railcams/Storage.php on lines 224..226
                  lib/Sightings/Sighting.php on lines 133..135
                  lib/Users/Group.php on lines 236..238
                  lib/Warnings/Warning.php on lines 209..211

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 32.

                  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

                                  $this->topic_id = isset( $return['ForumThreadID'] ) ? intval($return['ForumThreadID']) : 0;
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 1 hr to fix
                  lib/News/Article.php on lines 392..392
                  lib/News/Article.php on lines 394..394
                  lib/News/Article.php on lines 395..395

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

                  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

                                  $this->user_id = isset( $return['user_id'] ) ? intval($return['user_id']) : 0;
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 1 hr to fix
                  lib/News/Article.php on lines 392..392
                  lib/News/Article.php on lines 395..395
                  lib/News/Article.php on lines 396..396

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

                  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

                                  $this->staff_user_id = isset( $return['staff_id'] ) ? intval($return['staff_id']) : 0;
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 1 hr to fix
                  lib/News/Article.php on lines 392..392
                  lib/News/Article.php on lines 394..394
                  lib/News/Article.php on lines 396..396

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

                  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

                                  $this->hits = isset( $return['weeklycounter'] ) ? intval($return['weeklycounter']) : 0;
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 1 hr to fix
                  lib/News/Article.php on lines 394..394
                  lib/News/Article.php on lines 395..395
                  lib/News/Article.php on lines 396..396

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

                  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

                                  "id"    => (int)str_replace(".", "", microtime(true)),
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/Railcams/Photo.php on lines 408..408

                  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

                                  $dataArray['informant'] = $this->Author instanceof User ? $this->Author->username : $this->username;
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/News/Article.php on lines 682..682

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

                                  $this->approved = isset( $return['approved'] ) ? (bool)$return['approved'] : false;
                  Severity: Major
                  Found in lib/News/Article.php and 2 other locations - About 1 hr to fix
                  lib/Forums/Post.php on lines 320..320
                  lib/News/Article.php on lines 399..399

                  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

                              } else {
                                  $where = array( "sid = ?" => $this->id );
                  
                                  $this->db->delete("nuke_stories", $where);
                              }
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/News/Article.php on lines 547..555

                  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

                              if ($this->pending) {
                                  $where = array( "qid = ?" => $this->id );
                  
                                  $this->db->delete("nuke_queue", $where);
                              } else {
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/News/Article.php on lines 551..555

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

                                  $this->sent_to_fb = isset( $return['sent_to_fb'] ) ? (bool)$return['sent_to_fb'] : false;
                  Severity: Major
                  Found in lib/News/Article.php and 2 other locations - About 1 hr to fix
                  lib/Forums/Post.php on lines 320..320
                  lib/News/Article.php on lines 398..398

                  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

                              $dataArray['user_id'] = $this->Author instanceof User ? $this->Author->id : $this->user_id;
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 1 hr to fix
                  lib/News/Article.php on lines 698..698

                  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

                                  if (!filter_var($this->staff_user_id, FILTER_VALIDATE_INT) || $this->staff_user_id == 0) {
                                      $this->staff_user_id = 72587;
                                  }
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 55 mins to fix
                  lib/Reminders/Reminder.php on lines 260..262

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

                              if (RP_DEBUG) {
                                  global $site_debug;
                                  $debug_timer_start = microtime(true);
                              }
                  Severity: Major
                  Found in lib/News/Article.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/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
                  lib/Template.php on lines 332..335

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

                                  $this->featured_image = isset( $return['featured_image'] ) ? $return['featured_image'] : false;
                  Severity: Major
                  Found in lib/News/Article.php and 5 other locations - About 55 mins to fix
                  lib/Content/Page.php on lines 151..151
                  lib/Gallery/Image.php on lines 209..209
                  lib/Gallery/Image.php on lines 210..210
                  lib/Gallery/Image.php on lines 211..211
                  lib/News/Article.php on lines 405..405

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

                                  $this->queued = isset($return['queued']) ? $return['queued'] : false;
                  Severity: Major
                  Found in lib/News/Article.php and 5 other locations - About 55 mins to fix
                  lib/Content/Page.php on lines 151..151
                  lib/Gallery/Image.php on lines 209..209
                  lib/Gallery/Image.php on lines 210..210
                  lib/Gallery/Image.php on lines 211..211
                  lib/News/Article.php on lines 400..400

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

                              if (!filter_var($this->approved)) {
                                  $this->approved = self::STATUS_UNAPPROVED;
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 4 other locations - About 55 mins to fix
                  lib/Events/Event.php on lines 262..264
                  lib/Locations/Location.php on lines 444..446
                  lib/Locos/Correction.php on lines 187..189
                  lib/Newsletters/Newsletter.php on lines 155..157

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

                              if (!$this->date instanceof DateTime) {
                                  $this->date = new DateTime;
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 13 other locations - About 50 mins to fix
                  lib/Content/Page.php on lines 172..174
                  lib/Downloads/Download.php on lines 285..287
                  lib/Gallery/Image.php on lines 177..179
                  lib/Gallery/Image.php on lines 326..328
                  lib/Glossary/Entry.php on lines 266..268
                  lib/Ideas/Idea.php on lines 252..254
                  lib/Images/Collection.php on lines 192..194
                  lib/Locations/Correction.php on lines 172..174
                  lib/Locos/Correction.php on lines 183..185
                  lib/Notifications/Notification.php on lines 187..189
                  lib/Railcams/Camera.php on lines 363..365
                  lib/Railcams/Footage.php on lines 143..145
                  lib/Warnings/Warning.php on lines 227..229

                  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 (empty($this->unique_id)) {
                                  $this->unique_id = md5($this->title); 
                              }
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 50 mins to fix
                  lib/Forums/Post.php on lines 417..419

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

                                  $this->Memcached->delete(sprintf(self::CACHE_KEY_FORMAT_LEAD, $this->id)); 
                  Severity: Major
                  Found in lib/News/Article.php and 7 other locations - About 45 mins to fix
                  lib/Events/Event.php on lines 313..313
                  lib/Forums/Post.php on lines 452..452
                  lib/Forums/Post.php on lines 453..453
                  lib/Locos/LocoClass.php on lines 1074..1074
                  lib/Locos/LocoClass.php on lines 1075..1075
                  lib/Locos/Locomotive.php on lines 694..694
                  lib/News/Article.php on lines 671..671

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

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

                                  $this->Memcached->delete(sprintf(self::CACHE_KEY_FORMAT_PARAGRAPHS, $this->id)); 
                  Severity: Major
                  Found in lib/News/Article.php and 7 other locations - About 45 mins to fix
                  lib/Events/Event.php on lines 313..313
                  lib/Forums/Post.php on lines 452..452
                  lib/Forums/Post.php on lines 453..453
                  lib/Locos/LocoClass.php on lines 1074..1074
                  lib/Locos/LocoClass.php on lines 1075..1075
                  lib/Locos/Locomotive.php on lines 694..694
                  lib/News/Article.php on lines 670..670

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

                  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

                              foreach ($dataArray as $key => $val) {
                                  $dataArray[$key] = trim($val); 
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 45 mins to fix
                  lib/Content/Page.php on lines 136..138
                  lib/Locos/LocoClass.php on lines 351..353
                  lib/Locos/Maintainers/Finder.php on lines 110..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 26.

                  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

                              $this->url = new Url($this->makePermaLink($this->slug));
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 40 mins to fix
                  lib/Locos/LocoClass.php on lines 648..648

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

                              $this->url->queue = sprintf("/news/pending?task=queue&id=%d", $this->id);
                  Severity: Major
                  Found in lib/News/Article.php and 30 other locations - About 40 mins to fix
                  lib/Content/Page.php on lines 155..155
                  lib/Events/EventDate.php on lines 161..161
                  lib/Feedback/FeedbackItem.php on lines 147..147
                  lib/Feedback/FeedbackItem.php on lines 148..148
                  lib/Feedback/FeedbackItem.php on lines 154..154
                  lib/Feedback/FeedbackItem.php on lines 155..155
                  lib/Forums/Post.php on lines 749..749
                  lib/Forums/Post.php on lines 750..750
                  lib/Forums/Post.php on lines 751..751
                  lib/Forums/Post.php on lines 752..752
                  lib/Forums/Post.php on lines 753..753
                  lib/Forums/Post.php on lines 754..754
                  lib/Forums/Post.php on lines 755..755
                  lib/Forums/Post.php on lines 756..756
                  lib/Ideas/Idea.php on lines 207..207
                  lib/Images/Camera.php on lines 131..131
                  lib/Images/Competition.php on lines 431..431
                  lib/Locos/Operator.php on lines 114..114
                  lib/Locos/Operator.php on lines 115..115
                  lib/News/Article.php on lines 481..481
                  lib/News/Article.php on lines 482..482
                  lib/News/Article.php on lines 483..483
                  lib/News/Article.php on lines 485..485
                  lib/Newsletters/Newsletter.php on lines 267..267
                  lib/Newsletters/Newsletter.php on lines 268..268
                  lib/Newsletters/Newsletter.php on lines 269..269
                  lib/Newsletters/Newsletter.php on lines 270..270
                  lib/Reminders/Reminder.php on lines 165..165
                  lib/SiteMessages/SiteMessage.php on lines 193..193
                  lib/SiteMessages/SiteMessage.php on lines 194..194

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

                              $this->url->edit = sprintf("/news?mode=article.edit&id=%d", $this->id);
                  Severity: Major
                  Found in lib/News/Article.php and 30 other locations - About 40 mins to fix
                  lib/Content/Page.php on lines 155..155
                  lib/Events/EventDate.php on lines 161..161
                  lib/Feedback/FeedbackItem.php on lines 147..147
                  lib/Feedback/FeedbackItem.php on lines 148..148
                  lib/Feedback/FeedbackItem.php on lines 154..154
                  lib/Feedback/FeedbackItem.php on lines 155..155
                  lib/Forums/Post.php on lines 749..749
                  lib/Forums/Post.php on lines 750..750
                  lib/Forums/Post.php on lines 751..751
                  lib/Forums/Post.php on lines 752..752
                  lib/Forums/Post.php on lines 753..753
                  lib/Forums/Post.php on lines 754..754
                  lib/Forums/Post.php on lines 755..755
                  lib/Forums/Post.php on lines 756..756
                  lib/Ideas/Idea.php on lines 207..207
                  lib/Images/Camera.php on lines 131..131
                  lib/Images/Competition.php on lines 431..431
                  lib/Locos/Operator.php on lines 114..114
                  lib/Locos/Operator.php on lines 115..115
                  lib/News/Article.php on lines 481..481
                  lib/News/Article.php on lines 482..482
                  lib/News/Article.php on lines 483..483
                  lib/News/Article.php on lines 484..484
                  lib/Newsletters/Newsletter.php on lines 267..267
                  lib/Newsletters/Newsletter.php on lines 268..268
                  lib/Newsletters/Newsletter.php on lines 269..269
                  lib/Newsletters/Newsletter.php on lines 270..270
                  lib/Reminders/Reminder.php on lines 165..165
                  lib/SiteMessages/SiteMessage.php on lines 193..193
                  lib/SiteMessages/SiteMessage.php on lines 194..194

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

                              $this->url->reject = sprintf("/news/pending?task=reject&id=%d", $this->id);
                  Severity: Major
                  Found in lib/News/Article.php and 30 other locations - About 40 mins to fix
                  lib/Content/Page.php on lines 155..155
                  lib/Events/EventDate.php on lines 161..161
                  lib/Feedback/FeedbackItem.php on lines 147..147
                  lib/Feedback/FeedbackItem.php on lines 148..148
                  lib/Feedback/FeedbackItem.php on lines 154..154
                  lib/Feedback/FeedbackItem.php on lines 155..155
                  lib/Forums/Post.php on lines 749..749
                  lib/Forums/Post.php on lines 750..750
                  lib/Forums/Post.php on lines 751..751
                  lib/Forums/Post.php on lines 752..752
                  lib/Forums/Post.php on lines 753..753
                  lib/Forums/Post.php on lines 754..754
                  lib/Forums/Post.php on lines 755..755
                  lib/Forums/Post.php on lines 756..756
                  lib/Ideas/Idea.php on lines 207..207
                  lib/Images/Camera.php on lines 131..131
                  lib/Images/Competition.php on lines 431..431
                  lib/Locos/Operator.php on lines 114..114
                  lib/Locos/Operator.php on lines 115..115
                  lib/News/Article.php on lines 482..482
                  lib/News/Article.php on lines 483..483
                  lib/News/Article.php on lines 484..484
                  lib/News/Article.php on lines 485..485
                  lib/Newsletters/Newsletter.php on lines 267..267
                  lib/Newsletters/Newsletter.php on lines 268..268
                  lib/Newsletters/Newsletter.php on lines 269..269
                  lib/Newsletters/Newsletter.php on lines 270..270
                  lib/Reminders/Reminder.php on lines 165..165
                  lib/SiteMessages/SiteMessage.php on lines 193..193
                  lib/SiteMessages/SiteMessage.php on lines 194..194

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

                              if (is_null($this->paragraphs)) {
                                  $this->paragraphs = "";
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 11 other locations - About 40 mins to fix
                  lib/Downloads/Download.php on lines 293..295
                  lib/Feedback/FeedbackItem.php on lines 180..182
                  lib/Forums/Post.php on lines 351..353
                  lib/Glossary/Entry.php on lines 262..264
                  lib/Locos/Date.php on lines 266..268
                  lib/Locos/WheelArrangement.php on lines 170..172
                  lib/News/Article.php on lines 770..772
                  lib/News/Article.php on lines 786..788
                  lib/PrivateMessages/Message.php on lines 302..304
                  lib/Sightings/Sighting.php on lines 239..241
                  lib/Sightings/Sighting.php on lines 243..245

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

                              $this->url->approve = sprintf("/news/pending?task=approve&id=%d", $this->id);
                  Severity: Major
                  Found in lib/News/Article.php and 30 other locations - About 40 mins to fix
                  lib/Content/Page.php on lines 155..155
                  lib/Events/EventDate.php on lines 161..161
                  lib/Feedback/FeedbackItem.php on lines 147..147
                  lib/Feedback/FeedbackItem.php on lines 148..148
                  lib/Feedback/FeedbackItem.php on lines 154..154
                  lib/Feedback/FeedbackItem.php on lines 155..155
                  lib/Forums/Post.php on lines 749..749
                  lib/Forums/Post.php on lines 750..750
                  lib/Forums/Post.php on lines 751..751
                  lib/Forums/Post.php on lines 752..752
                  lib/Forums/Post.php on lines 753..753
                  lib/Forums/Post.php on lines 754..754
                  lib/Forums/Post.php on lines 755..755
                  lib/Forums/Post.php on lines 756..756
                  lib/Ideas/Idea.php on lines 207..207
                  lib/Images/Camera.php on lines 131..131
                  lib/Images/Competition.php on lines 431..431
                  lib/Locos/Operator.php on lines 114..114
                  lib/Locos/Operator.php on lines 115..115
                  lib/News/Article.php on lines 481..481
                  lib/News/Article.php on lines 482..482
                  lib/News/Article.php on lines 484..484
                  lib/News/Article.php on lines 485..485
                  lib/Newsletters/Newsletter.php on lines 267..267
                  lib/Newsletters/Newsletter.php on lines 268..268
                  lib/Newsletters/Newsletter.php on lines 269..269
                  lib/Newsletters/Newsletter.php on lines 270..270
                  lib/Reminders/Reminder.php on lines 165..165
                  lib/SiteMessages/SiteMessage.php on lines 193..193
                  lib/SiteMessages/SiteMessage.php on lines 194..194

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

                              if (is_null($this->lead)) {
                                  $this->lead = "";
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 11 other locations - About 40 mins to fix
                  lib/Downloads/Download.php on lines 293..295
                  lib/Feedback/FeedbackItem.php on lines 180..182
                  lib/Forums/Post.php on lines 351..353
                  lib/Glossary/Entry.php on lines 262..264
                  lib/Locos/Date.php on lines 266..268
                  lib/Locos/WheelArrangement.php on lines 170..172
                  lib/News/Article.php on lines 766..768
                  lib/News/Article.php on lines 786..788
                  lib/PrivateMessages/Message.php on lines 302..304
                  lib/Sightings/Sighting.php on lines 239..241
                  lib/Sightings/Sighting.php on lines 243..245

                  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

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

                              $query = $Sphinx->select("*")
                                  ->from("idx_news_article")
                                  ->orderBy("story_time_unix", "DESC")
                                  ->where("story_time_unix", ">=", $olddate->sub(new DateInterval("P7D"))->getTimestamp())
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 40 mins to fix
                  lib/News/Base.php on lines 67..70
                  lib/News/Scraper.php on lines 232..235
                  lib/News/Topic.php on lines 266..269

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

                              $this->url->publish = sprintf("/news/pending?task=approve&id=%d", $this->id);
                  Severity: Major
                  Found in lib/News/Article.php and 30 other locations - About 40 mins to fix
                  lib/Content/Page.php on lines 155..155
                  lib/Events/EventDate.php on lines 161..161
                  lib/Feedback/FeedbackItem.php on lines 147..147
                  lib/Feedback/FeedbackItem.php on lines 148..148
                  lib/Feedback/FeedbackItem.php on lines 154..154
                  lib/Feedback/FeedbackItem.php on lines 155..155
                  lib/Forums/Post.php on lines 749..749
                  lib/Forums/Post.php on lines 750..750
                  lib/Forums/Post.php on lines 751..751
                  lib/Forums/Post.php on lines 752..752
                  lib/Forums/Post.php on lines 753..753
                  lib/Forums/Post.php on lines 754..754
                  lib/Forums/Post.php on lines 755..755
                  lib/Forums/Post.php on lines 756..756
                  lib/Ideas/Idea.php on lines 207..207
                  lib/Images/Camera.php on lines 131..131
                  lib/Images/Competition.php on lines 431..431
                  lib/Locos/Operator.php on lines 114..114
                  lib/Locos/Operator.php on lines 115..115
                  lib/News/Article.php on lines 481..481
                  lib/News/Article.php on lines 483..483
                  lib/News/Article.php on lines 484..484
                  lib/News/Article.php on lines 485..485
                  lib/Newsletters/Newsletter.php on lines 267..267
                  lib/Newsletters/Newsletter.php on lines 268..268
                  lib/Newsletters/Newsletter.php on lines 269..269
                  lib/Newsletters/Newsletter.php on lines 270..270
                  lib/Reminders/Reminder.php on lines 165..165
                  lib/SiteMessages/SiteMessage.php on lines 193..193
                  lib/SiteMessages/SiteMessage.php on lines 194..194

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

                              if (is_null($this->source)) {
                                  $this->source = "";
                              }
                  Severity: Major
                  Found in lib/News/Article.php and 11 other locations - About 40 mins to fix
                  lib/Downloads/Download.php on lines 293..295
                  lib/Feedback/FeedbackItem.php on lines 180..182
                  lib/Forums/Post.php on lines 351..353
                  lib/Glossary/Entry.php on lines 262..264
                  lib/Locos/Date.php on lines 266..268
                  lib/Locos/WheelArrangement.php on lines 170..172
                  lib/News/Article.php on lines 766..768
                  lib/News/Article.php on lines 770..772
                  lib/PrivateMessages/Message.php on lines 302..304
                  lib/Sightings/Sighting.php on lines 239..241
                  lib/Sightings/Sighting.php on lines 243..245

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

                          public function setTopic(Topic $Topic) {
                              $this->Topic = $Topic;
                  
                              return $this;
                          }
                  Severity: Major
                  Found in lib/News/Article.php and 24 other locations - About 40 mins to fix
                  lib/Feedback/Feedback.php on lines 52..56
                  lib/Gallery/Album.php on lines 279..285
                  lib/Gallery/Album.php on lines 317..323
                  lib/Gallery/Image.php on lines 278..284
                  lib/Gallery/Image.php on lines 460..466
                  lib/Glossary/Entry.php on lines 302..306
                  lib/Locations/Correction.php on lines 118..124
                  lib/Prerender/Prerender.php on lines 89..94
                  lib/Railcams/Footage.php on lines 89..95
                  lib/Railcams/Photo.php on lines 143..147
                  lib/Railcams/Storage.php on lines 95..101
                  lib/Railcams/Storage.php on lines 110..116
                  lib/SiteMessages/SiteMessage.php on lines 206..210
                  lib/Timetables/Timetables.php on lines 52..56
                  lib/Timetables/Timetables.php on lines 64..68
                  lib/Timetables/Timetables.php on lines 76..80
                  lib/Users/SockpuppetManager.php on lines 61..67
                  lib/Warnings/Warning.php on lines 249..255
                  lib/Warnings/Warning.php on lines 267..273
                  lib/AppCore.php on lines 401..407
                  lib/AppCore.php on lines 416..422
                  lib/AppCore.php on lines 431..437
                  lib/AppCore.php on lines 463..469
                  lib/AppCore.php on lines 478..484

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

                                  $this->Memcached->delete(sprintf("json:railpage.news.article=%d", $this->id));
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 40 mins to fix
                  lib/Forums/Post.php on lines 456..456
                  lib/News/Article.php on lines 667..667
                  lib/News/Article.php on lines 668..668

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

                                  $this->Redis->delete(sprintf("railpage:news.article=%s", $this->slug));
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 40 mins to fix
                  lib/Forums/Post.php on lines 456..456
                  lib/News/Article.php on lines 665..665
                  lib/News/Article.php on lines 667..667

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

                              $dataArray['geo_lat'] = empty( $this->lat ) ? 0 : $this->lat;
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 40 mins to fix
                  lib/Downloads/Download.php on lines 356..356
                  lib/News/Article.php on lines 683..683
                  lib/News/Article.php on lines 685..685

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

                                  $this->Redis->delete(sprintf("railpage:news.article=%s", $this->id));
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 40 mins to fix
                  lib/Forums/Post.php on lines 456..456
                  lib/News/Article.php on lines 665..665
                  lib/News/Article.php on lines 668..668

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

                              $params = [
                                  $this->id,
                                  $this->id,
                                  $this->id
                              ];
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 40 mins to fix
                  lib/Forums/Forum.php on lines 563..567
                  lib/Forums/Thread.php on lines 536..540
                  lib/Images/Competition.php on lines 448..452

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

                              $dataArray['geo_lon'] = empty( $this->lon ) ? 0 : $this->lon;
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 40 mins to fix
                  lib/Downloads/Download.php on lines 356..356
                  lib/News/Article.php on lines 683..683
                  lib/News/Article.php on lines 684..684

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

                              $dataArray['staff_id'] = empty( $this->staff_user_id ) ? 0 : $this->staff_user_id;
                  Severity: Major
                  Found in lib/News/Article.php and 3 other locations - About 40 mins to fix
                  lib/Downloads/Download.php on lines 356..356
                  lib/News/Article.php on lines 684..684
                  lib/News/Article.php on lines 685..685

                  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

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

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

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

                              } else {
                                  throw new Exception(sprintf("Cannot find news article #%d", $this->id));
                              }
                  Severity: Minor
                  Found in lib/News/Article.php and 2 other locations - About 40 mins to fix
                  lib/Users/User.php on lines 1212..1214
                  lib/Users/User.php on lines 1225..1227

                  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

                                      $this->db->delete("nuke_queue", array( "qid = ?" => $this->id ));
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 35 mins to fix
                  lib/Reminders/Reminder.php on lines 286..286

                  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 (!isset( $this->Author ) || !$this->Author instanceof User) {
                                  $this->Author = UserFactory::CreateUser($this->user_id);
                              }
                  Severity: Minor
                  Found in lib/News/Article.php and 2 other locations - About 30 mins to fix
                  lib/Forums/Forums.php on lines 732..734
                  lib/Notifications/Notifications.php on lines 96..98

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

                              if ($this->featured_image == "http://railindustryworker.com.au/assets/logo-artc.gif" || empty( $this->featured_image ) && stripos($this->title, "artc") !== false) {
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 30 mins to fix
                  lib/News/Article.php on lines 1110..1110

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

                              if ($this->Topic->id == 4 && stripos($this->title, "Gheringhap Sightings") !== false) {
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 30 mins to fix
                  lib/News/Article.php on lines 1106..1106

                  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

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

                  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

                              $query = $SphinxQL->select("*")
                                                ->from("idx_news_article")
                                                ->match(array("story_title", "story_paragraphs"), $title, true)
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 30 mins to fix
                  lib/Images/Utility/Finder.php on lines 775..775

                  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

                                  $line = explode("\n", $this->getLead());
                  Severity: Minor
                  Found in lib/News/Article.php and 1 other location - About 30 mins to fix
                  lib/Images/PhotoOfTheWeek.php on lines 122..122

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 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 $Topic is not named in camelCase.
                  Open

                          public function setTopic(Topic $Topic) {
                              $this->Topic = $Topic;
                  
                              return $this;
                          }
                  Severity: Minor
                  Found in lib/News/Article.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_id is not named in camelCase.
                  Open

                          public function approve($user_id) {
                              if (!$this->id || !$this->db) {
                                  return false;
                              }
                  
                  Severity: Minor
                  Found in lib/News/Article.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 end of control structure
                  Open

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

                  Blank line found at start of control structure
                  Open

                              if (isset( $return ) && is_array($return) && !empty( $return )) {
                  Severity: Minor
                  Found in lib/News/Article.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/Article.php by phpcodesniffer

                  Blank line found at start of control structure
                  Open

                              if (!$return = $this->Memcached->fetch($this->mckey)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Blank line found at start of control structure
                  Open

                              foreach ($return as $key => $val) {
                  Severity: Minor
                  Found in lib/News/Article.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/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $username;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $date;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

                                  if (empty( $return['slug'] )) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if ($this->Topic instanceof Topic) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function validate() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $hits;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $topic_id;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $blurb;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $queued = false;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 16 spaces, found 20
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (!$this->date instanceof DateTime) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $approved;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $sent_to_fb;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $slug;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $unique_id; 
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (!filter_var($user_id, FILTER_VALIDATE_INT)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 16 spaces, found 20
                  Open

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

                  Line indented incorrectly; expected 16 spaces, found 20
                  Open

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

                  Line indented incorrectly; expected 16 spaces, found 20
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $url;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $firstline;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $paragraphs;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $pending = false;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $fwlink;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (!$return = $this->Memcached->fetch($this->mckey)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function makeURLs() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

                                  } catch (Exception $e) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 0 spaces, found 4
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $blurb_clean;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function approve($user_id) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if ($user_id instanceof User) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

                                  if ($data = $this->db->fetchRow($query, $this->id)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 16 spaces, found 20
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $body;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $body_clean;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $featured_image = false;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (isset( $return ) && is_array($return) && !empty( $return )) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 16 spaces, found 20
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $Topic;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function commit() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $id;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $source;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $lat;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function reject() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $lead;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 16 spaces, found 20
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $user_id;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

                                  if (isset( $return['geo_lat'] ) && !empty( $return['geo_lat'] ) && isset( $return['geo_lon'] ) && !empty( $return['geo_lon'] )) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

                                  } catch (Exception $e) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $lon;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $title;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if ($this->Topic instanceof \Railpage\Forums\Thread) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

                                  if (!filter_var($this->staff_user_id, FILTER_VALIDATE_INT) || $this->staff_user_id == 0) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (isset($this->url->short)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $staff_username;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function viewed() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public $staff_user_id;
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

                                  try {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

                                  try {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (is_null($this->blurb) || !empty( $this->lead )) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (is_null($this->source)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function getLead() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if ($this->featured_image == "http://railindustryworker.com.au/assets/logo-artc.gif" || empty( $this->featured_image ) && stripos($this->title, "artc") !== false) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function getJSON() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 0 spaces, found 4
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (is_null($this->lead)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function getArray() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 16 spaces, found 20
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (empty( $this->title )) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function makeJSON() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function getSource() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if ($this->featured_image !== false) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (!empty( $this->username ) || $this->Author instanceof User) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function getChangelog() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if ($json = $this->Memcached->fetch(sprintf("json:railpage.news.article=%d", $this->id))) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

                                  foreach ($graph as $key => $value) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              foreach ($dataArray as $key => $val) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (!filter_var($this->approved)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (!isset( $this->Author ) || !$this->Author instanceof User) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function getParagraphs() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (empty( $this->body ) && empty( $this->paragraphs )) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              foreach ($return as $key => $val) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 16 spaces, found 20
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function guessCoverPhoto() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (is_null($this->body) || !empty( $this->paragraphs )) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function setTopic(Topic $Topic) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (empty( $this->blurb ) && empty( $this->lead )) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (is_null($this->paragraphs)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function getRelatedArticles($num = 5) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

                          public function isDuplicate() {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (empty($this->unique_id)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (!is_bool($this->queued)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 12 spaces, found 16
                  Open

                                  if ($this->url instanceof Url) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if (count($matches) || count($rejected)) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if ($olddate->format("Y-m-d") != (new DateTime)->format("Y-m-d")) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 16 spaces, found 20
                  Open

                                      if ($key == "image" && strlen($value) > 0) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 4 spaces, found 8
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if ($this->date instanceof DateTime) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

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

                  Line indented incorrectly; expected 8 spaces, found 12
                  Open

                              if ($this->Topic->id == 4 && stripos($this->title, "Gheringhap Sightings") !== false) {
                  Severity: Minor
                  Found in lib/News/Article.php by phpcodesniffer

                  There are no issues that match your filters.

                  Category
                  Status