Showing 1,011 of 9,214 total issues
Method getLatestPostRatings
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLatestPostRatings($limit = 10) {
$query = "SELECT r.*, u.username, t.topic_title, f.forum_name, p.poster_id
FROM nuke_bbposts_reputation AS r
LEFT JOIN nuke_users AS u ON r.user_id = u.user_id
LEFT JOIN nuke_bbposts AS p ON r.post_id = p.post_id
Method getCategories
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCategories($parent = 0, $children = true) {
$parent = intval($parent);
$mckey = "railpage:links.categories.parent=" . $parent . ".children=" . (bool)$children;
Method NominateImage
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function NominateImage(Image $imageObject, DateTime $dateWeek, User $userObject) {
$query = "SELECT id FROM image_weekly WHERE datefrom = ?";
if ($this->db->fetchOne($query, $dateWeek->format("Y-m-d"))) {
Method findArticles
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function findArticles($offset = 0, $limit = 25, $orderby = "story_time_unix") {
if (empty($this->filter_topics) || empty($this->filter_words)) {
$this->getFilters();
}
Method setPushSubscription
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setPushSubscription(User $User, $subscription, $enabled = null) {
$endpoint = false;
$registration_id = false;
$provider = false;
Method getAddress
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAddress() {
$mckey = sprintf("railpage.place.address.lat=%s&lon=%s", $this->lat, $this->lon);
if ($address = $this->Memcached->fetch($mckey)) {
Method getExifIDs
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getExifIDs($exif) {
$required = [
"camera_make",
"camera_model",
Method populate
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function populate() {
$this->mckey = sprintf("railpage:gallery.album.image=%d", $this->id);
if (!$row = $this->Memcached->fetch($this->mckey)) {
Method __construct
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function __construct($threadid = false) {
if (RP_DEBUG) {
global $site_debug;
$debug_timer_start = microtime(true);
Method send
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send() {
$Client = new Client;
$failures = array();
Method getReadTopics
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getReadTopics($user_id = false) {
global $Error;
if (!$user_id) {
return false;
Method __construct
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($code) {
parent::__construct();
$this->code = $code;
Method generateCalendar
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateCalendar() {
/**
* Load the Events class for later on
*/
Method load
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load($id = false, $getParent = false) {
if ($id === false) {
throw new InvalidArgumentException("No valid forum ID or shortname was provided");
}
Method getReadItemsForUser
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getReadItemsForUser(User $User, $type = "t") {
/**
* Not logged in - no threads/forums
*/
Function CreateLocation
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function CreateLocation($id) {
$Memcached = AppCore::getMemcached();
$Redis = AppCore::getRedis();
$Registry = Registry::getInstance();
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
public function __construct() {
foreach (EmoticonsUtility::getEmoticons() as $key => $emoticons) {
if (count($emoticons) === 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 CreateLocoClass
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function CreateLocoClass($id = false) {
$Redis = AppCore::getRedis();
$Registry = Registry::getInstance();
- 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 getDescriptionBits_Dates
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function getDescriptionBits_Dates(Locomotive $Loco, $bits) {
$dates = $Loco->loadDates();
$dates = array_reverse($dates);
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($id = NULL) {
$timer = 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"