Showing 7,873 of 7,873 total issues
Method smarty_function_html_options_optoutput
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
Function create_object
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function create_object($bucket, $filename, $opt = null)
{
if (!$opt) $opt = array();
// Add this to our request
- 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 authenticate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function authenticate($method = 'GET', $path = null, $opt = null, $xml = null, $etag = null, $redirects = 0)
Avoid deeply nested control flow statements. Open
if ($result === false) {
$this->log(modX::LOG_LEVEL_ERROR, 'Could not set error handler. Make sure your class has a function called handleError(). Result: ' . print_r($result, true));
}
Avoid deeply nested control flow statements. Open
while ($patternMatches > 0 && $patternIterator <= $nesting) {
$value= preg_replace($pattern, '', $value);
$patternMatches = preg_match($pattern, $value);
}
Method smarty_function_html_options_optgroup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx)
Avoid deeply nested control flow statements. Open
if ($property !== false) {
if (property_exists($data, $property)) {
$propertyType = $this->resolvedProperties[ $match[ 0 ] ][ $objType ] = 1;
} elseif (property_exists($smarty, $property)) {
$propertyType = $this->resolvedProperties[ $match[ 0 ] ][ $objType ] = 2;
Avoid deeply nested control flow statements. Open
if ($mod_array[ 0 ][ $i ] !== ':') {
$modifierlist[ $key ][] = $mod_array[ 0 ][ $i ];
}
Function convertScope
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function convertScope($_attr, $validScopes)
{
$_scope = 0;
if (isset($_attr[ 'scope' ])) {
$_scopeName = trim($_attr[ 'scope' ], '\'"');
- 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
Avoid deeply nested control flow statements. Open
if ($propertyType) {
$obj = $propertyType === 1 ? $data : $smarty;
if ($match[ 2 ] === 'get') {
return $obj->$property;
} elseif ($match[ 2 ] === 'set') {
Function getTags
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getTags(Smarty_Internal_TemplateBase $obj, $template = null)
{
/* @var Smarty $smarty */
$smarty = $obj->_getSmartyObj();
if ($obj->_isTplObj() && !isset($template)) {
- 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 save
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
abstract protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content);
Function mustCompile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function mustCompile(Smarty_Internal_Template $_template)
{
if (!$_template->source->exists) {
if ($_template->_isSubTpl()) {
$parent_resource = " in '$_template->parent->template_resource}'";
- 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 clearCache
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Smarty $smarty,
$template_name,
$cache_id = null,
$compile_id = null,
$exp_time = null,
Method fetch
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
abstract protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime);
Avoid deeply nested control flow statements. Open
if ($content) {
// check if we must update file dependency
if (!preg_match("/'{$funcParam['uid']}'(.*?)'nocache_hash'/", $content, $match2)) {
$content = preg_replace("/('file_dependency'(.*?)\()/", "\\1{$match1[0]}", $content);
}
Method registerPlugin
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Smarty_Internal_TemplateBase $obj,
$type,
$name,
$callback,
$cacheable = true,
Function _assignInScope
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _assignInScope($varName, $value, $nocache = false, $scope = 0)
{
if (isset($this->tpl_vars[ $varName ])) {
$this->tpl_vars[ $varName ] = clone $this->tpl_vars[ $varName ];
$this->tpl_vars[ $varName ]->value = $value;
- 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 populateCompiledFilepath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function populateCompiledFilepath(Smarty_Internal_Template $_template)
{
$source = &$_template->source;
$smarty = &$_template->smarty;
$this->filepath = $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
Method registerObject
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Smarty_Internal_TemplateBase $obj,
$object_name,
$object,
$allowed_methods_properties = array(),
$format = true,