Showing 889 of 1,089 total issues
Method salsa208Core64
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function salsa208Core64($b)
{
$b32 = array();
for ($i = 0; $i < 16; $i++) {
list(, $b32[$i]) = unpack("V", substr($b, $i * 4, 4));
Method salsa208Core32
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function salsa208Core32($b)
{
$b32 = array();
for ($i = 0; $i < 16; $i++) {
list(, $b32[$i]) = unpack("V", substr($b, $i * 4, 4));
File SimpleMessage.php
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of SwiftMailer.
* (c) 2004-2009 Chris Corbyn
Function smarty_function_html_checkboxes_output
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape=true)
{
$_output = '';
if (is_object($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 getPlugin
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getPlugin($plugin_name, $plugin_type)
{
$function = null;
if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
if (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) {
- 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 22 (exceeds 5 allowed). Consider refactoring. Open
public static function load(Smarty $smarty, $type)
{
// try smarty's cache
if (isset($smarty->_resource_handlers[$type])) {
return $smarty->_resource_handlers[$type];
- 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 getNotificationSettings
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getNotificationSettings($account_id) {
// Some defaults, we cover them here so we can avoid adding default settings on user creation
$aDefaults = array( 'newsletter' => 1 );
$this->debug->append("STA " . __METHOD__, 4);
$stmt = $this->mysqli->prepare("SELECT * FROM $this->tableSettings WHERE account_id = ?");
- 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 _canonicalizeBody
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function _canonicalizeBody($string)
{
$len = strlen($string);
$canon = '';
$nofws = ($this->_canon == "nofws");
- 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 jquery.metisMenu.js
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* metismenu - v2.5.2
* A jQuery menu plugin
* https://github.com/onokumus/metisMenu#readme
*
Method getTopContributors
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTopContributors($type='shares', $limit=15) {
$this->debug->append("STA " . __METHOD__, 4);
switch ($type) {
case 'shares':
if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__ . $type . $limit)) return $data;
Swift_Mime_SimpleHeaderSet
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Swift_Mime_SimpleHeaderSet implements Swift_Mime_HeaderSet
{
/** HeaderFactory */
private $_factory;
Swift_Mime_Headers_AbstractHeader
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header
{
/**
* The name of this Header.
*
Method clearCompiledTemplate
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty)
{
$_compile_dir = $smarty->getCompileDir();
$_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
$_dir_sep = $smarty->use_sub_dirs ? DS : '^';
Method compileChildBlock
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
static function compileChildBlock($compiler, $_name = null)
{
if ($compiler->inheritance_child) {
$name1 = Smarty_Internal_Compile_Block::$nested_block_names[0];
if (isset($compiler->template->block_data[$name1])) {
Method compile
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compile($args, $compiler)
{
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
// never compile as nocache code
Method checkLogin
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkLogin($username, $password) {
$this->debug->append("STA " . __METHOD__, 4);
$this->debug->append("Checking login for $username with password $password", 2);
if (empty($username) || empty($password)) {
$this->setErrorMessage("Invalid username or password.");
Function getPluginFromDefaultHandler
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getPluginFromDefaultHandler($tag, $plugin_type)
{
$callback = null;
$script = null;
$cacheable = true;
- 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 _restoreMessage
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function _restoreMessage(Swift_Mime_Message $message)
{
if ($this->_lastMessage === $message) {
if (isset($this->_originalBody)) {
$message->setBody($this->_originalBody);
- 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 write
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function write($chars)
{
if (!isset($this->_charReader)) {
$this->_charReader = $this->_charReaderFactory->getReaderFor(
$this->_charset);
- 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 setHeaders
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function setHeaders(Swift_Mime_HeaderSet $headers)
{
$bodyLen = $this->_bodyLen;
if (is_bool($bodyLen)) {
$bodyLen = - 1;
- 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"