Function _subTemplateRender
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
public function _subTemplateRender(
$template,
$cache_id,
$compile_id,
$caching,
- 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_template.php
has 429 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Smarty Internal Plugin Template
* This file contains the Smarty template engine
*
Function render
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function render($no_output_filter = true, $display = null)
{
if ($this->smarty->debugging) {
if (!isset($this->smarty->_debug)) {
$this->smarty->_debug = new Smarty_Internal_Debug();
- 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 _decodeProperties
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function _decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
{
// on cache resources other than file check version stored in cache code
if (!isset($properties[ 'version' ]) || Smarty::SMARTY_VERSION !== $properties[ 'version' ]) {
if ($cache) {
- 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 _subTemplateRender
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _subTemplateRender(
$template,
$cache_id,
$compile_id,
$caching,
Function _checkPlugins
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function _checkPlugins($plugins)
{
static $checked = array();
foreach ($plugins as $plugin) {
$name = join('::', (array)$plugin[ 'function' ]);
- 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 render
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($no_output_filter = true, $display = null)
{
if ($this->smarty->debugging) {
if (!isset($this->smarty->_debug)) {
$this->smarty->_debug = new Smarty_Internal_Debug();
Smarty_Internal_Template
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
{
/**
* Template object cache
*
Method _decodeProperties
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
{
// on cache resources other than file check version stored in cache code
if (!isset($properties[ 'version' ]) || Smarty::SMARTY_VERSION !== $properties[ 'version' ]) {
if ($cache) {
Method _subTemplateRender
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
$template,
$cache_id,
$compile_id,
$caching,
$cache_lifetime,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$template_resource,
Smarty $smarty,
Smarty_Internal_Data $_parent = null,
$_cache_id = null,
$_compile_id = null,
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
Consider simplifying this complex logical expression. Open
if (!$no_output_filter
&& (!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled)
&& (isset($this->smarty->autoload_filters[ 'output' ])
|| isset($this->smarty->registered_filters[ 'output' ]))
) {
Consider simplifying this complex logical expression. Open
if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled)
&& !$no_output_filter && (isset($this->smarty->autoload_filters[ 'output' ])
|| isset($this->smarty->registered_filters[ 'output' ]))
) {
echo $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this);