Showing 1,011 of 9,214 total issues
Method resolveTemplate
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolveTemplate($template) {
if (pathinfo($template, PATHINFO_EXTENSION) == "tpl" && file_exists($template)) {
return $template;
}
Method getJSON
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getJSON() {
if (isset( $this->author )) {
$author = clone $this->author;
Method posts
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function posts($itemsPerPage = 25, $pageNum = 1, $sort = "ASC", $highlights = null) {
$highlight_sql = "";
if (!is_null($highlights)) {
Method __construct
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($id = NULL) {
parent::__construct();
$this->Module = new Module("events");
$this->namespace = $this->Module->namespace;
Method hybi10Encode
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function hybi10Encode($payload, $type = 'text', $masked = true)
{
$frameHead = array();
$payloadLength = strlen($payload);
switch ($type) {
Method getAlerts
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAlerts(\Zend_Acl $acl) {
$query = array();
$params = array();
Method createSlug
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createSlug($categoryId = false) {
if (RP_DEBUG) {
global $site_debug;
$debug_timer_start = microtime(true);
}
Method getColumnMapping
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getColumnMapping() {
$fields = array(
// General
Method getAssignedItems
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAssignedItems() {
if (!$this->Staff instanceof User) {
throw new Exception("You must assign a valid User object before fetching assigned feedback items");
}
Method makeQuery
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function makeQuery() {
$basequery = "SELECT SQL_CALC_FOUND_ROWS image.*, g.country_code, g.country_name, g.region_code,
g.region_name, g.neighbourhood, g.timezone, X(g.point) AS geoplace_lat, Y(g.point) AS geoplace_lon
FROM image
Method fetch
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch() {
if (empty($this->id)) {
throw new Exception("Cannot fetch download object - no download ID given");
}
Method load
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function load() {
$this->mckey = sprintf("railpage:locations.location=%d", $this->id);
if (!$row = $this->Memcached->fetch($this->mckey)) {
Method getSiteFromCoords
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSiteFromCoords($lat = false, $lon = false, $distance = 1, $num = 5) {
if (!$lat || !$lon || !$this->db) {
return false;
}
Function getWinningPhoto
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getWinningPhoto() {
if ($this->VotingDateClose >= new DateTime) {
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 setUserFavourite
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function setUserFavourite() {
/**
* 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 __construct
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($topic_alias = false) {
parent::__construct();
if (!$topic_alias) {
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 __construct
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($id = NULL) {
parent::__construct();
$this->Module = new Module("events");
$this->namespace = $this->Module->namespace;
- 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 formatWoE
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function formatWoE($woe) {
$thiswoe = $woe['places']['place'][0];
$data = 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
Method filter
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function filter($args) {
if ($args === false) {
$args = array();
}
Method __construct
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($module) {
parent::__construct();
if (!is_string($module)) {