Showing 708 of 9,214 total issues
Function isClientBanned
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function isClientBanned($userId, $remoteAddr, $force = null) {
if ($remoteAddr == "58.96.64.238" || $userId == 71317) {
$force = 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 Process
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function Process( $text ) {
$timer = Debug::GetTimer();
$r = '';
- 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 getTimeline
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getTimeline() {
$query = "SELECT d.*, lu.loco_num, ld.loco_date_text FROM loco_unit_date AS d INNER JOIN loco_date_type AS ld ON ld.loco_date_id = d.loco_date_id INNER JOIN loco_unit AS lu ON lu.loco_id = d.loco_unit_id WHERE lu.class_id = ? ORDER BY timestamp ASC";
$return = array(
"timeline" => 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 commit
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function commit() {
if (empty($this->bbcode_uid)) {
$this->bbcode_uid = crc32($this->text);
}
- 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 hybi10Encode
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function hybi10Encode($payload, $type = 'text', $masked = true)
{
$frameHead = array();
$payloadLength = strlen($payload);
switch ($type) {
- 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 process
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function process(array $item) {
/**
* Process the description field
*/
Method fetch
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch() {
if (!is_string($this->feed)) {
throw new Exception("Cannot fetch jobs from RSS feed because no RSS feed was provided");
}
File Weekly.php
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Curate a weekly newsletter
* @since Version 3.10.0
* @package Railpage
File CountryCodes.php
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* ISO 3166-1 country codes
* @since Version 3.10.0
* @package Railpage
Method GetLoadingSVG
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function GetLoadingSVG(Image $imageObject) {
$cachekey = sprintf("railpage:base64.image.svg=%d", $imageObject->id);
$Memcached = AppCore::GetMemcached();
Method EmbedGoogleMap
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function EmbedGoogleMap(DOMElement $e) {
$timer = Debug::GetTimer();
$Config = AppCore::GetConfig();
Method getThumbnail
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getThumbnail() {
$mime = explode("/", $this->mime);
$thumbnail = sprintf("%s.thumbnail.jpg", $this->filepath);
Method isClientBanned
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function isClientBanned($userId, $remoteAddr, $force = null) {
if ($remoteAddr == "58.96.64.238" || $userId == 71317) {
$force = true;
}
Method send
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send($markAsSent = false) {
$this->validate();
$Smarty = AppCore::getSmarty();
Function fetch
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function fetch() {
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 newAPIKey
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function newAPIKey() {
$len = 32;
if (@is_readable('/dev/urandom')) {
- 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 load
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function load() {
if (!$row = $this->db->fetchRow("SELECT * FROM asset WHERE id = ?", $this->id)) {
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 getHeadTags
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getHeadTags() {
$tags = array();
if (count($this->rp_meta_tags)) {
- 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 getRegions
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getRegions($country = false) {
$timer = Debug::GetTimer();
$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 cleanupBadHtml
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function cleanupBadHtml($string, $editorVersion = 1) {
$timer = Debug::getTimer();
if (is_string($string)) {
- 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"