Showing 714 of 844 total issues
Function __buildPage
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
private function __buildPage($page)
{
$is_logged_in = static::isLoggedIn();
if (empty($page) || is_null($page)) {
- 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
File content.blueprintsevents.php
has 501 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package content
*/
Function symphonyDuplicator
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.symphonyDuplicator = function(options) {
var objects = this,
settings = {
instances: '> li:not(.template)',
templates: '> li.template',
General
has 53 functions (exceeds 20 allowed). Consider refactoring. Open
class General
{
/**
* Convert any special characters into their entity equivalents. Since
* Symphony 2.3, this function assumes UTF-8 and will not double
Function symphonyDrawer
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.symphonyDrawer = function(options) {
var objects = this,
wrapper = $('#wrapper'),
contents = $('#contents'),
form = contents.find('> form'),
Function __form
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
public function __form()
{
// Handle unknown context
if (!in_array($this->_context['action'], array('new', 'edit'))) {
Administration::instance()->errorPageNotFound();
- 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 upgrade
has 185 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upgrade()
{
// Upgrade DB settings
$db = Symphony::Configuration()->get('database');
$db['driver'] = 'mysql';
Method __viewEdit
has 184 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __viewEdit()
{
if (!$section_id = SectionManager::fetchIDFromHandle($this->_context['section_handle'])) {
Administration::instance()->throwCustomError(
__('The Section, %s, could not be found.', array('<code>' . $this->_context['section_handle'] . '</code>')),
File field.author.php
has 473 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
File class.frontendpage.php
has 467 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
Function symphonyCollapsible
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.symphonyCollapsible = function(options) {
var objects = this,
settings = {
items: '.instance',
handles: '.frame-header',
Function __formAction
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
public function __formAction()
{
$fields = $_POST['fields'];
$this->_errors = array();
$providers = Symphony::ExtensionManager()->getProvidersOf(iProvider::EVENT);
- 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 duplicators
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
objects.each(function duplicators() {
var duplicator = $(this),
list = duplicator.find('> ol'),
apply = $('<fieldset class="apply" />'),
selector = $('<select />'),
Method __actionNew
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __actionNew()
{
if (is_array($_POST['action']) && array_key_exists('save', $_POST['action'])) {
$canProceed = true;
$edit = ($this->_context['action'] === "edit");
Method __actionEdit
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __actionEdit()
{
if (!$author_id = $this->_context['id']) {
redirect(SYMPHONY_URL . '/system/authors/');
}
File class.datasource.section.php
has 455 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package data-sources
*/
Function __actionNew
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public function __actionNew()
{
if (is_array($_POST['action']) && array_key_exists('save', $_POST['action'])) {
$section_id = SectionManager::fetchIDFromHandle($this->_context['section_handle']);
- 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 Symphony
has 171 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Symphony = (function($, crossroads) {
'use strict';
// Internal Symphony storage
var Storage = {
Method __viewEdit
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __viewEdit()
{
$section_id = $this->_context['id'];
$section = (new SectionManager)->select()->section($section_id)->execute()->next();
Function __buildPage
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
private function __buildPage()
{
$start = precision_timer();
if (!$page = $this->resolvePage()) {
- 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"