Application/Api/Document/Standard/Repository/Gradebook/Gradebook.php
Function setContent
has a Cognitive Complexity of 259 (exceeds 5 allowed). Consider refactoring. Open
Open
private function setContent(
TblDivision $tblDivision,
TblSubject $tblSubject,
TblSubjectGroup $tblSubjectGroup = null,
TblPeriod $tblPeriod,
- 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 setContent
has 660 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function setContent(
TblDivision $tblDivision,
TblSubject $tblSubject,
TblSubjectGroup $tblSubjectGroup = null,
TblPeriod $tblPeriod,
File Gradebook.php
has 811 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace SPHERE\Application\Api\Document\Standard\Repository\Gradebook;
use SPHERE\Application\Document\Generator\Repository\Document;
use SPHERE\Application\Document\Generator\Repository\Element;
Method buildPage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function buildPage(
TblDivisionSubject $tblDivisionSubject,
TblPeriod $tblPeriod,
$isLastPeriod = false
) {
Avoid deeply nested control flow statements. Open
Open
if (($tblGrade = \SPHERE\Application\Education\Graduation\Gradebook\Gradebook::useService()
->getGradeByTestAndStudent($tblTest, $tblPerson))
&& $tblGrade->getGrade() !== false && $tblGrade->getGrade() !== null
) {
$grade = $tblGrade->getDisplayGrade();
Method setHeaderTest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private function setHeaderTest(Section $section, $text, $width, $isBold = false, $hasBorderRight = false)
Method setContent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
TblDivision $tblDivision,
TblSubject $tblSubject,
TblSubjectGroup $tblSubjectGroup = null,
TblPeriod $tblPeriod,
$isLastPeriod = false
Function buildDocument
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function buildDocument($pageList = array())
{
$document = new Document();
foreach ($pageList as $subjectPages) {
- 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"