CORE-POS/IS4C

View on GitHub
fannie/admin/LookupReceipt/RenderReceiptPage.php

Summary

Maintainability
D
1 day
Test Coverage
D
63%

File RenderReceiptPage.php has 359 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
include(dirname(__FILE__) . '/../../config.php');
if (!class_exists('FannieAPI')) {
    include_once(__DIR__ . '/../../classlib2.0/FannieAPI.php');
}
Severity: Minor
Found in fannie/admin/LookupReceipt/RenderReceiptPage.php - About 4 hrs to fix

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

        function receiptHeader($date,$trans) 
        {
            $totime = strtotime($date);
            list($emp_no, $reg_no, $trans_no) = explode('-', $trans, 3);
            $store = FormLib::get('store', false);
    Severity: Major
    Found in fannie/admin/LookupReceipt/RenderReceiptPage.php - About 2 hrs to fix

      Method ccInfo has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function ccInfo($date1, $transNum)
          {
              $dbc = $this->connection;
              $dateInt = str_replace("-","",$date1);
              list($emp,$reg,$trans) = explode("-", $transNum, 3);
      Severity: Minor
      Found in fannie/admin/LookupReceipt/RenderReceiptPage.php - About 1 hr to fix

        Method receipt_to_table has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function receipt_to_table($query,$args,$border,$bgcolor)
            {
                $dbc = $this->connection;
                $dbc->selectDB($this->config->get('TRANS_DB'));
                $prep = $dbc->prepare($query); 
        Severity: Minor
        Found in fannie/admin/LookupReceipt/RenderReceiptPage.php - About 1 hr to fix

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

              function get_view()
              {
                  $ret = $this->changeReceiptForm();
                  $date1 = $this->getReceiptDate($this->form);
                  try {
          Severity: Minor
          Found in fannie/admin/LookupReceipt/RenderReceiptPage.php - About 1 hr to fix

            Function ccInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                function ccInfo($date1, $transNum)
                {
                    $dbc = $this->connection;
                    $dateInt = str_replace("-","",$date1);
                    list($emp,$reg,$trans) = explode("-", $transNum, 3);
            Severity: Minor
            Found in fannie/admin/LookupReceipt/RenderReceiptPage.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 receipt_to_table has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                function receipt_to_table($query,$args,$border,$bgcolor)
                {
                    $dbc = $this->connection;
                    $dbc->selectDB($this->config->get('TRANS_DB'));
                    $prep = $dbc->prepare($query); 
            Severity: Minor
            Found in fannie/admin/LookupReceipt/RenderReceiptPage.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 get_view has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                function get_view()
                {
                    $ret = $this->changeReceiptForm();
                    $date1 = $this->getReceiptDate($this->form);
                    try {
            Severity: Minor
            Found in fannie/admin/LookupReceipt/RenderReceiptPage.php - About 35 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