Showing 708 of 9,214 total issues
Method CreateCamera
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function CreateCamera($id) {
$Database = AppCore::GetDatabase();
$Memcached = AppCore::GetMemcached();
$Redis = AppCore::getRedis();
Method CreateImageProvider
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function CreateImageProvider($provider, $options = []) {
$Config = AppCore::GetConfig();
$imageprovider = __NAMESPACE__ . "\\Provider\\" . ucfirst($provider);
Method validate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validate() {
if (!$this->Recipient instanceof User) {
throw new Exception("Cannot validate warning level adjustment - no or invalid recipient provided");
}
Method getStoriesFromTopic
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStoriesFromTopic($id = false, $page = 0, $limit = 25, $total = true) {
if (!$id || !$this->db) {
return false;
}
Method validate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validate() {
if (empty($this->name)) {
throw new Exception("Entry name cannot be empty");
}
Method set
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function set($key = null, $value, $name) {
if ($key == null) {
throw new Exception("Cannot set config option - \$key not given");
}
Method unread
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function unread() {
if ($this->db instanceof \sql_db) {
$query = "SELECT DISTINCT privmsgs_id
FROM nuke_bbprivmsgs
WHERE privmsgs_to_userid = ".$this->db->real_escape_string($this->User->id)."
Method fetch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch() {
if (!filter_var($this->id, FILTER_VALIDATE_INT)) {
throw new Exception("Cannot fetch sighting - no ID given");
}
Method validate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validate() {
if (empty($this->title)) {
throw new Exception("Thread title cannot be empty");
}
Method validate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validate() {
if (!filter_var($this->catid, FILTER_VALIDATE_INT) && !$this->category instanceof Category) {
throw new Exception("No valid forum category has been set (hint: Forum::setCategory");
}
Method setConfig
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setConfig($config = null) {
if ($this->type == "LocalFS") {
if (substr($config['storageRoot'], -1) != "/") {
$config['storageRoot'] .= "/";
Function formatExif
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function formatExif($exif) {
$format = array();
// Aperture
- 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 populate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function populate() {
$query = "SELECT organisation_id, conversions, job_added, reference_id, job_urls, job_location_id, job_classification_id, job_thread_id, job_title, job_description, job_expiry, DATEDIFF(job_expiry, NOW()) AS job_expiry_until, job_salary, job_special_cond, job_duration FROM jn_jobs WHERE job_id = ?";
if (!$result = $this->Memcached->fetch($this->mckey)) {
$result = $this->db->fetchRow($query, $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 commit
has a Cognitive Complexity of 10 (exceeds 5 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.
- 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 removeUserFavourite
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function removeUserFavourite() {
/**
* Because I'll no doubt get confused - frequently - at the order of parameters,
* let's just be a sneaky bastard and check each parameter
- 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 getTiedPhotos
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getTiedPhotos(Competition $photoComp) {
$photos = $photoComp->getPhotosAsArrayByVotes();
$votes = false;
$tied = [];
- 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 EmbedFlickrPhoto
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function EmbedFlickrPhoto(DOMElement $e) {
if (!(preg_match("@:\/\/flic.kr/p/([a-zA-Z0-9]+)@", pq($e)->attr("href"), $matches)) &&
!preg_match("@:\/\/www.flickr.com\/photos\/([a-zA-Z0-9\@]+)\/([0-9]+)@", pq($e)->attr("href"), $matches)) {
return $e;
- 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 getStoriesFromTopic
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getStoriesFromTopic($id = false, $page = 0, $limit = 25, $total = true) {
if (!$id || !$this->db) {
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 guessTopic
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
static public function guessTopic($topic) {
/**
* Normalise the topic name
*/
- 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 get
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function get($id = false) {
if (!$id) {
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"