Showing 1,011 of 9,214 total issues
Method validatePassword
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validatePassword($password = false, $username = false) {
Utility\PasswordUtility::validateParameters($password, $username, $this);
/**
Method unBanUser
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function unBanUser($banId, $userId = null) {
$success = false;
/**
* Empty the cache
Function getAddress
has a Cognitive Complexity of 17 (exceeds 5 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)) {
- 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 autoPopulateNextComp
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function autoPopulateNextComp() {
$month = new DateTime("first day of next month");
$title = $month->format("F Y");
- 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 getStylesheets
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getStylesheets() {
$tags = array();
$minify = 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 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"