Showing 708 of 9,214 total issues
Function format
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public static function format($userAvatar = null, $width = 100, $height = 100) {
if (is_null($userAvatar)) {
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
File Camera.php
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Railcam object
* @since Version 3.4
File Place.php
has 419 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Where on Earth is this place?
* Geolookup
File Location.php
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Locations module
* @since Version 3.0
* @package Railpage
Locomotive
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class Locomotive extends Locos {
/**
* Registry cache key
* @since Version 3.9.1
File Post.php
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Forums API
* @since Version 3.0.1
File BanControl.php
has 404 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Ban controller
* @since Version 3.2
File AppCore.php
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Railpage AppCore
* @since Version 3.7
Function stories
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function stories($page = false, $limit = false) {
#if ($page == false || $limit == false) {
# 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
Function getReadTopics
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function getReadTopics($user_id = false) {
global $Error;
if (!$user_id) {
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
File Download.php
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Downloads
* @since Version 3.0
Function createOtherSizes
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public static function createOtherSizes() {
$sleep = 2;
$sleep = 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 generate
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function generate() {
$string = '';
global $handheld;
- 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 process
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
private function process(array $item) {
/**
* Process the description field
*/
- 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 makeQuery
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private static function makeQuery() {
$basequery = "SELECT SQL_CALC_FOUND_ROWS image.*, g.country_code, g.country_name, g.region_code,
g.region_name, g.neighbourhood, g.timezone, X(g.point) AS geoplace_lat, Y(g.point) AS geoplace_lon
FROM image
- 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 deleteObjects
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function deleteObjects($object_id = false) {
if (!$object_id) {
//throw new Exception("Cannot delete objects - no object ID given");
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 commit
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function commit() {
if (empty($this->bbcode_uid)) {
$this->bbcode_uid = crc32($this->text);
}
File Thread.php
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Forums API
* @since Version 3.0.1
Method createOtherSizes
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createOtherSizes() {
$sleep = 2;
$sleep = false;
Method render
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render() {
if (!$this->userObject instanceof User) {
throw new InvalidArgumentException("No valid user object has been provided");
}