symphony/lib/toolkit/class.emailhelper.php
Function qpContentTransferEncode
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function qpContentTransferEncode($input, $max_length = 76)
{
$qpHexDigits = '0123456789ABCDEF';
$input_length = strlen($input);
$line_limit = $max_length;
- 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 qEncode
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function qEncode($input, $max_length = 75)
{
// Don't encode empty strings
if (empty($input)) {
return $input;
- 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 qEncode
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function qEncode($input, $max_length = 75)
{
// Don't encode empty strings
if (empty($input)) {
return $input;
Method qpContentTransferEncode
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function qpContentTransferEncode($input, $max_length = 76)
{
$qpHexDigits = '0123456789ABCDEF';
$input_length = strlen($input);
$line_limit = $max_length;
Consider simplifying this complex logical expression. Open
Open
if (48 <= $ascii && $ascii <= 57 || 65 <= $ascii && $ascii <= 90 || 97 <= $ascii && $ascii <= 122) {
$replace_length = 1;
$replace_char = $char;
// Encode space as underscore (means better readability for humans)