Function getStudentGradeList
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
public function getStudentGradeList($TaskId = false)
{
$tblTask = Evaluation::useService()->getTaskById($TaskId);
if (!$tblTask) {
- 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 getStudentExistInTaskList
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
public function getStudentExistInTaskList($TaskId = false)
{
$tblTask = Evaluation::useService()->getTaskById($TaskId);
if (!$tblTask) {
return false;
- 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 getStudentGradeList
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStudentGradeList($TaskId = false)
{
$tblTask = Evaluation::useService()->getTaskById($TaskId);
if (!$tblTask) {
Method getStudentExistInTaskList
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStudentExistInTaskList($TaskId = false)
{
$tblTask = Evaluation::useService()->getTaskById($TaskId);
if (!$tblTask) {
return false;
Function createGradeListCsv
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function createGradeListCsv($Period, $TaskId)
{
$PeopleGradeList = $this->getStudentGradeList($TaskId);
- 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 createGradeListCsv
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createGradeListCsv($Period, $TaskId)
{
$PeopleGradeList = $this->getStudentGradeList($TaskId);
Avoid deeply nested control flow statements. Open
if ($tblGradeList) {
foreach ($tblGradeList as $tblGrade) {
$tblPersonStudent = $tblGrade->getServiceTblPerson();
if ($tblPersonStudent) {
Avoid deeply nested control flow statements. Open
if ($GradeList) {
foreach ($GradeList as $Grade) {
// stop search if every Person got found
if (empty($PersonList)) {
break;