railpage/railpagecore

View on GitHub
lib/Locos/LocoClass.php

Summary

Maintainability
F
1 wk
Test Coverage

File LocoClass.php has 590 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/** 
 * Loco database
 * @since Version 3.2
Severity: Major
Found in lib/Locos/LocoClass.php - About 1 day to fix

    LocoClass has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class LocoClass extends Locos {
        
        /**
         * Registry cache key
         * @since Version 3.9.1
    Severity: Minor
    Found in lib/Locos/LocoClass.php - About 3 hrs to fix

      The class LocoClass has 11 public methods. Consider refactoring LocoClass to keep number of public methods under 10.
      Open

      class LocoClass extends Locos {
          
          /**
           * Registry cache key
           * @since Version 3.9.1
      Severity: Minor
      Found in lib/Locos/LocoClass.php by phpmd

      TooManyPublicMethods

      Since: 0.1

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

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

      Example

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

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

      class LocoClass extends Locos {
          
          /**
           * Registry cache key
           * @since Version 3.9.1
      Severity: Minor
      Found in lib/Locos/LocoClass.php by phpmd

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

          private function fetch($recurse) {
              
              if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
                  $this->id = Utility\LocomotiveUtility::getClassId($this->id); 
              }
      Severity: Major
      Found in lib/Locos/LocoClass.php - About 3 hrs to fix

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

            private function fetch($recurse) {
                
                if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
                    $this->id = Utility\LocomotiveUtility::getClassId($this->id); 
                }
        Severity: Minor
        Found in lib/Locos/LocoClass.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 getTimeline has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getTimeline() {
                $query = "SELECT d.*, lu.loco_num, ld.loco_date_text FROM loco_unit_date AS d INNER JOIN loco_date_type AS ld ON ld.loco_date_id = d.loco_date_id INNER JOIN loco_unit AS lu ON lu.loco_id = d.loco_unit_id WHERE lu.class_id = ? ORDER BY timestamp ASC";
                
                $return = array(
                    "timeline" => array(
        Severity: Major
        Found in lib/Locos/LocoClass.php - About 2 hrs to fix

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

              public function commit() {
                  $this->validate();
                  
                  $timer = Debug::getTimer();
                  
          Severity: Major
          Found in lib/Locos/LocoClass.php - About 2 hrs to fix

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

                public function getTimeline() {
                    $query = "SELECT d.*, lu.loco_num, ld.loco_date_text FROM loco_unit_date AS d INNER JOIN loco_date_type AS ld ON ld.loco_date_id = d.loco_date_id INNER JOIN loco_unit AS lu ON lu.loco_id = d.loco_unit_id WHERE lu.class_id = ? ORDER BY timestamp ASC";
                    
                    $return = array(
                        "timeline" => array(
            Severity: Minor
            Found in lib/Locos/LocoClass.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 bulkAddLocos has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function bulkAddLocos($firstLoco = null, $lastLoco = null, $gaugeId = null, $statusId = null, $manufacturerId = null, $prefix = "") {
                    if ($firstLoco == null) {
                        throw new Exception("Cannot add locomotives to class - first loco number was not provided");
                    }
                    
            Severity: Major
            Found in lib/Locos/LocoClass.php - About 2 hrs to fix

              Method members has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function members() {
                      $query = "SELECT l.*, s.name AS loco_status, o.operator_name, ow.operator_name AS owner_name, g.*
                                  FROM loco_unit AS l 
                                  LEFT JOIN loco_status AS s ON l.loco_status_id = s.id 
                                  LEFT JOIN operators AS ow ON l.owner_id = ow.operator_id 
              Severity: Minor
              Found in lib/Locos/LocoClass.php - About 1 hr to fix

                The class LocoClass has 26 fields. Consider redesigning LocoClass to keep the number of fields under 15.
                Open

                class LocoClass extends Locos {
                    
                    /**
                     * Registry cache key
                     * @since Version 3.9.1
                Severity: Minor
                Found in lib/Locos/LocoClass.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

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

                class LocoClass extends Locos {
                    
                    /**
                     * Registry cache key
                     * @since Version 3.9.1
                Severity: Minor
                Found in lib/Locos/LocoClass.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 bulkAddLocos has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function bulkAddLocos($firstLoco = null, $lastLoco = null, $gaugeId = null, $statusId = null, $manufacturerId = null, $prefix = "") {
                        if ($firstLoco == null) {
                            throw new Exception("Cannot add locomotives to class - first loco number was not provided");
                        }
                        
                Severity: Minor
                Found in lib/Locos/LocoClass.php - About 1 hr to fix

                Cognitive Complexity

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

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

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

                Further reading

                Method bulkAddLocos has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function bulkAddLocos($firstLoco = null, $lastLoco = null, $gaugeId = null, $statusId = null, $manufacturerId = null, $prefix = "") {
                Severity: Minor
                Found in lib/Locos/LocoClass.php - About 45 mins to fix

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

                      public function commit() {
                          $this->validate();
                          
                          $timer = Debug::getTimer();
                          
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php - About 45 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      public function members() {
                          $query = "SELECT l.*, s.name AS loco_status, o.operator_name, ow.operator_name AS owner_name, g.*
                                      FROM loco_unit AS l 
                                      LEFT JOIN loco_status AS s ON l.loco_status_id = s.id 
                                      LEFT JOIN operators AS ow ON l.owner_id = ow.operator_id 
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      public function validate() {
                          if (empty($this->name)) {
                              throw new Exception("Locomotive class name cannot be empty");
                          }
                          
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  The method bulkAddLocos() has an NPath complexity of 384. The configured NPath complexity threshold is 200.
                  Open

                      public function bulkAddLocos($firstLoco = null, $lastLoco = null, $gaugeId = null, $statusId = null, $manufacturerId = null, $prefix = "") {
                          if ($firstLoco == null) {
                              throw new Exception("Cannot add locomotives to class - first loco number was not provided");
                          }
                          
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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 157 lines of code. Current threshold is set to 100. Avoid really long methods.
                  Open

                      private function fetch($recurse) {
                          
                          if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
                              $this->id = Utility\LocomotiveUtility::getClassId($this->id); 
                          }
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php by phpmd

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

                      public function commit() {
                          $this->validate();
                          
                          $timer = Debug::getTimer();
                          
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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 class LocoClass has 1243 lines of code. Current threshold is 1000. Avoid really long classes.
                  Open

                  class LocoClass extends Locos {
                      
                      /**
                       * Registry cache key
                       * @since Version 3.9.1
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php by phpmd

                  The method fetch() has an NPath complexity of 9216. The configured NPath complexity threshold is 200.
                  Open

                      private function fetch($recurse) {
                          
                          if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
                              $this->id = Utility\LocomotiveUtility::getClassId($this->id); 
                          }
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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 12. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function commit() {
                          $this->validate();
                          
                          $timer = Debug::getTimer();
                          
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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 18. The configured cyclomatic complexity threshold is 10.
                  Open

                      private function fetch($recurse) {
                          
                          if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
                              $this->id = Utility\LocomotiveUtility::getClassId($this->id); 
                          }
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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 bulkAddLocos() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                  Open

                      public function bulkAddLocos($firstLoco = null, $lastLoco = null, $gaugeId = null, $statusId = null, $manufacturerId = null, $prefix = "") {
                          if ($firstLoco == null) {
                              throw new Exception("Cannot add locomotives to class - first loco number was not provided");
                          }
                          
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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 LocoClass has a coupling between objects value of 24. Consider to reduce the number of dependencies under 13.
                  Open

                  class LocoClass extends Locos {
                      
                      /**
                       * Registry cache key
                       * @since Version 3.9.1
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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

                  Missing class import via use statement (line '702', column '22').
                  Open

                          $Event = new \Railpage\SiteEvent; 
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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 '915', column '40').
                  Open

                                      $imageObject = new \Railpage\Images\MapImage($row['meta']['position']['lat'], $row['meta']['position']['lon']);
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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 '931', column '35').
                  Open

                                      $Images = new \Railpage\Images\Images;
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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

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

                      private function fetch($recurse) {
                          
                          if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
                              $this->id = Utility\LocomotiveUtility::getClassId($this->id); 
                          }
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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 '$verb'.
                  Open

                              $verb = "Update";
                  Severity: Minor
                  Found in lib/Locos/LocoClass.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

                  Avoid unused parameters such as '$recurse'.
                  Open

                      private function fetch($recurse) {
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php by phpmd

                  UnusedFormalParameter

                  Since: 0.2

                  Avoid passing parameters to methods or constructors and then not using those parameters.

                  Example

                  class Foo
                  {
                      private function bar($howdy)
                      {
                          // $howdy is not used
                      }
                  }

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

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

                      private function createSlug() {
                          // Assume ZendDB
                          $proposal = ContentUtility::generateUrlSlug($this->name);
                          
                          $result = $this->db->fetchAll("SELECT id FROM loco_class WHERE slug = ?", $proposal); 
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 3 other locations - About 3 hrs to fix
                  lib/Help/Category.php on lines 140..151
                  lib/Ideas/Category.php on lines 142..154
                  lib/Locations/Location.php on lines 382..394

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

                  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

                              uasort($return['locos'], function ($a, $b) {
                                  return strnatcmp($a['loco_num'], $b['loco_num']); 
                              });
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 1 other location - About 1 hr to fix
                  lib/PrivateMessages/Folder.php on lines 139..141

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 50.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          if (empty($this->wheel_arrangement_id) || !filter_var($this->wheel_arrangement_id, FILTER_VALIDATE_INT)) {
                              throw new Exception("Wheel arrangement ID cannot be empty");
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 1 hr to fix
                  lib/Locos/LocoClass.php on lines 560..562
                  lib/Locos/LocoClass.php on lines 568..570

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

                  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 (empty($this->manufacturer_id) || !filter_var($this->manufacturer_id, FILTER_VALIDATE_INT)) {
                              throw new Exception("Manufacturer ID cannot be empty");
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 1 hr to fix
                  lib/Locos/LocoClass.php on lines 564..566
                  lib/Locos/LocoClass.php on lines 568..570

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

                  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 (empty($this->type_id) || !filter_var($this->type_id, FILTER_VALIDATE_INT)) {
                              throw new Exception("Locomotive type ID cannot be empty");
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 1 hr to fix
                  lib/Locos/LocoClass.php on lines 560..562
                  lib/Locos/LocoClass.php on lines 564..566

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

                  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 = $Sphinx->select("user_id", "username")
                                          ->from("idx_logs")
                                          ->match("module", "locos")
                                          ->where("key", "=", "class_id")
                                          ->where("value", "=", $this->id)
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 1 other location - About 1 hr to fix
                  lib/Locos/Locomotive.php on lines 1214..1218

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

                      public function logEvent($userId = null, $title = null, $args = null, $classId = null) {
                          if (!filter_var($userId, FILTER_VALIDATE_INT)) {
                              throw new Exception("Cannot log event, no User ID given"); 
                          }
                          
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 1 hr to fix
                  lib/Submenu.php on lines 103..153
                  lib/Template.php on lines 330..364

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 37.

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

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

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

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

                  Refactorings

                  Further Reading

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

                      public function setWheelArrangement(WheelArrangement $wheelArrangement) {
                          $this->wheel_arrangement_id = $wheelArrangement->id;
                          $this->wheel_arrangement = $wheelArrangement->arrangement;
                          
                          return $this;
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 5 other locations - About 1 hr to fix
                  lib/Locos/LocoClass.php on lines 1214..1219
                  lib/Locos/LocoClass.php on lines 1242..1247
                  lib/Locos/Locomotive.php on lines 1471..1476
                  lib/Users/Group.php on lines 190..196
                  lib/Users/Group.php on lines 205..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 36.

                  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

                      public function setManufacturer(Manufacturer $manufacturer) {
                          $this->manufacturer_id = $manufacturer->id;
                          $this->manufacturer = $manufacturer->name;
                          
                          return $this;
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 5 other locations - About 1 hr to fix
                  lib/Locos/LocoClass.php on lines 1228..1233
                  lib/Locos/LocoClass.php on lines 1242..1247
                  lib/Locos/Locomotive.php on lines 1471..1476
                  lib/Users/Group.php on lines 190..196
                  lib/Users/Group.php on lines 205..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 36.

                  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

                      public function setType(Type $locoType) {
                          $this->type_id = $locoType->id;
                          $this->type = $locoType->name;
                          
                          return $this;
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 5 other locations - About 1 hr to fix
                  lib/Locos/LocoClass.php on lines 1214..1219
                  lib/Locos/LocoClass.php on lines 1228..1233
                  lib/Locos/Locomotive.php on lines 1471..1476
                  lib/Users/Group.php on lines 190..196
                  lib/Users/Group.php on lines 205..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 36.

                  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->meta['coverimage'] = array(
                              "id" => $imageObject->id,
                              "title" => $imageObject->title,
                              "sizes" => $imageObject->sizes,
                              "url" => $imageObject->url->getURLs()
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 1 hr to fix
                  lib/Locos/Maintainers/Finder.php on lines 152..157
                  lib/Locos/Manufacturer.php on lines 218..223

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 34.

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

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

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

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

                  Refactorings

                  Further Reading

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

                              $row['url'] = Utility\LocosUtility::CreateUrl("loco", array($this->slug, $row['loco_num']));
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 1 other location - About 1 hr to fix
                  lib/Locos/LocoClass.php on lines 848..848

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 34.

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

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

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

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

                  Refactorings

                  Further Reading

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

                              $row['url'] = Utility\LocosUtility::CreateUrl("loco", array($this->slug, $row['number'])); 
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 1 other location - About 1 hr to fix
                  lib/Locos/LocoClass.php on lines 528..528

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 34.

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

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

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

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

                  Refactorings

                  Further Reading

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

                      public function addAsset($data = null) {
                          
                          return Utility\LocosUtility::addAsset($this->namespace, $this->id, $data); 
                          
                      }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 1 other location - About 1 hr to fix
                  lib/Locos/Locomotive.php on lines 1257..1261

                  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

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

                          foreach ($data as $key => $val) {
                              if (is_null($val)) {
                                  $data[$key] = "";
                              }
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 1 other location - About 1 hr to fix
                  lib/Users/User.php on lines 1726..1730

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 31.

                  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

                              $this->url->edit = sprintf("%s?mode=class.edit&id=%d", $this->Module->url, $this->id);
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 13 other locations - About 1 hr to fix
                  lib/Events/Event.php on lines 476..476
                  lib/Events/Event.php on lines 477..477
                  lib/Events/Event.php on lines 479..479
                  lib/Gallery/Album.php on lines 143..143
                  lib/Glossary/Entry.php on lines 233..233
                  lib/Glossary/Entry.php on lines 234..234
                  lib/Glossary/Entry.php on lines 235..235
                  lib/Ideas/Idea.php on lines 202..202
                  lib/Ideas/Idea.php on lines 203..203
                  lib/Ideas/Idea.php on lines 204..204
                  lib/Locos/LocoClass.php on lines 650..650
                  lib/Locos/Locomotive.php on lines 431..431
                  lib/Railcams/Photo.php on lines 166..166

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 30.

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

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

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

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

                  Refactorings

                  Further Reading

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

                              $this->url->addLoco = sprintf("%s?mode=loco.edit&class_id=%d", $this->Module->url, $this->id);
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 13 other locations - About 1 hr to fix
                  lib/Events/Event.php on lines 476..476
                  lib/Events/Event.php on lines 477..477
                  lib/Events/Event.php on lines 479..479
                  lib/Gallery/Album.php on lines 143..143
                  lib/Glossary/Entry.php on lines 233..233
                  lib/Glossary/Entry.php on lines 234..234
                  lib/Glossary/Entry.php on lines 235..235
                  lib/Ideas/Idea.php on lines 202..202
                  lib/Ideas/Idea.php on lines 203..203
                  lib/Ideas/Idea.php on lines 204..204
                  lib/Locos/LocoClass.php on lines 649..649
                  lib/Locos/Locomotive.php on lines 431..431
                  lib/Railcams/Photo.php on lines 166..166

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 30.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          $this->StatsD->target->view = sprintf("%s.%d.view", $this->namespace, $this->id);
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 3 other locations - About 1 hr to fix
                  lib/Locos/LocoClass.php on lines 476..476
                  lib/Locos/Locomotive.php on lines 505..505
                  lib/Locos/Locomotive.php on lines 506..506

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

                          $this->StatsD->target->edit = sprintf("%s.%d.view", $this->namespace, $this->id);
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 3 other locations - About 1 hr to fix
                  lib/Locos/LocoClass.php on lines 475..475
                  lib/Locos/Locomotive.php on lines 505..505
                  lib/Locos/Locomotive.php on lines 506..506

                  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 ($imageObject instanceof Asset) {
                              $this->Asset = clone $imageObject;
                              $this->commit(); 
                              
                              return $this;
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 1 hr to fix
                  lib/Locos/Locomotive.php on lines 1351..1356

                  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($classId, FILTER_VALIDATE_INT)) {
                              $classId = $this->id; 
                          }
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 55 mins to fix
                  lib/Users/User.php on lines 1973..1975

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

                      public function addOrganisation($organisationId = null, $linkType = null, $linkWeight = null) {
                          
                          if (!filter_var($organisationId, FILTER_VALIDATE_INT)) {
                              throw new Exception("Cannot add organisation to class members because no organisation ID was specified");
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 14 other locations - About 55 mins to fix
                  lib/Downloads/Download.php on lines 384..403
                  lib/Images/ImageFactory.php on lines 30..90
                  lib/Images/Images.php on lines 95..126
                  lib/Links/Category.php on lines 122..133
                  lib/Locations/Locations.php on lines 356..397
                  lib/Locos/Factory.php on lines 90..123
                  lib/Locos/Locomotive.php on lines 327..354
                  lib/Locos/Locomotive.php on lines 711..745
                  lib/Locos/Locomotive.php on lines 806..817
                  lib/Locos/Locomotive.php on lines 1118..1144
                  lib/Locos/Locos.php on lines 995..1019
                  lib/Modules/Modules.php on lines 91..112
                  lib/Notifications/Notification.php on lines 465..484
                  lib/Users/Utility/PasswordUtility.php on lines 68..96

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

                          if ($this->Asset instanceof Asset) {
                              $data['asset_id'] = $this->Asset->id;
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 50 mins to fix
                  lib/Events/Event.php on lines 297..299
                  lib/Timetables/Train.php on lines 230..232

                  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->Redis->delete(sprintf(self::CACHE_KEY, $this->slug));
                  Severity: Major
                  Found in lib/Locos/LocoClass.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/Locomotive.php on lines 694..694
                  lib/News/Article.php on lines 670..670
                  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->Redis->delete(sprintf(self::CACHE_KEY, $this->id));
                  Severity: Major
                  Found in lib/Locos/LocoClass.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 1075..1075
                  lib/Locos/Locomotive.php on lines 694..694
                  lib/News/Article.php on lines 670..670
                  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 23 locations. Consider refactoring.
                  Open

                              $this->meta = json_decode($row['meta'], true); 
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 22 other locations - About 45 mins to fix
                  lib/Assets/Asset.php on lines 150..150
                  lib/Chronicle/Entry.php on lines 156..156
                  lib/Events/Event.php on lines 207..207
                  lib/Events/EventDate.php on lines 154..154
                  lib/Gallery/Album.php on lines 136..136
                  lib/Gallery/Image.php on lines 208..208
                  lib/Ideas/Idea.php on lines 166..166
                  lib/Images/Camera.php on lines 116..116
                  lib/Images/Competition.php on lines 180..180
                  lib/Images/Competition.php on lines 790..790
                  lib/Locos/Date.php on lines 158..158
                  lib/News/Feed.php on lines 234..234
                  lib/News/Feed.php on lines 235..235
                  lib/Newsletters/Newsletter.php on lines 128..128
                  lib/Newsletters/Newsletter.php on lines 129..129
                  lib/Railcams/Storage.php on lines 201..201
                  lib/Sightings/Sighting.php on lines 161..161
                  lib/Sightings/Sighting.php on lines 162..162
                  lib/Timetables/Train.php on lines 174..174
                  lib/Users/Group.php on lines 168..168
                  lib/Users/User.php on lines 1068..1068
                  lib/SiteEvent.php on lines 135..135

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

                  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

                      public function sightings() {
                          $Sightings = new Sightings;
                          
                          return $Sightings->findLocoClass($this->id); 
                      }
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 45 mins to fix
                  lib/Locos/Locomotive.php on lines 1190..1194

                  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->namespace = sprintf("%s.%s", $this->Module->namespace, "class");
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 45 mins to fix
                  lib/Locos/Locomotive.php on lines 363..363

                  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

                                          $data['asset']['thumbnail'] = $imageObject->sizes['thumb']['source'];
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 3 other locations - About 45 mins to fix
                  lib/Locos/LocoClass.php on lines 916..916
                  lib/Locos/LocoClass.php on lines 917..917
                  lib/Locos/LocoClass.php on lines 935..935

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 25.

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

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

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

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

                  Refactorings

                  Further Reading

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

                                      $data['asset']['thumbnail'] = $imageObject->sizes['thumb']['source'];
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 3 other locations - About 45 mins to fix
                  lib/Locos/LocoClass.php on lines 916..916
                  lib/Locos/LocoClass.php on lines 935..935
                  lib/Locos/LocoClass.php on lines 936..936

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 25.

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

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

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

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

                  Refactorings

                  Further Reading

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

                                      $data['asset']['media'] = $imageObject->sizes['thumb']['source'];
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 3 other locations - About 45 mins to fix
                  lib/Locos/LocoClass.php on lines 917..917
                  lib/Locos/LocoClass.php on lines 935..935
                  lib/Locos/LocoClass.php on lines 936..936

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 25.

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

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

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

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

                  Refactorings

                  Further Reading

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

                                          $data['asset']['media'] = $imageObject->sizes['thumb']['source'];
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 3 other locations - About 45 mins to fix
                  lib/Locos/LocoClass.php on lines 916..916
                  lib/Locos/LocoClass.php on lines 917..917
                  lib/Locos/LocoClass.php on lines 936..936

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 25.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          foreach ($result as $row) {
                              $return[$row['user_id']] = $row['username'];
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 45 mins to fix
                  lib/Locos/Locomotive.php on lines 1223..1225
                  lib/Users/Base.php on lines 159..161

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 25.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          if (preg_match("@([a-zA-Z]+)@", $lastLoco)) {
                              throw new Exception("The last locomotive number provided has letters in it - the bulk add loco code doesn't support this yet");
                          }
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 45 mins to fix
                  lib/Locos/LocoClass.php on lines 966..968

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 25.

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

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

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

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

                  Refactorings

                  Further Reading

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

                              $row['flickr_tag'] = $this->flickr_tag."-".$row['loco_num'];
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 45 mins to fix
                  lib/Locations/Country.php on lines 243..243
                  lib/Locations/Region.php on lines 226..226

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 25.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          if (preg_match("@([a-zA-Z]+)@", $firstLoco)) {
                              throw new Exception("The first locomotive number provided has letters in it - the bulk add loco code doesn't support this yet");
                          }
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 45 mins to fix
                  lib/Locos/LocoClass.php on lines 974..976

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 25.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          if (isset($row['id'])) {
                              $this->id = $row['id'];
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 40 mins to fix
                  lib/Locations/Region.php on lines 164..166
                  lib/Users/User.php on lines 1074..1076

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

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

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 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

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

                          if (!isset($row) || !is_array($row)) {
                              return;
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 3 other locations - About 40 mins to fix
                  lib/Events/Event.php on lines 201..203
                  lib/Glossary/Entry.php on lines 160..162
                  lib/fwlink.php on lines 116..118

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

                          $regkey = sprintf(self::REGISTRY_KEY, $this->id); 
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 7 other locations - About 35 mins to fix
                  lib/Forums/Post.php on lines 626..626
                  lib/Forums/Post.php on lines 660..660
                  lib/Images/Camera.php on lines 207..207
                  lib/Images/Competition.php on lines 338..338
                  lib/Locos/Locomotive.php on lines 692..692
                  lib/Locos/Locomotive.php on lines 1498..1498
                  lib/Users/User.php on lines 1282..1282

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

                          if ($recurse == null) {
                              $recurse = false;
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 3 other locations - About 35 mins to fix
                  lib/Downloads/Base.php on lines 81..83
                  lib/Images/Screener.php on lines 91..93
                  lib/BanControl/BanControl.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 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 4 locations. Consider refactoring.
                  Open

                          if (isset($this->meta['coverimage'])) {
                              unset($this->meta['coverimage']);
                          }
                  Severity: Major
                  Found in lib/Locos/LocoClass.php and 3 other locations - About 35 mins to fix
                  lib/Locos/Locomotive.php on lines 1332..1334
                  lib/Users/User.php on lines 2249..2251
                  lib/Users/User.php on lines 2253..2255

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

                                  "startDate" => str_replace("-", ",", $row['timestamp']),
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 35 mins to fix
                  lib/Locos/LocoClass.php on lines 895..895

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

                                  "endDate" => str_replace("-", ",", $row['timestamp']),
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 35 mins to fix
                  lib/Locos/LocoClass.php on lines 894..894

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

                          if ($imageObject instanceof Image && $imageObject->provider == "flickr") {
                              $this->flickr_image_id = $imageObject->photo_id;
                              $this->commit(); 
                              
                              return $this;
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 30 mins to fix
                  lib/Locos/Locomotive.php on lines 1340..1345

                  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

                              $row['loco_gauge_formatted']        = $row['gauge_name']." ".$row['gauge_imperial']." (".$row['gauge_metric'].")";
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 30 mins to fix
                  lib/Locos/LocoClass.php on lines 525..525

                  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

                              $row['loco_gauge']['gauge_name']    = $row['gauge_name']."<span style='display:block;margin-top:-8px;margin-bottom:-4px;' class='gensmall'>".$row['gauge_metric']."</span>";
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 1 other location - About 30 mins to fix
                  lib/Locos/LocoClass.php on lines 526..526

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

                              try {
                                  $this->Asset = new Asset($row['asset_id']);
                              } catch (Exception $e) {
                                  global $Error; 
                                  $Error->save($e); 
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 30 mins to fix
                  lib/Locos/Locomotive.php on lines 761..771
                  lib/Users/User.php on lines 1630..1636

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

                          if (isset($row['asset_id']) && $row['asset_id'] > 0) {
                              try {
                                  $this->Asset = new Asset($row['asset_id']);
                              } catch (Exception $e) {
                                  global $Error; 
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php and 2 other locations - About 30 mins to fix
                  lib/Downloads/Download.php on lines 215..215
                  lib/Locos/Locomotive.php on lines 474..480

                  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

                  Blank line found at end of control structure
                  Open

                                  
                  Severity: Minor
                  Found in lib/Locos/LocoClass.php by phpcodesniffer

                  Blank line found at end of control structure
                  Open

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

                  Blank line found at end of control structure
                  Open

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

                  There are no issues that match your filters.

                  Category
                  Status