models/SQ_PostsList.php
File SQ_PostsList.php
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
class Model_SQ_PostsList {
/** @var integer */
Function packBriefProgress
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
private function packBriefProgress($history) {
if (!is_array($history) || count($history) == 0)
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 packBrief
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function packBrief($response) {
if (!isset($response->seo))
return;
if (isset($response->seo) && ($response->seo->optimized == '0%')) {
- 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 packBrief
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function packBrief($response) {
if (!isset($response->seo))
return;
if (isset($response->seo) && ($response->seo->optimized == '0%')) {
Method getTrafficZone
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getTrafficZone() {
$traffic = $this->packTraffic($this->interval);
$str = '';
Method getOthersSERPZone
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getOthersSERPZone($serp) {
$str = '';
if (!is_array($serp))
return $str;
Method getGraph
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getGraph($div) {
$traffic = SQ_ObjController::getController('SQ_Traffic', false)->getHistory($this->post_id, $this->interval, 'ASC');
$rows = array();
$table = array();
$table['cols'] = array(
Method getSERPZone
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getSERPZone($serp) {
$str = '';
$str .= '<ul class="sq_rank_ul_values">
<li class="sq_rank_values">
<table>