Showing 1,011 of 9,214 total issues
Function purge
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function purge() {
// Purge pending accounts older than 24 hours
$age = strtotime("-2 weeks");
$query = "SELECT u.username, u.user_id, u.user_regdate, u.user_actkey
- 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 notifyWinner
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function notifyWinner(Competition $compObject) {
if (isset($compObject->meta['winnernotified']) && $compObject->meta['winnernotified'] === true) {
return $this;
}
- 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 setCommodity
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function setCommodity($commodity) {
switch (strtolower($commodity)) {
case "intermodal" :
$this->commodity = self::COMMODITY_INTERMODAL;
break;
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($id = false) {
parent::__construct();
if (is_string($id)) {
$query = "SELECT id FROM timetable_points WHERE name = ? OR slug = ?";
- 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 PrintPretty
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function PrintPretty() {
// temporary
global $site_debug;
- 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 validate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function validate() {
if (is_null($this->object_id)) {
$this->object_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 __construct
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($module) {
parent::__construct();
if (!is_string($module)) {
- 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 createSummary
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function createSummary($str, $n = 1024, $end_char = '…') {
$str = strip_tags($str, "<ul><li><ol>");
$str = explode("\n", $str);
- 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 generateCalendar
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function generateCalendar() {
/**
* Load the Events class for later on
*/
- 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 CreateLocomotive
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function CreateLocomotive($id = false, $class = false, $number = 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 validate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function validate() {
if (is_null($this->Loco) && filter_var($this->id, FILTER_VALIDATE_INT)) {
$this->loadLoco();
}
- 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 setReminderDate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function setReminderDate(DateTime $Reminder, DateTime $EventDate) {
$Now = new DateTime;
if ($EventDate <= $Now) {
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function commit() {
$this->validate();
/**
* Firstly, check if this reference ID exists anywhere in the database. If it does, update, not create.
Method addTiming
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addTiming($day = false, $time = false, $going = "arr", $commencing = false, $expiring = false) {
if (!$this->Point instanceof Point) {
throw new Exception("Cannot add a timing because no valid timetable point has been set");
}
Method getHTML5Video
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHTML5Video() {
if (empty($this->mime) && file_exists(RP_DOWNLOAD_DIR . $this->filepath)) {
$this->getThumbnail();
}
Method autoPopulateNextComp
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function autoPopulateNextComp() {
$month = new DateTime("first day of next month");
$title = $month->format("F Y");
Method commit
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function commit() {
$this->validate();
$data = array(
"title" => $this->title,
Method StopsNearLocation
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function StopsNearLocation($latitude = null, $longitude = null) {
if ($latitude == null) {
throw new Exception("Cannot fetch " . __METHOD__ . " - no latitude given");
}
Method formatDepartures
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function formatDepartures($departures) {
$return = array();
if (isset($departures['values'])) {
foreach ($departures['values'] as $row) {
Method addReputationMarker
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addReputationMarker($reputation_type_id = false) {
if (!filter_var($reputation_type_id, FILTER_VALIDATE_INT)) {
throw new Exception("Cannot add a reputation marker to this post because the supplied type ID (\$reputation_type_id) is not valid");
}