Showing 708 of 9,214 total issues
File User.php
has 1132 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Base user class
* @since Version 3.0.1
File Image.php
has 823 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Store and fetch image data from our local database
*
Function populate
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
public function populate($force = false, $option = null) {
if ($force === false && !$this->isStale()) {
return $this;
}
- 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 findObjects
has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring. Open
public function findObjects($namespace = null, $force = false) {
if (is_null($namespace)) {
throw new Exception("Parameter 1 (namespace) cannot be 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
File Competition.php
has 654 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Photo competition!
* @since Version 3.9.1
File Locomotive.php
has 649 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Loco database
* @since Version 3.2
File Forums.php
has 648 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Forums API
* @since Version 3.0.1
File LocoClass.php
has 590 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Loco database
* @since Version 3.2
Function suggestLocos
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
public static function suggestLocos(Image $imageObject, $skipTagged = null) {
$locolookup = array();
$locos = array();
- 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 populate
has 239 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function populate($force = false, $option = null) {
if ($force === false && !$this->isStale()) {
return $this;
}
Function getPhotoLegacy
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
public function getPhotoLegacy($photo_id = false) {
if (!$photo_id) {
throw new Exception("Cannot fetch photo info and sizes - no photo 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
Function __construct
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($user = false) {
if (!$user || !($user instanceof \Railpage\Users\User)) {
throw new \Exception("Cannot instantiate " . __CLASS__ . "::" . __FUNCTION__ . " - no \$user object 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
File Article.php
has 543 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* News classes
* @since Version 3.0.1
* @version 3.8.7
Function parse
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
public function parse() {
if (empty($this->feeds)) {
throw new Exception("No scraped RSS data was found (hint: Consume::scrape())");
}
- 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 53 (exceeds 5 allowed). Consider refactoring. Open
public function load() {
$photodata = $this->Provider->getPhoto($this->id);
$this->title = $photodata['title'];
$this->description = $photodata['description'];
- 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 Locos.php
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Loco database
* @since Version 3.2
Function buildACL
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
public function buildACL($force = false) {
$Registry = Registry::getInstance();
try {
- 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
User
has 51 functions (exceeds 20 allowed). Consider refactoring. Open
class User extends Base {
/**
* Registry cache key
* @since Version 3.9.1
Locos
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
class Locos extends AppCore {
/**
* Status : Operational
* @since Version 3.8.7
File Finder.php
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Find images
* @since Version 3.9.1