Showing 889 of 1,089 total issues
Function isTrustedPHPDir
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function isTrustedPHPDir($filepath)
{
if (empty($this->trusted_dir)) {
throw new SmartyException("directory '{$filepath}' not allowed by security setting (no trusted_dir specified)");
}
- 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 normalizePath
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function normalizePath($_path, $ds=true)
{
if ($ds) {
// don't we all just love windows?
$_path = str_replace('\\', '/', $_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 isTokenValid
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function isTokenValid($account_id, $token, $type, $checkTimeExplicitly=false) {
if (!is_int($account_id) || !is_int($type)) {
$this->setErrorMessage("Invalid token");
return 0;
}
- 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 getReaderFor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getReaderFor($charset)
{
$charset = trim(strtolower($charset));
foreach (self::$_map as $pattern => $spec) {
$re = '/^' . $pattern . '$/D';
- 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 si2bin
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function si2bin($si, $bits = 32)
{
$bin = null;
if ($si >= -pow(2, $bits - 1) && ($si <= pow(2, $bits - 1))) {
// positive or zero
- 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 getTransactionSummary
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTransactionSummary($account_id=NULL) {
if ($data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
$sql = "
SELECT
SUM(t.amount) AS total, t.type AS type
Method sendChangeConfigEmail
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendChangeConfigEmail($strType, $userID) {
$exists = $this->token->doesTokenExist($strType, $userID);
if ($exists == 0) {
$token = $this->token->createToken($strType, $userID);
$aData['token'] = $token;
Method smarty_function_html_options_optoutput
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
{
if (!is_array($value)) {
$_key = smarty_function_escape_special_chars($key);
$_html_result = '<option value="' . $_key . '"';
Method yy_shift
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function yy_shift($yyNewState, $yyMajor, $yypMinor)
{
$this->yyidx++;
if ($this->yyidx >= self::YYSTACKDEPTH) {
$this->yyidx--;
Method yy_shift
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function yy_shift($yyNewState, $yyMajor, $yypMinor)
{
$this->yyidx++;
if ($this->yyidx >= self::YYSTACKDEPTH) {
$this->yyidx--;
Method listInvalidationKeys
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function listInvalidationKeys($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null)
{
$t = array('IVK#ALL');
$_name = $_compile = '#';
if ($resource_name) {
Method bind_param
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function bind_param($paramTypes) {
if (!is_string($paramTypes)) {
return false;
} else {
$args = func_get_args();
Method getMPQueue
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMPQueue($limit=250) {
$stmt = $this->mysqli->prepare("
SELECT
a.id,
a.username,
Method smarty_mb_str_replace
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function smarty_mb_str_replace($search, $replace, $subject, &$count=0)
{
if (!is_array($search) && is_array($replace)) {
return false;
}
Function cookie
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var config = $.cookie = function (key, value, options) {
// Write
if (value !== undefined && !$.isFunction(value)) {
Method smarty_modifier_date_format
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function smarty_modifier_date_format($string, $format=null, $default_date='', $formatter='auto')
{
if ($format === null) {
$format = Smarty::$_DATE_FORMAT;
}
Method smarty_modifier_capitalize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false)
{
if (Smarty::$_MBSTRING) {
if ($lc_rest) {
// uppercase (including hyphenated words)
Method compileTemplateSource
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compileTemplateSource()
{
if (!$this->source->recompiled) {
$this->properties['file_dependency'] = array();
if ($this->source->components) {
Method compile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compile($args, $compiler)
{
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
$_name = trim($_attr['name'], "\"'");
Method __construct
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($main, $slave = false, $strict = false)
{
if ($strict) {
$this->mysqliW = new mysqli_strict($main['host'],
$main['user'], $main['pass'],