Function sendMail
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function sendMail()
{
$mails = 0;
$updates = 0;
$sentMailAddresses = array();
- 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 sendMail
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sendMail()
{
$mails = 0;
$updates = 0;
$sentMailAddresses = array();
Function createToText
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function createToText(array $tokenData, $disabled)
{
$menuFind = false;
if ($disabled) {
- 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 loadFormData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function loadFormData()
{
parent::loadFormData();
//if (!isset($this->formData['to']) || !is_array($this->formData['to'])) {
if (!$this->request->isPost()) {
- 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
Avoid excessively long class names like Gems_Snippets_Mail_TokenBulkMailFormSnippet. Keep class name length under 40. Open
class Gems_Snippets_Mail_TokenBulkMailFormSnippet extends \Gems_Snippets_Mail_MailFormSnippet
{
protected $identifier;
protected $loader;
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}