Showing 1,011 of 9,214 total issues
Method stories
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function stories($page = false, $limit = false) {
#if ($page == false || $limit == false) {
# return false;
#}
Method fetch
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch() {
if (!is_string($this->feed)) {
throw new Exception("Cannot fetch news articles from RSS feed because no RSS feed was provided");
}
Method getCoverImageOfObject
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getCoverImageOfObject($Object) {
if (!self::hasCoverImage($Object)) {
return false;
}
Function validate
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function validate($ignore = false) {
if (empty( $this->username )) {
throw new Exception("Username cannot be empty");
}
- 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 validatePassword
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function validatePassword($password = false, $username = false) {
Utility\PasswordUtility::validateParameters($password, $username, $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 fetch
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function fetch($id = false) {
if ($id) {
$this->id = $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 fetch
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function fetch($recurse) {
if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
$this->id = Utility\LocomotiveUtility::getClassId($this->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 getReadItemsForUser
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function getReadItemsForUser(User $User, $type = "t") {
/**
* Not logged in - no threads/forums
*/
- 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 send
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function send($markAsSent = false) {
$this->validate();
$Smarty = AppCore::getSmarty();
- 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 makeJSON
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function makeJSON() {
if ($this->date instanceof DateTime) {
$timezone = $this->date->getTimezone();
} else {
Image
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Image extends AppCore {
/**
* Max age of data before it requires refreshing
*/
Method getPhotos
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPhotos($num = 10) {
$lat = $this->lat;
$lon = $this->lon;
$query = "SELECT flickr_geodata.*, 3956 * 2 * ASIN(SQRT(POWER(SIN((" . $lat . " - flickr_geodata.lat) * pi() / 180 / 2), 2) + COS(" . $lat . " * pi() / 180) * COS(" . $lat . " * pi() / 180) * POWER(SIN((" . $lon . " - flickr_geodata.lon) * pi() / 180 / 2), 2))) AS distance
File Idea.php
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Suggestions for side ideas and improvements, ala Wordpress.org/ideas
* @since Version 3.8.7
Method banUser
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function banUser($userId = null, $reason = null, $expiry = "0", $adminUserId = null) {
if (!filter_var($userId, FILTER_VALIDATE_INT)) {
throw new InvalidArgumentException("No user ID supplied");
}
Method latest
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function latest($number = 5, $offset = 0) {
$return = false;
$mckey = "railpage:news.latest.count=" . $number .".offset=" . $offset;
$mcexp = strtotime("+5 minutes"); // Store for five minutes
Method latestPosts
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function latestPosts($is_auth_ary, $since, $limit = 10) {
if (empty($is_auth_ary) || !is_array($is_auth_ary)) {
return false;
}
Function NominateImage
has a Cognitive Complexity of 18 (exceeds 5 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"))) {
- 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 getWeatherForecast
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getWeatherForecast($days = 14) {
return false;
$weather = 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 getPhotoContext
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function getPhotoContext(Image $imageObject, $unapprovedOnly = null) {
$Database = (new AppCore)->getDatabaseConnection();
if ($unapprovedOnly == false || $unapprovedOnly == null) {
- 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 updateAuthors
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function updateAuthors() {
$userlookup = array();
$Database = (new AppCore)->getDatabaseConnection();
- 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"