DerDu/SPHERE-Framework

View on GitHub
Application/Education/Graduation/Evaluation/Service/Entity/TblTask.php

Summary

Maintainability
C
7 hrs
Test Coverage

TblTask has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class TblTask extends Element
{

    const ATTR_TBL_TEST_TYPE = 'tblTestType';
    const ATTR_SERVICE_TBL_PERIOD = 'serviceTblPeriod';

    Function getServiceTblPeriodByDivision has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getServiceTblPeriodByDivision(TblDivision $tblDivision)
        {
    
            if ($this->serviceTblPeriod < 0) {
                if (($tblLevel = $tblDivision->getTblLevel())

    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 isInEditPeriod has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function isInEditPeriod()
        {
    
            if ($this->getFromDate() && $this->getToDate()){
                $fromDate = $this->FromDate;

    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 isAfterEditPeriod has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function isAfterEditPeriod()
        {
    
            if ($this->getFromDate()){
                $toDate = $this->ToDate;
    Severity: Minor
    Found in Application/Education/Graduation/Evaluation/Service/Entity/TblTask.php - About 45 mins to fix

    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 isBeforeEditPeriod has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function isBeforeEditPeriod()
        {
    
            if ($this->getFromDate()){
                $fromDate = $this->FromDate;
    Severity: Minor
    Found in Application/Education/Graduation/Evaluation/Service/Entity/TblTask.php - About 45 mins to fix

    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

    There are no issues that match your filters.

    Category
    Status