CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/OverShortTools/OverShortDepositSlips.php

Summary

Maintainability
F
3 days
Test Coverage

Function outputPDF has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
Open

    function outputPDF(){
        global $FANNIE_PLUGIN_SETTINGS;
        $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['OverShortDatabase']);
        $start = FormLib::get_form_value('startDate');
        $end = FormLib::get_form_value('endDate');
Severity: Minor
Found in fannie/modules/plugins2.0/OverShortTools/OverShortDepositSlips.php - About 1 day 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

Method outputPDF has 206 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function outputPDF(){
        global $FANNIE_PLUGIN_SETTINGS;
        $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['OverShortDatabase']);
        $start = FormLib::get_form_value('startDate');
        $end = FormLib::get_form_value('endDate');
Severity: Major
Found in fannie/modules/plugins2.0/OverShortTools/OverShortDepositSlips.php - About 1 day to fix

    File OverShortDepositSlips.php has 298 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*******************************************************************************
    
        Copyright 2013 Whole Foods Co-op
    
    
    Severity: Minor
    Found in fannie/modules/plugins2.0/OverShortTools/OverShortDepositSlips.php - About 3 hrs to fix

      Method body_content has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function body_content(){
              global $FANNIE_URL, $FANNIE_PLUGIN_SETTINGS;
              $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['OverShortDatabase']);
              $this->addScript('js/count.js');
              ob_start();
      Severity: Major
      Found in fannie/modules/plugins2.0/OverShortTools/OverShortDepositSlips.php - About 2 hrs to fix

        There are no issues that match your filters.

        Category
        Status