CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/HrWeb/IllnessLog/IllnessLogsPage.php

Summary

Maintainability
D
1 day
Test Coverage

Method get_view has 137 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function get_view()
    {
        $editCSS = 'collapse';
        $includeList = false;
        if (FannieAuth::validateUserQuiet('hr_editor') || FannieAuth::validateUserQuiet('illness_editor')) {
Severity: Major
Found in fannie/modules/plugins2.0/HrWeb/IllnessLog/IllnessLogsPage.php - About 5 hrs to fix

    Function get_view has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function get_view()
        {
            $editCSS = 'collapse';
            $includeList = false;
            if (FannieAuth::validateUserQuiet('hr_editor') || FannieAuth::validateUserQuiet('illness_editor')) {
    Severity: Minor
    Found in fannie/modules/plugins2.0/HrWeb/IllnessLog/IllnessLogsPage.php - About 3 hrs 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

    File IllnessLogsPage.php has 300 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    include(__DIR__ . '/../../../../config.php');
    if (!class_exists('FannieAPI')) {
        include(__DIR__ . '/../../../../classlib2.0/FannieAPI.php');
    Severity: Minor
    Found in fannie/modules/plugins2.0/HrWeb/IllnessLog/IllnessLogsPage.php - About 3 hrs to fix

      Method get_id_view has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function get_id_view()
          {
              if (!FannieAuth::validateUserQuiet('hr_editor') && !FannieAuth::validateUserQuiet('illness_editor')) {
                  return '<div class="alert alert-danger">You do not have access to this</div>';
              }
      Severity: Major
      Found in fannie/modules/plugins2.0/HrWeb/IllnessLog/IllnessLogsPage.php - About 2 hrs to fix

        There are no issues that match your filters.

        Category
        Status