Showing 1,089 of 1,089 total issues
File smarty_internal_template.php
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Smarty Internal Plugin Template
*
* This file contains the Smarty template engine
File smarty_resource.php
has 413 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Smarty Resource Plugin
*
* @package Smarty
Smarty
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class Smarty extends Smarty_Internal_TemplateBase
{
/**#@+
* constant definitions
*/
Base
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class Base {
private $sError = '';
private $sCronError = '';
protected $table = '';
private $values = array(), $types = '';
Method _hashHTMLBlocks_inHTML
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
#
# Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags.
#
# * Calls $hash_method to convert any blocks.
Function compile
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function compile($args, $compiler, $parameter)
{
$tpl = $compiler->template;
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
- 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 generateUpToDateMimeArray
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateUpToDateMimeArray()
{
$preamble = "<?php\n\n";
$preamble .= "/*\n";
$preamble .= " * This file is part of SwiftMailer.\n";
Smarty_Internal_Configfileparser
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class Smarty_Internal_Configfileparser#line 80 "smarty_internal_configfileparser.php"
{
#line 14 "smarty_internal_configfileparser.y"
// states whether the parse was successful or not
_MarkdownExtra_TmpImpl
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
### Configuration Variables ###
# Prefix for footnote ids.
Function decodeProperties
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function decodeProperties($properties, $cache = false)
{
$this->has_nocache_code = $properties['has_nocache_code'];
$this->properties['nocache_hash'] = $properties['nocache_hash'];
if (isset($properties['cache_lifetime'])) {
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
function run_0013() {
// Ugly but haven't found a better way
global $setting, $config, $user, $mysqli;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 189.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
function run_0014() {
// Ugly but haven't found a better way
global $setting, $config, $user, $mysqli;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 189.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File transaction.class.php
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
$defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
class Transaction extends Base {
protected $table = 'transactions';
File NTLMAuthenticator.php
has 380 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of SwiftMailer.
* (c) 2004-2009 Chris Corbyn
Function to_smarty_php
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function to_smarty_php()
{
$code = '';
for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
if ($key + 2 < $cnt) {
- 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 smarty_modifier_escape
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true)
{
static $_double_encode = null;
if ($_double_encode === null) {
$_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');
Smarty_Internal_Configfilelexer
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class Smarty_Internal_Configfilelexer
{
public $data;
public $counter;
Swift_Mime_SimpleMessage
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime_Message
{
/**
* Create a new SimpleMessage with $headers, $encoder and $cache.
*
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function getLastRegisteredUsers($limit=10,$start=0) {
$this->debug->append("STA " . __METHOD__, 4);
$invitation = new Invitation();
$invitation->setMysql($this->mysqli);
$invitation->setDebug($this->debug);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 183.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function getTopInviters($limit=10,$start=0) {
$this->debug->append("STA " . __METHOD__, 4);
$invitation = new Invitation();
$invitation->setMysql($this->mysqli);
$invitation->setDebug($this->debug);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 183.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76