Showing 708 of 9,214 total issues
Function getStoriesFromTopic
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getStoriesFromTopic($id = false, $page = 0, $limit = 25, $total = true) {
if (!$id || !$this->db) {
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 unread
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function unread() {
if ($this->db instanceof \sql_db) {
$query = "SELECT DISTINCT privmsgs_id
FROM nuke_bbprivmsgs
WHERE privmsgs_to_userid = ".$this->db->real_escape_string($this->User->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 get
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function get($id = false) {
if (!$id) {
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 CreateOrganisation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function CreateOrganisation($id = false) {
$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 CreateEvent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function CreateEvent($id = null) {
$CacheDriver = 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 bulkAddLocos
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function bulkAddLocos($firstLoco = null, $lastLoco = null, $gaugeId = null, $statusId = null, $manufacturerId = null, $prefix = "") {
if ($firstLoco == null) {
throw new Exception("Cannot add locomotives to class - first loco number was not 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 dispatch
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function dispatch() {
/**
* Set the dispatch transport
*/
- 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 createRichText
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function createRichText() {
if (!is_array($this->meta) || count($this->meta) === 0) {
return;
}
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
function __construct($threadid = false) {
if (RP_DEBUG) {
global $site_debug;
$debug_timer_start = microtime(true);
- 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 users
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function users($num_users = 5) {
if ($this->db instanceof \sql_db) {
$query = "SELECT user_id, username, uWheat, uChaff, (uWheat / uChaff * 100) AS rating FROM nuke_users WHERE user_active = 1 ORDER BY rating DESC LIMIT 0, ".$this->db->real_escape_string($num_users);
if ($rs = $this->db->query($query)) {
- 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 setConfig
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function setConfig($config = null) {
if ($this->type == "LocalFS") {
if (substr($config['storageRoot'], -1) != "/") {
$config['storageRoot'] .= "/";
- 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 forums
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function forums() {
$query = "SELECT * FROM nuke_bbforums";
if ($this->db instanceof \sql_db) {
if ($rs = $this->db->query($query)) {
- 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 buildCurrentPage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function buildCurrentPage() {
$links = $this->getParam("links");
$currentPage = $this->getParam("current_page");
- 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 getVideos
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getVideos($num = 25) {
if (!$this->video_store_url) {
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
Method removeUserFavourite
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function removeUserFavourite() {
/**
* 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 fetch
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch() {
$mckey = sprintf("railpage:group=%d", intval($this->id));
if (!$row = $this->Redis->fetch($mckey)) {
Method generateTitle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function generateTitle($row) {
self::$row = $row;
switch (self::$row['key']) {
Method guest
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function guest() {
$this->lang = "english";
$this->date_format = "d M Y H:i";
$this->avatar_filename = "blank.png";
Method commit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function commit() {
$this->validate();
$data = array(
Method lookup
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function lookup($type, $id, $activeOnly) {
$Database = (new AppCore)->getDatabaseConnection();
if ($type == "ip") {