railpage/railpagecore

View on GitHub
lib/Timetables/Point.php

Summary

Maintainability
C
1 day
Test Coverage

Method getTrains has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public function getTrains($from = false, $to = false) {
            if (!$from) {
                $from = new DateTime;
            } 
            
Severity: Minor
Found in lib/Timetables/Point.php - About 1 hr to fix

    Function __construct has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

            public function __construct($id = false) {
                parent::__construct(); 
                
                if (is_string($id)) {
                    $query = "SELECT id FROM timetable_points WHERE name = ? OR slug = ?"; 
    Severity: Minor
    Found in lib/Timetables/Point.php - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

            public function __construct($id = false) {
                parent::__construct(); 
                
                if (is_string($id)) {
                    $query = "SELECT id FROM timetable_points WHERE name = ? OR slug = ?"; 
    Severity: Minor
    Found in lib/Timetables/Point.php - About 1 hr to fix

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

              public function __construct($id = false) {
                  parent::__construct(); 
                  
                  if (is_string($id)) {
                      $query = "SELECT id FROM timetable_points WHERE name = ? OR slug = ?"; 
      Severity: Minor
      Found in lib/Timetables/Point.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 getTrains has a boolean flag argument $from, which is a certain sign of a Single Responsibility Principle violation.
      Open

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

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

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

                      } else {
                          $this->name = $id;
                          $this->commit();
                      }
      Severity: Minor
      Found in lib/Timetables/Point.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 '93', column '22').
      Open

              public function __construct($id = false) {
                  parent::__construct(); 
                  
                  if (is_string($id)) {
                      $query = "SELECT id FROM timetable_points WHERE name = ? OR slug = ?"; 
      Severity: Minor
      Found in lib/Timetables/Point.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 '82', column '21').
      Open

              public function __construct($id = false) {
                  parent::__construct(); 
                  
                  if (is_string($id)) {
                      $query = "SELECT id FROM timetable_points WHERE name = ? OR slug = ?"; 
      Severity: Minor
      Found in lib/Timetables/Point.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 commit uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      $this->db->insert("timetable_points", $data);
                      $this->id = $this->db->lastInsertId(); 
                  }
      Severity: Minor
      Found in lib/Timetables/Point.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

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

                  $data = array(
                      "name" => $this->name,
                      "lat" => $this->lat,
                      "lon" => $this->lon,
                      "slug" => $this->slug
      Severity: Major
      Found in lib/Timetables/Point.php and 2 other locations - About 1 hr to fix
      lib/Locos/Gauge.php on lines 178..183
      lib/Locos/WheelArrangement.php on lines 189..194

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

                      $this->url = new Url(sprintf("%s/p/%s", $this->Module->url, $this->slug));
      Severity: Major
      Found in lib/Timetables/Point.php and 11 other locations - About 1 hr to fix
      lib/Events/Event.php on lines 475..475
      lib/Events/EventCategory.php on lines 232..232
      lib/Gallery/Image.php on lines 207..207
      lib/Glossary/Entry.php on lines 227..227
      lib/Ideas/Idea.php on lines 186..186
      lib/Jobs/Job.php on lines 195..195
      lib/Jobs/Job.php on lines 315..315
      lib/Locations/Region.php on lines 149..149
      lib/Locos/Type.php on lines 106..106
      lib/Locos/Type.php on lines 133..133
      lib/News/Topic.php on lines 147..147

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

      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 (!$to) {
                      $to = new DateTime; 
                      $to->add(new DateInterval("PT120M"));
                  }
      Severity: Major
      Found in lib/Timetables/Point.php and 1 other location - About 1 hr to fix
      lib/Timetables/Timetables.php on lines 90..93

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

                      $this->url->edit = sprintf("%s?mode=point.edit", $this->url->url);
      Severity: Major
      Found in lib/Timetables/Point.php and 22 other locations - About 45 mins to fix
      lib/Chronicle/Chronicle.php on lines 42..42
      lib/Chronicle/Chronicle.php on lines 43..43
      lib/Chronicle/Chronicle.php on lines 44..44
      lib/Chronicle/Chronicle.php on lines 45..45
      lib/Chronicle/Chronicle.php on lines 46..46
      lib/Images/Competition.php on lines 150..150
      lib/Jobs/Job.php on lines 196..196
      lib/Locos/Locomotive.php on lines 432..432
      lib/Locos/Locomotive.php on lines 433..433
      lib/Railcams/Camera.php on lines 258..258
      lib/Railcams/Camera.php on lines 259..259
      lib/Railcams/Camera.php on lines 261..261
      lib/Railcams/Camera.php on lines 262..262
      lib/Railcams/Camera.php on lines 263..263
      lib/Railcams/Camera.php on lines 264..264
      lib/Railcams/Camera.php on lines 266..266
      lib/Timetables/Timetables.php on lines 41..41
      lib/Timetables/Timetables.php on lines 42..42
      lib/Timetables/Timetables.php on lines 43..43
      lib/Timetables/Train.php on lines 183..183
      lib/Users/Group.php on lines 222..222
      lib/Users/Group.php on lines 223..223

      Duplicated Code

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

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

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

      Tuning

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

                      $this->slug = isset($row['slug']) ? $row['slug'] : "";
      Severity: Major
      Found in lib/Timetables/Point.php and 2 other locations - About 45 mins to fix
      lib/News/Topic.php on lines 164..164
      lib/SiteMessages/SiteMessage.php on lines 107..107

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 25.

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

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

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

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

      Refactorings

      Further Reading

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

                      if (!isset($row['slug']) || empty($row['slug']) || substr($row['slug'], -1, 1) == "1") {
      Severity: Minor
      Found in lib/Timetables/Point.php and 1 other location - About 45 mins to fix
      lib/Users/Utility/UserUtility.php on lines 42..42

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 25.

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

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

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

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

      Refactorings

      Further Reading

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

                      if ($tmpid = $this->db->fetchOne($query, array($id, $id))) {
                          $id = $tmpid;
                      } else {
                          $this->name = $id;
                          $this->commit();
      Severity: Major
      Found in lib/Timetables/Point.php and 3 other locations - About 40 mins to fix
      lib/PrivateMessages/PrivateMessages.php on lines 245..255
      lib/SiteEvent/Base.php on lines 44..60
      lib/Users/Admin.php on lines 161..182

      Duplicated Code

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

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

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

      Tuning

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

      Line indented incorrectly; expected 4 spaces, found 8
      Open

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

      Line indented incorrectly; expected 12 spaces, found 16
      Open

                      if (!$row = getMemcacheObject($this->mckey)) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              private $slug;
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 8
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 4 spaces, found 8
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  if (empty($this->lon)) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 0 spaces, found 4
      Open

          class Point extends Timetables {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  if (filter_var($id, FILTER_VALIDATE_INT)) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 12 spaces, found 16
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              public $lon;
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 12 spaces, found 16
      Open

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

      Line indented incorrectly; expected 12 spaces, found 16
      Open

                      if ($tmpid = $this->db->fetchOne($query, array($id, $id))) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              private function validate() {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              public $lat;
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  if (isset($this->mckey)) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 0 spaces, found 4
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  if (!$to) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  if (isset($row) && count($row)) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  if (empty($this->name)) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  if (empty($this->slug)) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  if (!$from) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 4 spaces, found 8
      Open

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

      Line indented incorrectly; expected 4 spaces, found 8
      Open

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

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              public $id;
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 12 spaces, found 16
      Open

                      if (!isset($row['slug']) || empty($row['slug']) || substr($row['slug'], -1, 1) == "1") {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 8
      Open

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

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              public $name;
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              public function getTrains($from = false, $to = false) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  if (empty($this->lat)) {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 12 spaces, found 16
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 12 spaces, found 16
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 8 spaces, found 12
      Open

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

      Line indented incorrectly; expected 4 spaces, found 8
      Open

              private function createSlug() {
      Severity: Minor
      Found in lib/Timetables/Point.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 8
      Open

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

      There are no issues that match your filters.

      Category
      Status