Function fetch
has a Cognitive Complexity of 197 (exceeds 5 allowed). Consider refactoring. Open
public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)
{
if ($template === null && $this instanceof $this->template_class) {
$template = $this;
}
- 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 fetch
has 282 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)
{
if ($template === null && $this instanceof $this->template_class) {
$template = $this;
}
File smarty_internal_templatebase.php
has 522 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Smarty Internal Plugin Smarty Template Base
*
* This file contains the basic shared methodes for template handling
Function __call
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function __call($name, $args)
{
static $_prefixes = array('set' => true, 'get' => true);
static $_resolved_property_name = array();
static $_resolved_property_source = 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
Smarty_Internal_TemplateBase
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
{
/**
* fetches a rendered Smarty template
*
Method __call
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __call($name, $args)
{
static $_prefixes = array('set' => true, 'get' => true);
static $_resolved_property_name = array();
static $_resolved_property_source = array();
Function registerObject
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
{
// test if allowed methodes callable
if (!empty($allowed)) {
foreach ((array) $allowed as $method) {
- 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 fetch
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)
Consider simplifying this complex logical expression. Open
if ((!$this->caching || $_template->has_nocache_code || $_template->source->recompiled) && !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
$_output = Smarty_Internal_Filter_Handler::runFilter('output', $_output, $_template);
}
Method registerObject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
Method registerPlugin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null)
Avoid too many return
statements within this method. Open
return $this->smarty->$property_name = $args[0];
Avoid too many return
statements within this method. Open
return false;