Showing 708 of 9,214 total issues
Function __construct
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($category_id = false, $recurse = true) {
parent::__construct();
if (filter_var($category_id, FILTER_VALIDATE_INT)) {
$this->id = $category_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 fetchOld
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function fetchOld() {
if (!is_string($this->feed)) {
throw new Exception("Cannot fetch jobs from RSS feed because no RSS feed was 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 fetch
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function fetch() {
if (empty($this->id)) {
throw new Exception("Cannot fetch download object - no download ID given");
}
- 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 unBanUser
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function unBanUser($banId, $userId = null) {
$success = false;
/**
* Empty the cache
- 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 available_themes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function available_themes() {
$theme_dir = dirname(__DIR__) . DS . "themes";
$themes = 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
Function CreateCamera
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function CreateCamera($id) {
$Database = AppCore::GetDatabase();
$Memcached = AppCore::GetMemcached();
$Redis = AppCore::getRedis();
- 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 validate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function validate() {
if (!$this->Date instanceof DateTime && empty($this->Date)) {
$this->Date = new DateTime;
}
- 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 generateSrcSet
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function generateSrcSet(Image $imageObject) {
$sources = array();
$widths = 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
Function validate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function validate() {
if (!filter_var($this->lat, FILTER_VALIDATE_FLOAT)) {
throw new Exception("Cannot validate location - no latitude value");
}
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($code) {
parent::__construct();
$this->code = $code;
- 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 getUnread
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getUnread() {
if (!$this->User->id) {
throw new Exception("Cannot fetch unread PMs - not a registered user");
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 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($postid = false) {
$post_timer_start = Debug::GetTimer();
parent::__construct();
- 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 validate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function validate() {
if (empty($this->name)) {
throw new Exception("Name 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
Function get_permission
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function get_permission($permission_name = false, $permissions_object = false) {
if ($permissions_object) {
$this->permissions = $permissions_object;
}
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct() {
parent::__construct();
foreach (func_get_args() as $arg) {
if (filter_var($arg, FILTER_VALIDATE_INT) || is_array($arg)) {
- 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 getPhoto
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPhoto($image) {
if (is_array($image) && !isset($image['status'])) {
$query = "SELECT * FROM image_competition_submissions WHERE competition_id = ? AND image_id = ? ORDER BY date_added DESC";
$params = array(
Method getFilteredForums
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getFilteredForums() {
$timer = Debug::GetTimer();
if (!isset($this->User->Guest) || !$this->User->Guest instanceof User) {
Method setUserFavourite
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUserFavourite() {
/**
* Because I'll no doubt get confused - frequently - at the order of parameters,
* let's just be a sneaky bastard and check each parameter
Method sendNotification
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function sendNotification(Competition $photoComp, $notificationOptions) {
if (count((new Competitions)->getPreviousContestants()) == 0) {
return false;
}
Method getLeagueTable
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLeagueTable() {
/**
SELECT
s.user_id, u.username, c.title AS comp_title, c.id AS comp_id, c.slug AS comp_slug,
s.image_id, i.meta AS image_meta,