Showing 708 of 9,214 total issues
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 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 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);
Method commit
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function commit() {
$this->validate();
if (function_exists("prepare_submit")) {
Method GenerateTimeline
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function GenerateTimeline($dateFrom, $dateTo) {
$page = false;
$items_per_page = false;
Function getImage
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getImage($id, $force = 0) {
$params = array(
"ImageKey" => $id
);
- 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 EmbedGoogleMap
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function EmbedGoogleMap(DOMElement $e) {
$timer = Debug::GetTimer();
$Config = AppCore::GetConfig();
- 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 getProviders
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getProviders($region = null) {
$ritit = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__), RecursiveIteratorIterator::CHILD_FIRST);
$providers = array();
foreach ($ritit as $splFileInfo) {
- 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"