Showing 708 of 9,214 total issues
Method buildACL
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildACL($force = false) {
$Registry = Registry::getInstance();
try {
Competition
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Competition extends AppCore {
/**
* Registry key
* @since Version 3.10.0
Method getRegions
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRegions($country = false) {
$query = "SELECT COUNT(l.id) AS count, l.region_slug AS slug,
g.region_name AS name, g.region_code, g.timezone
FROM location AS l
LEFT JOIN geoplace AS g ON l.geoplace = g.id
File Locations.php
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Locations module
* @since Version 3.0
* @package Railpage
Function getWOEData
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public static function getWOEData($lookup = false, $types = false) {
if ($lookup === 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 find
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public static function find() {
$args = func_get_args();
$Loco = false;
$LocoClass = 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 getImageFromUrl
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getImageFromUrl($url = null, $option = null) {
/**
* Flickr
*/
- 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 load
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private function load($option = null) {
Debug::RecordInstance();
$this->mckey = sprintf("railpage:image=%d", $this->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 __construct
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function __construct() {
global $ZendDB, $ZendDB_ReadOnly, $PHPUnitTest;
/**
* Create the registry
- 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 render
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function render() {
if (!$this->userObject instanceof User) {
throw new InvalidArgumentException("No valid user object has been provided");
}
- 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 LatLonWoELookup
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public static function LatLonWoELookup($lat, $lon, $force = false) {
if (is_null($lon) && strpos($lat, ",") !== false) {
$tmp = explode(",", $lat);
$lat = $tmp[0];
- 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 format
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function format($userAvatar = null, $width = 100, $height = 100) {
if (is_null($userAvatar)) {
return false;
}
Method suggestLocos
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function suggestLocos(Image $imageObject, $skipTagged = null) {
$locolookup = array();
$locos = array();
Method findObjects
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function findObjects($namespace = null, $force = false) {
if (is_null($namespace)) {
throw new Exception("Parameter 1 (namespace) cannot be empty");
}
LocoClass
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class LocoClass extends Locos {
/**
* Registry cache key
* @since Version 3.9.1
Method personaliseContent
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function personaliseContent() {
$replacements = array();
Debug::LogCLI("Looping through " . count($this->recipients) . " users and preparing email decoration");
Function personaliseContent
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function personaliseContent() {
$replacements = array();
Debug::LogCLI("Looping through " . count($this->recipients) . " users and preparing email decoration");
- 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 updateFeaturedImage
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function updateFeaturedImage() {
$data = array(
"featured_photo" => $this->featured_photo_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
File CompetitionUtility.php
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Photo competition utility class
* @since Version 3.9.1
File Flickr.php
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Flickr image provider for Images
* @since Version 3.9