Showing 4,334 of 7,873 total issues
File utilities.js
has 507 lines of code (exceeds 250 allowed). Consider refactoring. Open
Ext.namespace('MODx.util.Progress');
/**
* A JSON Reader specific to MODExt
*
* @class MODx.util.JSONReader
File transport.core.actions.php
has 507 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @var modX|xPDO $xpdo
* @package modx
* @subpackage build
Function createObjectContainer
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public function createObjectContainer($className) {
$created= false;
if ($this->xpdo->getConnection(array(xPDO::OPT_CONN_MUTABLE => true))) {
$instance= $this->xpdo->newObject($className);
if ($instance) {
- 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 addOne
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public function addOne(& $obj, $alias= '') {
$added= false;
if (is_object($obj)) {
if (empty ($alias)) {
if ($obj->_alias == $obj->_class) {
- 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 _saveRelatedObjects
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
protected function _saveRelatedObjects() {
$saved= 0;
if (!empty ($this->_relatedObjects)) {
foreach ($this->_relatedObjects as $alias => $ro) {
$objects= 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 PclZipUtilPathReduction
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
function PclZipUtilPathReduction($p_dir)
{
$v_result = "";
// ----- Look for not empty path
- 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 process
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public function process()
{
if (!$this->modx->user->isAuthenticated('mgr')) {
return $this->failure($this->modx->lexicon('permission_denied'));
}
- 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 load
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public function load() {
$topics = func_get_args(); /* allow for dynamic number of lexicons to load */
if ($this->modx->context && $this->modx->context->get('key') == 'mgr') {
$defaultLanguage = $this->modx->getOption('manager_language',null,$this->modx->getOption('cultureKey',null,'en'));
- 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 clearCompiledTemplate
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public function clearCompiledTemplate(Smarty $smarty, $resource_name = null, $compile_id = null, $exp_time = null)
{
// clear template objects cache
$smarty->_clearTemplateCache();
$_compile_dir = $smarty->getCompileDir();
- 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 xpdotransport.class.php
has 503 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* Copyright 2010-2015 by MODX, LLC.
*
* This file is part of xPDO.
Method fb
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fb($Object) {
if(!$this->enabled) {
return false;
}
Method privExtractByRule
has 198 lines of code (exceeds 25 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
Method parse
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse($value)
{
$value = str_replace("\t", ' ', $value); // Convert tabs to spaces.
$this->currentLineNb = -1;
Function pack
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
public function pack($source, array $options = array()) {
$results = array();
if ($this->_archive) {
$target = $this->getOption(xPDOZip::ZIP_TARGET, $options, '');
if (is_dir($source)) {
- 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 getIncludePath
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
public function getIncludePath($dirs, $file, Smarty $smarty)
{
//if (!(isset($this->_has_stream_include) ? $this->_has_stream_include : $this->_has_stream_include = false)) {
if (!(isset($this->_has_stream_include) ? $this->_has_stream_include :
$this->_has_stream_include = function_exists('stream_resolve_include_path'))
- 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 ImageCreateFromStringReplacement
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
public function ImageCreateFromStringReplacement(&$RawImageData, $DieOnErrors=false) {
// there are serious bugs in the non-bundled versions of GD which may cause
// PHP to segfault when calling imagecreatefromstring() - avoid if at all possible
// when not using a bundled version of GD2
if (!phpthumb_functions::gd_version()) {
- 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 getContentType
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getContentType($ext) {
$contentType = 'application/octet-stream';
$mimeTypes = array(
'323' => 'text/h323',
'acx' => 'application/internet-property-stream',
File modrequest.class.php
has 494 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of MODX Revolution.
*
* Copyright (c) MODX, LLC. All Rights Reserved.
xPDOObject
has 55 functions (exceeds 20 allowed). Consider refactoring. Open
class xPDOObject {
/**
* A convenience reference to the xPDO object.
* @var xPDO
* @access public
Method compress
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
public void compress(Writer out, int linebreakpos)
throws IOException {
Pattern p;
Matcher m;
- 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"