CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php

Summary

Maintainability
C
7 hrs
Test Coverage

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

    protected function get_view()
    {
        $store = FormLib::get('store');
        if (!$store) {
            $store = COREPOS\Fannie\API\lib\Store::getIdByIp();
Severity: Major
Found in fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php - About 3 hrs to fix

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

        protected function post_handler()
        {
            $store = FormLib::get('store');
            if (!$store) {
                echo 'Invalid entry';
    Severity: Minor
    Found in fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php - About 1 hr to fix

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

              while ($row = $this->connection->fetchRow($manualR)) {
                  $current = $this->connection->getValue($curP, array($store, $row['upc']));
                  $ret .= sprintf('<tr><td>%s<input type="hidden" name="upc[]" value="%s" /></td>
                                      <td>%s</td><td><input type="text" class="form-control input-sm" name="qty[]" value="%.2f" /></td></tr>',
                                      ltrim($row['upc'], '0'), $row['upc'],
      Severity: Major
      Found in fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php and 3 other locations - About 40 mins to fix
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 79..85
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 97..103
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 115..121

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 93.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

              while ($row = $this->connection->fetchRow($manualR)) {
                  $current = $this->connection->getValue($curP, array($store, $row['upc']));
                  $ret .= sprintf('<tr><td>%s<input type="hidden" name="upc[]" value="%s" /></td>
                                      <td>%s</td><td><input type="text" class="form-control input-sm" name="qty[]" value="%.2f" /></td></tr>',
                                      ltrim($row['upc'], '0'), $row['upc'],
      Severity: Major
      Found in fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php and 3 other locations - About 40 mins to fix
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 79..85
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 115..121
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 133..139

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 93.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

              while ($row = $this->connection->fetchRow($manualR)) {
                  $current = $this->connection->getValue($curP, array($store, $row['upc']));
                  $ret .= sprintf('<tr><td>%s<input type="hidden" name="upc[]" value="%s" /></td>
                                      <td>%s</td><td><input type="text" class="form-control input-sm" name="qty[]" value="%.2f" /></td></tr>',
                                      ltrim($row['upc'], '0'), $row['upc'],
      Severity: Major
      Found in fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php and 3 other locations - About 40 mins to fix
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 97..103
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 115..121
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 133..139

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 93.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

              while ($row = $this->connection->fetchRow($manualR)) {
                  $current = $this->connection->getValue($curP, array($store, $row['upc']));
                  $ret .= sprintf('<tr><td>%s<input type="hidden" name="upc[]" value="%s" /></td>
                                      <td>%s</td><td><input type="text" class="form-control input-sm" name="qty[]" value="%.2f" /></td></tr>',
                                      ltrim($row['upc'], '0'), $row['upc'],
      Severity: Major
      Found in fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php and 3 other locations - About 40 mins to fix
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 79..85
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 97..103
      fannie/modules/plugins2.0/ShelfAudit/SaAdjustmentsPage.php on lines 133..139

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 93.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status