CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/ReverseTransaction/ReverseTransPage.php

Summary

Maintainability
C
1 day
Test Coverage

Method post_date_trans_store_handler has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function post_date_trans_store_handler()
    {
        global $FANNIE_OP_DB, $FANNIE_TRANS_DB, $FANNIE_PLUGIN_SETTINGS;
        $dbc = FannieDB::get($FANNIE_OP_DB);
        $dlog = DTransactionsModel::selectDtrans($this->date);
Severity: Major
Found in fannie/modules/plugins2.0/ReverseTransaction/ReverseTransPage.php - About 3 hrs to fix

    Method get_date_trans_store_handler has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function get_date_trans_store_handler()
        {
            global $FANNIE_OP_DB;
            $dbc = FannieDB::get($FANNIE_OP_DB);
            $dlog = DTransactionsModel::selectDlog($this->date);
    Severity: Major
    Found in fannie/modules/plugins2.0/ReverseTransaction/ReverseTransPage.php - About 2 hrs to fix

      Function get_date_trans_store_handler has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          function get_date_trans_store_handler()
          {
              global $FANNIE_OP_DB;
              $dbc = FannieDB::get($FANNIE_OP_DB);
              $dlog = DTransactionsModel::selectDlog($this->date);
      Severity: Minor
      Found in fannie/modules/plugins2.0/ReverseTransaction/ReverseTransPage.php - About 2 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

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

          function get_view()
          {
              $this->addScript('js/reverse.js?date=20180202');
              $store = FormLib::storePicker();
              ob_start();
      Severity: Minor
      Found in fannie/modules/plugins2.0/ReverseTransaction/ReverseTransPage.php - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status