CORE-POS/IS4C

View on GitHub
fannie/purchasing/ScanTransferPage.php

Summary

Maintainability
C
1 day
Test Coverage
F
34%

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

    protected function get_view()
    {
        $ret = '<table class="table table-bordered table-striped small">
            <thead><tr>
                <th>Coding</th>
Severity: Major
Found in fannie/purchasing/ScanTransferPage.php - About 2 hrs to fix

    File ScanTransferPage.php has 283 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/purchasing/ScanTransferPage.php - About 2 hrs to fix

      Method post_view has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function post_view()
          {
              try {
                  $from = $this->form->from;
                  $dest = $this->form->to;
      Severity: Major
      Found in fannie/purchasing/ScanTransferPage.php - About 2 hrs to fix

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

            protected function get_id_view()
            {
                $prod = new ProductsModel($this->connection);
                $infoP = $this->connection->prepare('
                    SELECT *
        Severity: Major
        Found in fannie/purchasing/ScanTransferPage.php - About 2 hrs to fix

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

              public function preprocess()
              {
                  if (php_sapi_name() !== 'cli') {
                      if (session_status() == PHP_SESSION_NONE) {
                          session_start();
          Severity: Minor
          Found in fannie/purchasing/ScanTransferPage.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

              protected function get_view()
              {
                  $ret = '<table class="table table-bordered table-striped small">
                      <thead><tr>
                          <th>Coding</th>
          Severity: Minor
          Found in fannie/purchasing/ScanTransferPage.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