CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/WfcHoursTracking/eval/WfcHtEvalView.php

Summary

Maintainability
C
1 day
Test Coverage

File WfcHtEvalView.php has 276 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/WfcHoursTracking/eval/WfcHtEvalView.php - About 2 hrs to fix

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

        protected function get_id_view()
        {
            $this->addScript('view.js?date=20180117');
            $settings = $this->config->get('PLUGIN_SETTINGS');
            $dbc = $this->connection;
    Severity: Major
    Found in fannie/modules/plugins2.0/WfcHoursTracking/eval/WfcHtEvalView.php - About 2 hrs to fix

      Method empInfo has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function empInfo($dbc, $id)
          {
              $ret = "<table class=\"table table-bordered\">";
              $q = $dbc->prepare("SELECT e.name,i.positions,i.nextEval,i.hireDate,i.nextTypeID FROM employees as e
                  left join evalInfo as i on e.empID=i.empID
      Severity: Minor
      Found in fannie/modules/plugins2.0/WfcHoursTracking/eval/WfcHtEvalView.php - About 1 hr to fix

        Method get_addForm_handler has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function get_addForm_handler()
            {
                $ret = "<table>";
                $ret .= "<tr class=\"form-inline\">";
                $ret .= "<td><select class=\"form-control input-sm\" id=addmonth>";
        Severity: Minor
        Found in fannie/modules/plugins2.0/WfcHoursTracking/eval/WfcHtEvalView.php - About 1 hr to fix

          Method post_id_handler has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function post_id_handler()
              {
                  $month = isset($_REQUEST['month'])?$_REQUEST['month']:'';
                  $year = isset($_REQUEST['year'])?$_REQUEST['year']:'';
                  $pos = $_REQUEST['pos'];
          Severity: Minor
          Found in fannie/modules/plugins2.0/WfcHoursTracking/eval/WfcHtEvalView.php - About 1 hr to fix

            Function post_id_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function post_id_handler()
                {
                    $month = isset($_REQUEST['month'])?$_REQUEST['month']:'';
                    $year = isset($_REQUEST['year'])?$_REQUEST['year']:'';
                    $pos = $_REQUEST['pos'];
            Severity: Minor
            Found in fannie/modules/plugins2.0/WfcHoursTracking/eval/WfcHtEvalView.php - About 25 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