Showing 714 of 844 total issues
File class.xmlelement.php
has 404 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
/**
XMLElement
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class XMLElement implements IteratorAggregate
{
/**
* This is an array of HTML elements that are self closing.
* @var array
File class.widget.php
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
/**
File class.databasestatement.php
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
Function buildEntry
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function buildEntry(array $entry)
{
if (!isset($entry['id'], $entry['section_id'], $entry['creation_date'], $entry['modification_date'])) {
return $entry;
}
- 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 __actionEdit
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __actionEdit()
{
if ($this->_context['action'] !== 'new' && !$page_id = $this->_context['id']) {
redirect(SYMPHONY_URL . '/blueprints/pages/');
}
Function fetch
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
private static function fetch()
{
if (!@is_readable(EXTENSIONS)) {
return;
}
- 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 __buildPage
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function __buildPage()
{
$start = precision_timer();
if (!$page = $this->resolvePage()) {
Function __viewIndex
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function __viewIndex()
{
$this->setPageType('table');
$this->setTitle(__('%1$s – %2$s', array(__('Authors'), __('Symphony'))));
- 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
EmailGateway
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class EmailGateway
{
protected $_recipients = array();
protected $_sender_name;
protected $_sender_email_address;
File field.select.php
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
Method __viewIndex
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __viewIndex()
{
$this->setPageType('table');
$this->setTitle(__('%1$s – %2$s', array(__('Pages'), __('Symphony'))));
Function __viewIndex
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function __viewIndex($resource_type)
{
$manager = ResourceManager::getManagerFromType($resource_type);
$friendly_resource = ($resource_type === ResourceManager::RESOURCE_TYPE_EVENT) ? __('Event') : __('DataSource');
$context = Administration::instance()->getPageCallback();
- 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 __viewNew
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function __viewNew()
{
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>')),
- 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 field.checkbox.php
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
Method __viewIndex
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __viewIndex()
{
$this->setPageType('table');
$this->setTitle(__('%1$s – %2$s', array(__('Authors'), __('Symphony'))));
Method __viewNew
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __viewNew()
{
$this->setPageType('form');
$this->setTitle(__('%1$s – %2$s', array(__('Sections'), __('Symphony'))));
$this->appendSubheading(__('Untitled'));
Method exec
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exec($force_connection_method = null)
{
if ($force_connection_method !== self::FORCE_SOCKET && self::isCurlAvailable()) {
$ch = curl_init();
Function fetch
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public static function fetch($id = null, $section_id = null, $order = 'ASC', $sortfield = 'sortorder', $type = null, $location = null, $where = null, $restrict = Field::__FIELD_ALL__)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog('FieldManager::fetch()', 'FieldManager::select()');
}
- 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 processParametersInString
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function processParametersInString($value, array $env, $includeParenthesis = true, $escape = false)
{
if (trim($value) == '') {
return null;
}
- 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"