Showing 1,011 of 9,214 total issues
Method commit
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function commit() {
$this->validate();
$data = array(
Method validate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validate() {
if (is_null($this->bbcode_uid)) {
$this->bbcode_uid = "sausages";
}
Method activeForums
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function activeForums($num_forums = 1, $age) {
if (empty($age)) {
$age = strtotime("30 days ago");
}
Function load
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function load($userId = false) {
if (filter_var($userId, FILTER_VALIDATE_INT)) {
$this->id = $userId;
}
- 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 tryAutoLogin
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function tryAutoLogin() {
if (is_null(filter_input(INPUT_COOKIE, "rp_autologin"))) { #empty($_COOKIE['rp_autologin'])) {
$this->addNote("Autologin attempted but no autologin cookie was found");
- 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 updateHash
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function updateHash() {
$cookie = is_null(filter_input(INPUT_COOKIE, "rp_userhash")) ? "" : filter_input(INPUT_COOKIE, "rp_userhash"); # isset($_COOKIE['rp_userhash']) ? $_COOKIE['rp_userhash'] : "";
$hash = array();
$update = 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 createSlug
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function createSlug($categoryId = 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 cacheGeoData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function cacheGeoData() {
if (!$this->Place instanceof Place) {
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 CreateImage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function CreateImage($id = null, $provider = null, $options = null) {
$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 mostReadThisWeek
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function mostReadThisWeek($limit = 5) {
$return = false;
$params = 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 createSlug
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function createSlug($story_id = 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 getArray
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getArray() {
$array = array(
"id" => $this->id,
"subject" => $this->subject,
"body" => $this->body,
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($id = null) {
parent::__construct();
$this->Module = new Module("Gallery");
- 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 activeThreads
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function activeThreads($num_threads = 1, $age) {
if (empty($age)) {
$age = strtotime("30 days ago");
}
- 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 activeForums
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function activeForums($num_forums = 1, $age) {
if (empty($age)) {
$age = strtotime("30 days ago");
}
- 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 getWatchedThreads
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getWatchedThreads($page = 1, $limit = null) {
// Assume Zend_Db
if (!filter_var($limit, FILTER_VALIDATE_INT)) {
Method suggestLiveries
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function suggestLiveries() {
$query = '
SELECT livery.livery_id AS id, livery.livery AS name, livery.photo_id
FROM loco_livery AS livery
Method getContents
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getContents($page = 1, $items_per_page = 25) {
if (empty($this->folder)) {
throw new Exception("Cannot get folder contents - no folder specified");
}
Method getTrains
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTrains($from = false, $to = false) {
if (!$from) {
$from = new DateTime;
}
Method getPhotos
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPhotos($items_per_page = 25, $page_num = 1, $date_from = false, $date_to = false) {
if (!empty($this->flickr_oauth_secret) && !empty($this->flickr_oauth_token)) {
// Fetch photos using OAuth
$f = new flickr_railpage(RP_FLICKR_API_KEY);
$f->oauth_token = $this->flickr_oauth_token;