Showing 4,334 of 7,873 total issues
File mods3mediasource.class.php
has 956 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of MODX Revolution.
*
* Copyright (c) MODX, LLC. All Rights Reserved.
Function smarty_function_html_select_date
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
function smarty_function_html_select_date($params, Smarty_Internal_Template $template)
{
$template->_checkPlugins(
array(
array(
- 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.grid.js
has 950 lines of code (exceeds 250 allowed). Consider refactoring. Open
Ext.namespace('MODx.grid');
MODx.grid.Grid = function(config) {
config = config || {};
this.config = config;
Function DomHelper
has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring. Open
Ext.DomHelper = function(){
var tempTableEl = null,
emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,
tableRe = /^table|tbody|tr|td$/i,
pub,
- 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 getAction
has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring. Open
function getAction($lastaction, $itemid='') {
switch($lastaction) {
case "1" : return "Loading a frame(set)"; break;
case "2" : return "Viewing home page/ online users"; break;
case "3" : return "Viewing data for document $itemid"; break;
- 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 phpthumb.functions.php
has 921 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
//////////////////////////////////////////////////////////////
// phpThumb() by James Heinrich <info@silisoftware.com> //
// available at http://phpthumb.sourceforge.net //
// and/or https://github.com/JamesHeinrich/phpThumb //
File modparser.class.php
has 920 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of MODX Revolution.
*
* Copyright (c) MODX, LLC. All Rights Reserved.
AmazonEC2
has 116 functions (exceeds 20 allowed). Consider refactoring. Open
class AmazonEC2 extends CFRuntime
{
/*%******************************************************************************************%*/
// CLASS CONSTANTS
File transport.policy.tpl.administrator.php
has 913 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* The default Permission scheme for the Administrator Policy Template.
*
* @package modx
Function clear
has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring. Open
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
{
$_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null;
$_compile_id = isset($compile_id) ? preg_replace('![^\w]+!', '_', $compile_id) : null;
$_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
- 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 modresource.map.inc.php
has 902 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package modx
* @subpackage mysql
*/
PHPMailer
has 113 functions (exceeds 20 allowed). Consider refactoring. Open
class PHPMailer
{
const CHARSET_ASCII = 'us-ascii';
const CHARSET_ISO88591 = 'iso-8859-1';
const CHARSET_UTF8 = 'utf-8';
Function getPK
has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring. Open
public function getPK($className) {
$pk= null;
if (strcasecmp($className, 'xPDOObject') !== 0) {
if ($actualClassName= $this->loadClass($className)) {
if (isset ($this->map[$actualClassName]['indexes'])) {
- 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 windows.js
has 887 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Generates the Duplicate Resource window.
*
* @class MODx.window.DuplicateResource
* @extends MODx.Window
File modprocessor.class.php
has 887 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of MODX Revolution.
*
* Copyright (c) MODX, LLC. All Rights Reserved.
Function CleanUpCacheDirectory
has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring. Open
public function CleanUpCacheDirectory() {
$this->DebugMessage('CleanUpCacheDirectory() set to purge ('.(null === $this->config_cache_maxage ? 'NULL' : number_format($this->config_cache_maxage / 86400, 1)).' days; '.(null === $this->config_cache_maxsize ? 'NULL' : number_format($this->config_cache_maxsize / 1048576, 2)).' MB; '.(null === $this->config_cache_maxfiles ? 'NULL' : number_format($this->config_cache_maxfiles)).' files)', __FILE__, __LINE__);
if (!is_writable($this->config_cache_directory)) {
$this->DebugMessage('CleanUpCacheDirectory() skipped because "'.$this->config_cache_directory.'" is not writable', __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
File modtemplatevar.class.php
has 885 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of MODX Revolution.
*
* Copyright (c) MODX, LLC. All Rights Reserved.
Function validate
has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring. Open
public function validate()
{
$options = '';
$this->errors = array();
$this->values = array();
- 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 generateContext
has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring. Open
public function generateContext($key, array $options = array()) {
$results = array();
if (!$this->getOption('transient_context', $options, false)) {
/** @var modContext $obj */
$obj= $this->modx->getObject('modContext', $key, 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 modx.tree.directory.js
has 875 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Generates the Directory Tree
*
* @class MODx.tree.Directory
* @extends MODx.tree.Tree