Showing 708 of 9,214 total issues
Method commit
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function commit() {
/**
* Fill in the gaps with the new Place object
*/
Method find
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function find() {
$args = func_get_args();
$Loco = false;
$LocoClass = false;
Method parse
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse() {
if (empty($this->feeds)) {
throw new Exception("No scraped RSS data was found (hint: Consume::scrape())");
}
Method getAllForums
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllForums() {
$query = "SELECT f.*, c.*, lp.topic_id AS lastpost_topic_id, lp.poster_id AS lastpost_user_id, u.username AS lastpost_username, lp.post_time AS lastpost_time
FROM nuke_bbforums AS f
LEFT JOIN nuke_bbposts AS lp ON lp.post_id = forum_last_post_id
LEFT JOIN nuke_bbcategories AS c ON c.cat_id = f.cat_id
Method fetch
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch($id = false) {
if ($id) {
$this->id = $id;
}
Method __construct
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
global $ZendDB, $ZendDB_ReadOnly, $PHPUnitTest;
/**
* Create the registry
Method getArray
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getArray() {
$array = array(
"id" => $this->id,
"subject" => $this->subject,
"body" => $this->body,
Function validate
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function validate() {
if (empty($this->title)) {
throw new Exception("Competition title 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 lookup
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function lookup($type, $id, $activeOnly) {
$Database = (new AppCore)->getDatabaseConnection();
if ($type == "ip") {
- 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 newest
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function newest($user_id = false, $fullArray = false) {
if ($this->db instanceof \sql_db) {
if ($user_id) {
// Logged in, have they dismissed this message?
$query = "SELECT * FROM messages WHERE message_active = 1 AND message_id NOT IN (SELECT message_id FROM messages_viewed WHERE user_id = ".$this->db->real_escape_string($user_id).") ORDER BY message_id DESC LIMIT 1";
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
public function __construct() {
parent::__construct();
// If memcache is enabled, check there first
$mckey = "railpage:forums.index";
- 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 load
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load($userId = false) {
if (filter_var($userId, FILTER_VALIDATE_INT)) {
$this->id = $userId;
}
Method getPhotoLegacy
has 68 lines of code (exceeds 25 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;
}
File Notification.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* System notification object
* @since Version 3.9.1
* @package Railpage
File Forum.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Forums API
* @since Version 3.0.1
Method stories
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function stories($page = false, $limit = false) {
#if ($page == false || $limit == false) {
# return false;
#}
Method fetch
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch() {
if (!is_string($this->feed)) {
throw new Exception("Cannot fetch news articles from RSS feed because no RSS feed was provided");
}
Method getCoverImageOfObject
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getCoverImageOfObject($Object) {
if (!self::hasCoverImage($Object)) {
return false;
}
Function validate
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function validate($ignore = false) {
if (empty( $this->username )) {
throw new Exception("Username 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 validatePassword
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function validatePassword($password = false, $username = false) {
Utility\PasswordUtility::validateParameters($password, $username, $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"