Showing 4,334 of 7,873 total issues
Function smarty_function_fetch
has a Cognitive Complexity of 142 (exceeds 5 allowed). Consider refactoring. Open
function smarty_function_fetch($params, $template)
{
if (empty($params[ 'file' ])) {
trigger_error('[plugin] fetch parameter \'file\' cannot be empty', E_USER_NOTICE);
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
Function SourceImageToGD
has a Cognitive Complexity of 139 (exceeds 5 allowed). Consider refactoring. Open
public function SourceImageToGD() {
if (is_resource($this->gdimg_source) || (is_object($this->gdimg_source) && $this->gdimg_source instanceOf \GdImage)) {
$this->source_width = imagesx($this->gdimg_source);
$this->source_height = imagesy($this->gdimg_source);
$this->DebugMessage('skipping SourceImageToGD() because $this->gdimg_source is already a resource ('.$this->source_width.'x'.$this->source_height.')', __FILE__, __LINE__);
- 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 testInstall
has 564 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function testInstall(Smarty $smarty, &$errors = null)
{
$status = true;
if ($errors === null) {
echo "<PRE>\n";
Function _installObject
has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring. Open
protected function _installObject(& $transport, $options, $element, & $parentObject, $fkMeta) {
$saved = false;
$preExistingMode = xPDOTransport::PRESERVE_PREEXISTING;
$upgrade = false;
$exists = 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 compile
has a Cognitive Complexity of 137 (exceeds 5 allowed). Consider refactoring. Open
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
{
$compiler->loopNesting++;
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
- 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 553 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function filter(&$element) {
$usemb = function_exists('mb_strlen') && (boolean)$this->modx->getOption('use_multibyte',null,false);
$encoding = $this->modx->getOption('modx_charset',null,'UTF-8');
$output= & $element->_output;
File modx.grid.element.properties.js
has 1082 lines of code (exceeds 250 allowed). Consider refactoring. Open
MODx.panel.ElementProperties = function(config) {
config = config || {};
Ext.applyIf(config,{
id: 'modx-panel-element-properties'
,title: _('properties')
Function privExtractByRule
has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring. Open
function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
{
$v_result=1;
// ----- Magic quotes trick
- 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 fb
has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring. Open
public function fb($Object) {
if(!$this->enabled) {
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 privExtractFile
has a Cognitive Complexity of 128 (exceeds 5 allowed). Consider refactoring. Open
function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
{
$v_result=1;
// ----- Read the file header
- 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 modx.combo.js
has 1012 lines of code (exceeds 250 allowed). Consider refactoring. Open
Ext.namespace('MODx.combo');
/* disable shadows for the combo-list globally, saves a few dom nodes as it's not used anyways */
Ext.form.ComboBox.prototype.shadow = false;
/* replaces the default img tag for the combo trigger with a div to make the use of iconfonts with :before possible */
Ext.override(Ext.form.TriggerField, {
Function onKeyDownHandler
has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring. Open
onKeyDownHandler : function(e,t) {
var toDestroy,nextFocus,idx;
if(e.getKey() === e.ESC){
- 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 checkPolicy
has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring. Open
public function checkPolicy($criteria, $targets = null, modUser $user = null) {
if(!$user){
$user = & $this->xpdo->user;
}
if ($criteria && $this->xpdo instanceof modX && $this->xpdo->getSessionState() == modX::SESSION_STATE_INITIALIZED) {
- 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 smarty_internal_templatecompilerbase.php
has 1010 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Smarty Internal Plugin Smarty Template Compiler Base
* This file contains the basic classes and methods for compiling Smarty templates with lexer/parser
*
File ext-yui-adapter-debug.js
has 1004 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
This file is part of Ext JS 3.4
Copyright (c) 2011-2013 Sencha Inc
Function toCache
has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring. Open
public function toCache($signature, $object, $lifetime= 0, $options = array()) {
$result= false;
if ($this->getCacheManager()) {
if ($this->getOption(xPDO::OPT_CACHE_DB, $options)) {
if ($lifetime === true) {
- 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 parseTree
has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring. Open
public function parseTree($n, $noBlockGrouping = false)
{
$s = '';
switch ($n->type)
- 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 parseConditions
has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring. Open
public function parseConditions($conditions, $conjunction = xPDOQuery::SQL_AND) {
$result= array ();
$pk= $this->xpdo->getPK($this->_class);
$pktype= $this->xpdo->getPKType($this->_class);
$fieldMeta= $this->xpdo->getFieldMeta($this->_class, true);
- 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 modfilemediasource.class.php
has 968 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of MODX Revolution.
*
* Copyright (c) MODX, LLC. All Rights Reserved.
File modx.js
has 957 lines of code (exceeds 250 allowed). Consider refactoring. Open
Ext.namespace('MODx');
Ext.apply(Ext,{
isFirebug: (window.console && window.console.firebug)
});
/* work around IE9 createContextualFragment bug