Function body_content
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function body_content()
{
$edit = FannieAuth::validateUserQuiet('edit_employees');
$sort = $this->getSort();
- 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 body_content
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function body_content()
{
$edit = FannieAuth::validateUserQuiet('edit_employees');
$sort = $this->getSort();
Function checkAuth
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function checkAuth()
{
$ALL = FannieAuth::validateUserQuiet('view_all_hours');
if (!$ALL){
$valid_depts = array(10,11,12,13,20,21,30,40,50,60,998);
- 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
File WfcHtListPage.php
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2013 Whole Foods Co-op
Function preprocess
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function preprocess()
{
if (FormLib::get('showdept') !== '') {
$this->selected_dept = FormLib::get('showdept');
if (!empty($this->selected_dept) && $this->selected_dept != -1){
- 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 preprocess
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function preprocess()
{
if (FormLib::get('showdept') !== '') {
$this->selected_dept = FormLib::get('showdept');
if (!empty($this->selected_dept) && $this->selected_dept != -1){
Method checkAuth
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkAuth()
{
$ALL = FannieAuth::validateUserQuiet('view_all_hours');
if (!$ALL){
$valid_depts = array(10,11,12,13,20,21,30,40,50,60,998);
Avoid too many return
statements within this method. Open
return 'e.name';
Avoid too many return
statements within this method. Open
return 'h.totalhours';
Avoid too many return
statements within this method. Open
return 'u.hours';