Function send_emails
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function send_emails()
{
if(empty($_REQUEST['subject'])){
return Notification::show_edit_email('You must fill in the subject line of the email.', '', $_REQUEST['body']);
} else if(empty($_REQUEST['body'])){
- Read upRead up
- Create a ticketCreate a ticket
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 show_select_hall
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function show_select_hall()
{
/*
if(!\Current_User::allow('hms', 'email_hall')){
return \PHPWS_Template::process($tpl, 'hms', 'admin/permission_denied.tpl');
- Read upRead up
- Create a ticketCreate a ticket
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 send_emails
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send_emails()
{
if(empty($_REQUEST['subject'])){
return Notification::show_edit_email('You must fill in the subject line of the email.', '', $_REQUEST['body']);
} else if(empty($_REQUEST['body'])){
- Create a ticketCreate a ticket
Method show_review_email
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show_review_email()
{
$tpl = array();
if(is_array($_REQUEST['hall'])){
foreach($_REQUEST['hall'] as $hall){
- Create a ticketCreate a ticket
Method show_select_hall
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show_select_hall()
{
/*
if(!\Current_User::allow('hms', 'email_hall')){
return \PHPWS_Template::process($tpl, 'hms', 'admin/permission_denied.tpl');
- Create a ticketCreate a ticket
Function show_review_email
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function show_review_email()
{
$tpl = array();
if(is_array($_REQUEST['hall'])){
foreach($_REQUEST['hall'] as $hall){
- Read upRead up
- Create a ticketCreate a ticket
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 too many return
statements within this method. Open
return Notification::show_confirmation();
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return '<h1>Unkown Op</h1>';
- Create a ticketCreate a ticket