Showing 1,011 of 9,214 total issues
Method getPhotosForSite
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPhotosForSite($num = 10, $start = 0) {
$Place = new Place($this->lat, $this->lon);
return $Place->getPhotosFromSphinx($num);
Method GenerateTimeline
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function GenerateTimeline($dateFrom, $dateTo) {
$page = false;
$items_per_page = false;
Function getImage
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getImage($id, $force = 0) {
$params = array(
"ImageKey" => $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 EmbedGoogleMap
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function EmbedGoogleMap(DOMElement $e) {
$timer = Debug::GetTimer();
$Config = AppCore::GetConfig();
- 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 getProviders
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getProviders($region = null) {
$ritit = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__), RecursiveIteratorIterator::CHILD_FIRST);
$providers = array();
foreach ($ritit as $splFileInfo) {
- 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 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 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,
Method __construct
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
global $ZendDB, $ZendDB_ReadOnly, $PHPUnitTest;
/**
* Create the registry
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