Showing 1,011 of 9,214 total issues
The class Forum has an overall complexity of 50 which is very high. The configured complexity threshold is 50. Open
class Forum extends Forums {
/**
* Forum status: unlocked
* @since Version 3.9.1
- Exclude checks
The class Locos has an overall complexity of 104 which is very high. The configured complexity threshold is 50. Open
class Locos extends AppCore {
/**
* Status : Operational
* @since Version 3.8.7
- Exclude checks
The class PlaceUtility has an overall complexity of 52 which is very high. The configured complexity threshold is 50. Open
class PlaceUtility {
/**
* Get WoE data for a latitude/longitude lookup
* @since Version 3.9.1
- Exclude checks
The class Camera has an overall complexity of 79 which is very high. The configured complexity threshold is 50. Open
class Camera extends Railcams {
/**
* Camera ID
* @since Version 3.4
- Exclude checks
File Flickr.php
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Flickr image provider for Images
* @since Version 3.9
Function getCategories
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function getCategories($parent = 0, $children = true) {
$parent = intval($parent);
$mckey = "railpage:links.categories.parent=" . $parent . ".children=" . (bool)$children;
- Read upRead up
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 GenerateTimeline
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function GenerateTimeline($dateFrom, $dateTo) {
$page = false;
$items_per_page = false;
- Read upRead up
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 resolveTemplate
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function resolveTemplate($template) {
if (pathinfo($template, PATHINFO_EXTENSION) == "tpl" && file_exists($template)) {
return $template;
}
- Read upRead up
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 latestPosts
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function latestPosts($is_auth_ary, $since, $limit = 10) {
if (empty($is_auth_ary) || !is_array($is_auth_ary)) {
return false;
}
- Read upRead up
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 getWeatherForecast
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getWeatherForecast($days = 14) {
return false;
$weather = false;
Method getPhotoContext
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getPhotoContext(Image $imageObject, $unapprovedOnly = null) {
$Database = (new AppCore)->getDatabaseConnection();
if ($unapprovedOnly == false || $unapprovedOnly == null) {
Method fetch
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function fetch($recurse) {
if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
$this->id = Utility\LocomotiveUtility::getClassId($this->id);
}
Method getWOEData
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getWOEData($lookup = false, $types = false) {
if ($lookup === false) {
return false;
}
Function validate
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function validate() {
if (empty( $this->title )) {
throw new Exception("Validation failed: title is empty");
}
- Read upRead up
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 latest
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function latest($number = 5, $offset = 0) {
$return = false;
$mckey = "railpage:news.latest.count=" . $number .".offset=" . $offset;
$mcexp = strtotime("+5 minutes"); // Store for five minutes
- Read upRead up
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 commit
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function commit() {
$this->validate();
if (function_exists("prepare_submit")) {
- Read upRead up
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
AppCore
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class AppCore {
/**
* Database object
* @var object $db An instance of ZendDB or sql_db representing a database connection.
File Exif.php
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* EXIF data handler
* @since Version 3.10.0
File Event.php
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Railpage Events module
* @since Version 3.8.7
Method getPhotosForSite
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPhotosForSite($num = 10, $start = 0) {
$Place = new Place($this->lat, $this->lon);
return $Place->getPhotosFromSphinx($num);