railpage/railpagecore

View on GitHub
lib/Locations/Locations.php

Summary

Maintainability
F
5 days
Test Coverage

File Locations.php has 324 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
    /**
     * Locations module 
     * @since Version 3.0
     * @package Railpage
Severity: Minor
Found in lib/Locations/Locations.php - About 3 hrs to fix

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

        class Locations extends AppCore {
            
            /**
             * Database table
             * @since Version 3.0
    Severity: Minor
    Found in lib/Locations/Locations.php by phpmd

    Function getRegions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

            public function getRegions($country = false) {
                
                $timer = Debug::GetTimer();
                
                $return = false;
    Severity: Minor
    Found in lib/Locations/Locations.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 getRegions has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public function getRegions($country = false) {
                
                $timer = Debug::GetTimer();
                
                $return = false;
    Severity: Major
    Found in lib/Locations/Locations.php - About 2 hrs to fix

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

              public function getSiteFromCoords($lat = false, $lon = false, $distance = 1, $num = 5) {
                  if (!$lat || !$lon || !$this->db) {
                      return false;
                  }
                  
      Severity: Minor
      Found in lib/Locations/Locations.php - About 1 hr to fix

        Method getSite has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function getSite($id = false, $pending = false) {
                    if (!$this->db) {
                        return false;
                    }
                    
        Severity: Minor
        Found in lib/Locations/Locations.php - About 1 hr to fix

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

                  public function nearby($lat = false, $lon = false, $radius = false) {
                      
                      if (!$lat) {
                          throw new Exception("Cannot fetch locations near co-ordinates: no latitude value given");
                      }
          Severity: Minor
          Found in lib/Locations/Locations.php - About 1 hr to fix

            Method makePermalink has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public function makePermalink($id = false) {
                        $mckey = $id ? "railpage:locations.permalink.id=" . $id : "railpage:locations.permalink.id=" . $this->id;
                        
                        $timer = Debug::GetTimer(); 
                        
            Severity: Minor
            Found in lib/Locations/Locations.php - About 1 hr to fix

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

                      public function makePermalink($id = false) {
                          $mckey = $id ? "railpage:locations.permalink.id=" . $id : "railpage:locations.permalink.id=" . $this->id;
                          
                          $timer = Debug::GetTimer(); 
                          
              Severity: Minor
              Found in lib/Locations/Locations.php - About 55 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                      public function getSite($id = false, $pending = false) {
                          if (!$this->db) {
                              return false;
                          }
                          
              Severity: Minor
              Found in lib/Locations/Locations.php - About 35 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                      public function getRegions($country = false) {
                          
                          $timer = Debug::GetTimer();
                          
                          $return = false;
              Severity: Minor
              Found in lib/Locations/Locations.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 makeRegionPermalink has a boolean flag argument $country, which is a certain sign of a Single Responsibility Principle violation.
              Open

                      public function makeRegionPermalink($country = false, $region = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function makeRegionSlug($region = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function getRegions($country = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function getIdFromSlug($slug = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function getSiteFromCoords($lat = false, $lon = false, $distance = 1, $num = 5) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function makePermalink($id = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function getSiteFromCoords($lat = false, $lon = false, $distance = 1, $num = 5) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function nearby($lat = false, $lon = false, $radius = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function makeRegionPermalink($country = false, $region = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function getSite($id = false, $pending = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function nearby($lat = false, $lon = false, $radius = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function nearby($lat = false, $lon = false, $radius = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function getLocations($region = false, $country = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function getSite($id = false, $pending = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function getLocations($region = false, $country = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

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

              Example

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

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

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

                      public function getSiteFromCoords($lat = false, $lon = false, $distance = 1, $num = 5) {
                          if (!$lat || !$lon || !$this->db) {
                              return false;
                          }
                          
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              IfStatementAssignment

              Since: 2.7.0

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

              Example

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

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

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

                              } else {
                                  $data['country'] = $this->country;
                                  $data['region'] = $this->region; 
                                  $data['slug'] = $this->slug; 
                              }
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              ElseExpression

              Since: 1.4.0

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

              Example

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

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

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

                      public function getCountries() {
                          
                          $timer = Debug::GetTimer();
                          
                          $mckey = "railpage:locations.countries";
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              IfStatementAssignment

              Since: 2.7.0

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

              Example

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

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

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

                      public function getRegions($country = false) {
                          
                          $timer = Debug::GetTimer();
                          
                          $return = false;
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              IfStatementAssignment

              Since: 2.7.0

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

              Example

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

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

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

                      public function makePermalink($id = false) {
                          $mckey = $id ? "railpage:locations.permalink.id=" . $id : "railpage:locations.permalink.id=" . $this->id;
                          
                          $timer = Debug::GetTimer(); 
                          
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              IfStatementAssignment

              Since: 2.7.0

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

              Example

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

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

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

                          } else {
                              $return = array(); 
                              
                              foreach ($this->db->fetchAll("SELECT DISTINCT country FROM location ORDER BY country") as $row) {
                                  $return[] = $row['country']; 
              Severity: Minor
              Found in lib/Locations/Locations.php by phpmd

              ElseExpression

              Since: 1.4.0

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

              Example

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

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

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

                          $mckey = "railpage:locations";
              Severity: Minor
              Found in lib/Locations/Locations.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 local variables such as '$result'.
              Open

                          $result = false;
              Severity: Minor
              Found in lib/Locations/Locations.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

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

                          foreach ($this->db->fetchAll($query, $params) as $row) {
                              $row['url'] = sprintf("%s/%s", $this->makeRegionPermalink($row['country'], $row['region']), $row['slug']);
                              $return[$row['id']] = $row; 
                          }
              Severity: Major
              Found in lib/Locations/Locations.php and 1 other location - About 3 hrs to fix
              lib/Locations/Locations.php on lines 389..392

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

              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 ($this->db->fetchAll($query, $params) as $row) {
                              $row['url'] = sprintf("%s/%s", $this->makeRegionPermalink($row['country'], $row['region']), $row['slug']);
                              $return[$row['id']] = $row; 
                          }
              Severity: Major
              Found in lib/Locations/Locations.php and 1 other location - About 3 hrs to fix
              lib/Locations/Locations.php on lines 251..254

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

              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 = "SELECT location.*, 
                                  3956 * 2 * ASIN(
                                      SQRT(
                                          POWER(
                                          SIN(
              Severity: Major
              Found in lib/Locations/Locations.php and 1 other location - About 1 hr to fix
              lib/Place.php on lines 244..247

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

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

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

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

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

              Refactorings

              Further Reading

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

                      public function __construct() {
                          parent::__construct(); 
                          
                          $this->Module = new Module("locations");
                          $this->namespace = $this->Module->namespace;
              Severity: Major
              Found in lib/Locations/Locations.php and 4 other locations - About 1 hr to fix
              lib/Events/Events.php on lines 48..53
              lib/News/Base.php on lines 44..49
              lib/Organisations/Base.php on lines 35..40
              lib/Railcams/Railcams.php on lines 30..35

              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 (!$country && isset($this->country) && !empty($this->country)) {
                              $country = $this->country;
                          }
              Severity: Major
              Found in lib/Locations/Locations.php and 2 other locations - About 1 hr to fix
              lib/Locations/Locations.php on lines 491..493
              lib/Locations/Locations.php on lines 514..516

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 34.

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

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

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

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

              Refactorings

              Further Reading

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

                          if (!$region && isset($this->region) && !empty($this->region)) {
                              $region = $this->region;
                          }
              Severity: Major
              Found in lib/Locations/Locations.php and 2 other locations - About 1 hr to fix
              lib/Locations/Locations.php on lines 495..497
              lib/Locations/Locations.php on lines 514..516

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 34.

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

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

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

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

              Refactorings

              Further Reading

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

                          if (!$region && isset($this->region) && !empty($this->region)) {
                              $region = $this->region;
                          }
              Severity: Major
              Found in lib/Locations/Locations.php and 2 other locations - About 1 hr to fix
              lib/Locations/Locations.php on lines 491..493
              lib/Locations/Locations.php on lines 495..497

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

                          if (count($args)) {
                              $query .= " WHERE ".implode(" AND ", $args); 
                          }
              Severity: Major
              Found in lib/Locations/Locations.php and 3 other locations - About 1 hr to fix
              lib/GTFS/AU/VIC/PTV/PTV.php on lines 258..260
              lib/Images/Utility/Geoplace.php on lines 92..94
              lib/Jobs/Jobs.php on lines 100..102

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 33.

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

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

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

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

              Refactorings

              Further Reading

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

                      public function getSiteFromCoords($lat = false, $lon = false, $distance = 1, $num = 5) {
                          if (!$lat || !$lon || !$this->db) {
                              return false;
                          }
                          
              Severity: Major
              Found in lib/Locations/Locations.php and 1 other location - About 1 hr to fix
              lib/Forums/Forums.php on lines 416..491

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 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 15 locations. Consider refactoring.
              Open

                      public function nearby($lat = false, $lon = false, $radius = false) {
                          
                          if (!$lat) {
                              throw new Exception("Cannot fetch locations near co-ordinates: no latitude value given");
                          }
              Severity: Major
              Found in lib/Locations/Locations.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/Locos/Factory.php on lines 90..123
              lib/Locos/LocoClass.php on lines 1038..1061
              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 2 locations. Consider refactoring.
              Open

                          if (!$lat || !$lon || !$this->db) {
                              return false;
                          }
              Severity: Minor
              Found in lib/Locations/Locations.php and 1 other location - About 50 mins to fix
              lib/Links/Links.php on lines 160..162

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

                          $return = $this->db->fetchAll($query, array($country, $region));
              Severity: Major
              Found in lib/Locations/Locations.php and 3 other locations - About 45 mins to fix
              lib/Forums/Stats.php on lines 96..96
              lib/Forums/Thread.php on lines 223..223
              lib/Sightings/Sightings.php on lines 41..41

              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

                              Debug::LogEvent(__METHOD__ . "(" . $country . ")", $timer);
              Severity: Major
              Found in lib/Locations/Locations.php and 2 other locations - About 45 mins to fix
              lib/Images/Image.php on lines 1208..1208
              lib/Locations/Locations.php on lines 163..163

              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

                          Debug::LogEvent(__METHOD__ . "(" . $country . ")", $timer);
              Severity: Major
              Found in lib/Locations/Locations.php and 2 other locations - About 45 mins to fix
              lib/Images/Image.php on lines 1208..1208
              lib/Locations/Locations.php on lines 129..129

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 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 22 locations. Consider refactoring.
              Open

                              $this->Memcached->save($mckey, $return, strtotime("+1 day"));
              Severity: Major
              Found in lib/Locations/Locations.php and 21 other locations - About 40 mins to fix
              lib/Chronicle/Chronicle.php on lines 119..119
              lib/Config/Base.php on lines 40..40
              lib/Config/Base.php on lines 111..111
              lib/Downloads/Download.php on lines 530..530
              lib/Glossary/Glossary.php on lines 107..107
              lib/Images/Images.php on lines 110..110
              lib/Links/Links.php on lines 94..94
              lib/Links/Links.php on lines 129..129
              lib/Locations/Country.php on lines 179..179
              lib/Locations/Country.php on lines 180..180
              lib/Locations/Location.php on lines 811..811
              lib/Locations/Locations.php on lines 127..127
              lib/Locations/Locations.php on lines 161..161
              lib/Locations/Locations.php on lines 474..474
              lib/Locos/Locomotive.php on lines 1227..1227
              lib/Locos/Locomotive.php on lines 1538..1538
              lib/Locos/Locos.php on lines 238..238
              lib/PrivateMessages/Folder.php on lines 259..259
              lib/Users/Base.php on lines 82..82
              lib/Users/Timeline.php on lines 241..241
              lib/Place.php on lines 600..600

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

                              $this->Memcached->save($mckey, $return, strtotime("+1 day"));
              Severity: Major
              Found in lib/Locations/Locations.php and 21 other locations - About 40 mins to fix
              lib/Chronicle/Chronicle.php on lines 119..119
              lib/Config/Base.php on lines 40..40
              lib/Config/Base.php on lines 111..111
              lib/Downloads/Download.php on lines 530..530
              lib/Glossary/Glossary.php on lines 107..107
              lib/Images/Images.php on lines 110..110
              lib/Links/Links.php on lines 94..94
              lib/Links/Links.php on lines 129..129
              lib/Locations/Country.php on lines 179..179
              lib/Locations/Country.php on lines 180..180
              lib/Locations/Location.php on lines 811..811
              lib/Locations/Locations.php on lines 76..76
              lib/Locations/Locations.php on lines 161..161
              lib/Locations/Locations.php on lines 474..474
              lib/Locos/Locomotive.php on lines 1227..1227
              lib/Locos/Locomotive.php on lines 1538..1538
              lib/Locos/Locos.php on lines 238..238
              lib/PrivateMessages/Folder.php on lines 259..259
              lib/Users/Base.php on lines 82..82
              lib/Users/Timeline.php on lines 241..241
              lib/Place.php on lines 600..600

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

                          $this->Memcached->save($mckey, $return, strtotime("+1 day"));
              Severity: Major
              Found in lib/Locations/Locations.php and 21 other locations - About 40 mins to fix
              lib/Chronicle/Chronicle.php on lines 119..119
              lib/Config/Base.php on lines 40..40
              lib/Config/Base.php on lines 111..111
              lib/Downloads/Download.php on lines 530..530
              lib/Glossary/Glossary.php on lines 107..107
              lib/Images/Images.php on lines 110..110
              lib/Links/Links.php on lines 94..94
              lib/Links/Links.php on lines 129..129
              lib/Locations/Country.php on lines 179..179
              lib/Locations/Country.php on lines 180..180
              lib/Locations/Location.php on lines 811..811
              lib/Locations/Locations.php on lines 76..76
              lib/Locations/Locations.php on lines 127..127
              lib/Locations/Locations.php on lines 474..474
              lib/Locos/Locomotive.php on lines 1227..1227
              lib/Locos/Locomotive.php on lines 1538..1538
              lib/Locos/Locos.php on lines 238..238
              lib/PrivateMessages/Folder.php on lines 259..259
              lib/Users/Base.php on lines 82..82
              lib/Users/Timeline.php on lines 241..241
              lib/Place.php on lines 600..600

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

                              $this->Memcached->save($mckey, $string, strtotime("+1 year"));
              Severity: Major
              Found in lib/Locations/Locations.php and 21 other locations - About 40 mins to fix
              lib/Chronicle/Chronicle.php on lines 119..119
              lib/Config/Base.php on lines 40..40
              lib/Config/Base.php on lines 111..111
              lib/Downloads/Download.php on lines 530..530
              lib/Glossary/Glossary.php on lines 107..107
              lib/Images/Images.php on lines 110..110
              lib/Links/Links.php on lines 94..94
              lib/Links/Links.php on lines 129..129
              lib/Locations/Country.php on lines 179..179
              lib/Locations/Country.php on lines 180..180
              lib/Locations/Location.php on lines 811..811
              lib/Locations/Locations.php on lines 76..76
              lib/Locations/Locations.php on lines 127..127
              lib/Locations/Locations.php on lines 161..161
              lib/Locos/Locomotive.php on lines 1227..1227
              lib/Locos/Locomotive.php on lines 1538..1538
              lib/Locos/Locos.php on lines 238..238
              lib/PrivateMessages/Folder.php on lines 259..259
              lib/Users/Base.php on lines 82..82
              lib/Users/Timeline.php on lines 241..241
              lib/Place.php on lines 600..600

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

                                      "date" => array(
                                          "added" => $row['date_added'],
                                          "closed" => $row['date_closed']
                                      )
              Severity: Major
              Found in lib/Locations/Locations.php and 4 other locations - About 40 mins to fix
              lib/Feedback/Feedback.php on lines 88..91
              lib/Feedback/Feedback.php on lines 92..95
              lib/Timetables/Timetables.php on lines 138..141
              lib/Place.php on lines 511..514

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 24.

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

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

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

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

              Refactorings

              Further Reading

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

                              $string = strtolower(vsprintf("%s/%s/%s/%s", $params));
              Severity: Major
              Found in lib/Locations/Locations.php and 2 other locations - About 40 mins to fix
              lib/Locos/Locomotive.php on lines 1528..1528
              lib/Locos/Utility/LocosUtility.php on lines 104..104

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 24.

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

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

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

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

              Refactorings

              Further Reading

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

                          if ($id) {
                              $args[]     = "location.id = ?";
                              $params[]   = $id;
                          }
              Severity: Minor
              Found in lib/Locations/Locations.php and 2 other locations - About 40 mins to fix
              lib/Jobs/Jobs.php on lines 87..90
              lib/Jobs/Jobs.php on lines 92..95

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

                      public function getPending() {
                          
                          $query = "SELECT l.*, u.username 
                                  FROM location AS l 
                                  INNER JOIN nuke_users AS u ON u.user_id = l.user_id 
              Severity: Major
              Found in lib/Locations/Locations.php and 14 other locations - About 35 mins to fix
              lib/Images/Competitions.php on lines 332..341
              lib/Images/Screener.php on lines 258..269
              lib/Images/Statistics.php on lines 93..104
              lib/Images/Statistics.php on lines 112..133
              lib/Images/Statistics.php on lines 141..147
              lib/Images/Statistics.php on lines 155..170
              lib/Images/Statistics.php on lines 250..256
              lib/Images/Statistics.php on lines 264..270
              lib/Links/Links.php on lines 227..231
              lib/Locations/Locations.php on lines 531..535
              lib/Locos/Liveries/Liveries.php on lines 86..96
              lib/Users/Admin.php on lines 34..39
              lib/Users/Base.php on lines 234..238
              lib/Users/Base.php on lines 271..283

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

                      public function getDateTypes() {
                          $query = "SELECT * FROM location_datetypes ORDER BY name";
                          
                          return $this->db->fetchAll($query);
                      }
              Severity: Major
              Found in lib/Locations/Locations.php and 14 other locations - About 35 mins to fix
              lib/Images/Competitions.php on lines 332..341
              lib/Images/Screener.php on lines 258..269
              lib/Images/Statistics.php on lines 93..104
              lib/Images/Statistics.php on lines 112..133
              lib/Images/Statistics.php on lines 141..147
              lib/Images/Statistics.php on lines 155..170
              lib/Images/Statistics.php on lines 250..256
              lib/Images/Statistics.php on lines 264..270
              lib/Links/Links.php on lines 227..231
              lib/Locations/Locations.php on lines 204..213
              lib/Locos/Liveries/Liveries.php on lines 86..96
              lib/Users/Admin.php on lines 34..39
              lib/Users/Base.php on lines 234..238
              lib/Users/Base.php on lines 271..283

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

                          if ($return = $this->Memcached->fetch($mckey)) {
                              return $return;
                          }
              Severity: Major
              Found in lib/Locations/Locations.php and 8 other locations - About 30 mins to fix
              lib/Chronicle/Chronicle.php on lines 105..107
              lib/Links/Links.php on lines 40..42
              lib/Locations/Location.php on lines 722..724
              lib/Locos/Locomotive.php on lines 1206..1208
              lib/Locos/Locomotive.php on lines 1500..1502
              lib/Users/Timeline.php on lines 209..211
              lib/Place.php on lines 383..385
              lib/Place.php on lines 482..484

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 20.

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

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

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

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

              Refactorings

              Further Reading

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

                                  str_replace(" ", "-", $data['country']), 
              Severity: Minor
              Found in lib/Locations/Locations.php and 1 other location - About 30 mins to fix
              lib/Locations/Locations.php on lines 468..468

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 20.

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

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

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

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

              Refactorings

              Further Reading

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

                                  str_replace(" ", "-", $data['region']), 
              Severity: Minor
              Found in lib/Locations/Locations.php and 1 other location - About 30 mins to fix
              lib/Locations/Locations.php on lines 467..467

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 20.

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

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

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

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

              Refactorings

              Further Reading

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

                                  $woe = Place::getWOEData(strtoupper($row['region']));
              Severity: Minor
              Found in lib/Locations/Locations.php and 1 other location - About 30 mins to fix
              lib/News/Topic.php on lines 232..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 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

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

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

              Blank line found at start of control structure
              Open

                              foreach ($this->db->fetchAll("SELECT DISTINCT region FROM location WHERE country = ? AND active = 1 ORDER BY region ASC", $country) as $row) {
              Severity: Minor
              Found in lib/Locations/Locations.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/Locations/Locations.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/Locations/Locations.php by phpcodesniffer

              Inline control structures are not allowed
              Open

                          if ($region) $mckey .= ".region=" . $region; 
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Inline control structures are not allowed
              Open

                          if ($country) $mckey .= ".country=" . $country;
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 16
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function nearby($lat = false, $lon = false, $radius = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (!$lon) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function getDateTypes() {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 16 spaces, found 20
              Open

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

              Line indented incorrectly; expected 12 spaces, found 16
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (!$lat) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public $photoRadius = 1; 
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (!$region) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 12 spaces, found 16
              Open

                              foreach ($this->db->fetchAll("SELECT DISTINCT region FROM location WHERE country = ? AND active = 1 ORDER BY region ASC", $country) as $row) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          foreach ($this->db->fetchAll($query, Correction::STATUS_NEW) as $row) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (count($return) && $id) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function newest($limit = 5) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 12 spaces, found 16
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function makeRegionSlug($region = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function getCountries() {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 16 spaces, found 20
              Open

                                  if (isset($woe['places']['place'][0])) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 12 spaces, found 16
              Open

                              if (empty($row['country'])) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 16
              Open

                              if (empty($return[$row['country']]['woe']['country'])) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (!$region || !$country) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (!$region || !$country) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 0 spaces, found 4
              Open

                  class Locations extends AppCore {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 12 spaces, found 20
              Open

                                  if (isset($woe['places']['place'][0])) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          foreach ($this->db->fetchAll($query) as $row) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 12 spaces, found 16
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function getSiteFromCoords($lat = false, $lon = false, $distance = 1, $num = 5) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 16 spaces, found 20
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 12 spaces, found 16
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function getOpenCorrections() {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 12 spaces, found 20
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function getPending() {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (!$radius) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (!$slug || empty($slug)) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 12 spaces, found 16
              Open

                              if (!empty($row['desc']) && strlen($row['desc']) > 5) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 12 spaces, found 16
              Open

                              foreach ($this->db->fetchAll("SELECT DISTINCT country FROM location ORDER BY country") as $row) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function getIdFromSlug($slug = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 12 spaces, found 16
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function __construct() {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function getRegions($country = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public $table = "location";
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          foreach ($this->db->fetchAll($query) as $row) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function getLocations($region = false, $country = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 12 spaces, found 16
              Open

                              if ((!isset($this->country) || !isset($this->region) || !isset($this->slug)) && $id) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (!$region && isset($this->region) && !empty($this->region)) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          foreach ($this->db->fetchAll($query, $params) as $row) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 12 spaces, found 16
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (count($args)) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (!$region && isset($this->region) && !empty($this->region)) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          if (!$country && isset($this->country) && !empty($this->country)) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function getRandomLocation() {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 8 spaces, found 12
              Open

                          foreach ($this->db->fetchAll($query, $params) as $row) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 16 spaces, found 20
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

                      public function makeRegionPermalink($country = false, $region = false) {
              Severity: Minor
              Found in lib/Locations/Locations.php by phpcodesniffer

              Line indented incorrectly; expected 8 spaces, found 12
              Open

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

              Line indented incorrectly; expected 4 spaces, found 8
              Open

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

              Line indented incorrectly; expected 0 spaces, found 4
              Open

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

              There are no issues that match your filters.

              Category
              Status