Function mailWrapper
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function mailWrapper($to, $subject = '(No subject)', $message = '', $aImagesToEmbed = [], $aFilesToAttach = []) {
$mail = new \PHPMailer;
$mail->CharSet = 'UTF-8';
$mail->isMail();
- 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 mailWrapper
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mailWrapper($to, $subject = '(No subject)', $message = '', $aImagesToEmbed = [], $aFilesToAttach = []) {
$mail = new \PHPMailer;
$mail->CharSet = 'UTF-8';
$mail->isMail();
Method getPurifier
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPurifier($purpose)
{
$purifier_config = \HTMLPurifier_Config::createDefault();
$purifier_config->set('Core.Encoding', 'UTF-8');
$purifier_config->set('Cache.SerializerPath', PATH_PURIFIERCACHE);
Method mailWrapper
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function mailWrapper($to, $subject = '(No subject)', $message = '', $aImagesToEmbed = [], $aFilesToAttach = []) {
Function getPurifier
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getPurifier($purpose)
{
$purifier_config = \HTMLPurifier_Config::createDefault();
$purifier_config->set('Core.Encoding', 'UTF-8');
$purifier_config->set('Cache.SerializerPath', PATH_PURIFIERCACHE);
- 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 getSignedGlideURL
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getSignedGlideURL($file, $width = 0, $height = 0)
{
$urlBuilder = \League\Glide\Urls\UrlBuilderFactory::create('', $this->secrets['glide_signkey']);
$param = [];
- 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"