Showing 714 of 844 total issues
Function __findActiveNavigationGroup
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static function __findActiveNavigationGroup(array &$nav, $pageroot, $pattern = false)
{
foreach ($nav as $index => $contents) {
if (is_array($contents['children']) && !empty($contents['children'])) {
foreach ($contents['children'] as $item) {
- 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 fetch
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function fetch($include_types = true, array $select = array(), array $where = array(), $order_by = null, $hierarchical = false)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog('PageManager::fetch()', 'PageManager::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 __getClassPath
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function __getClassPath($handle)
{
if (is_file(TEXTFORMATTERS . "/formatter.$handle.php")) {
return TEXTFORMATTERS;
} else {
- 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 next
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function next()
{
$next = parent::next();
if ($next) {
// If this fields does not match the restriction, fetch the next one.
- 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 __getClassPath
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function __getClassPath($handle)
{
if (is_file(EVENTS . "/event.$handle.php")) {
return EVENTS;
} else {
- 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 view
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function view()
{
$database = Symphony::Configuration()->get('db', 'database');
$field_ids = array_map(array('General','intval'), explode(',', General::sanitize($_GET['field_id'])));
$search = General::sanitize($_GET['query']);
- 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 getStatic
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getStatic($field_id, $search = null)
{
$options = array();
if (!empty($field_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 action
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function action()
{
// Do not proceed if the config file cannot be changed
if (General::checkFileWritable(CONFIG) === false) {
redirect(SYMPHONY_URL . '/system/preferences/');
- 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 parseDate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function parseDate($string, $direction = null, $equal_to = false)
{
$parts = array(
'start' => null,
'end' => null
Method filter
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function filter(EntryQuery $query, array $filters, $operator = 'or')
{
General::ensureType([
'operator' => ['var' => $operator, 'type' => 'string'],
]);
Method execute
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(array &$param_pool = null)
{
$result = new XMLElement($this->dsParamROOTELEMENT);
// Build the query
Method addSendMailFilterDoc
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addSendMailFilterDoc(array &$doc_parts, $filters)
{
if ($this->hasSendEmailFilter($filters)) {
$doc_parts[] = new XMLElement('h3', __('Send Notification Email'));
$doc_parts[] = new XMLElement('p',
Function symphonyAffix
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.symphonyAffix = function(options) {
var objects = $(this),
settings = {
// public
container: null,
Method cleanup_session_cookies
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cleanup_session_cookies()
{
/*
Unfortunately there is no way to delete a specific previously set cookie from PHP.
The only way seems to be the method employed here: store all the cookie we need to keep, then delete every cookie and add the stored cookies again.
Method notifyMembers
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function notifyMembers($delegate, $page, array $context = array())
{
// Make sure $page is an array
if (!is_array($page)) {
$page = array($page);
Method processEvents
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processEvents($events, XMLElement &$wrapper)
{
/**
* Manipulate the events array and event element wrapper
* @delegate FrontendProcessEvents
Method createTable
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createTable()
{
return Symphony::Database()
->create('tbl_entries_data_' . General::intval($this->get('id')))
->ifNotExists()
Method displayPublishPanel
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
{
if (is_dir(DOCROOT . $this->get('destination') . '/') === false) {
$flagWithError = __('The destination directory, %s, does not exist.', array(
'<code>' . $this->get('destination') . '</code>'
Method fetch
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fetch($include_types = true, array $select = array(), array $where = array(), $order_by = null, $hierarchical = false)
{
if (Symphony::Log()) {
Symphony::Log()->pushDeprecateWarningToLog('PageManager::fetch()', 'PageManager::select()');
}
Method addTimestampValidationPageAlert
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addTimestampValidationPageAlert($errorMessage, $existingObject, $action)
{
$authorId = $existingObject->get('modification_author_id');
if (!$authorId) {
$authorId = $existingObject->get('author_id');