CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

        while($row = $dbc->fetch_row($posR)){
            $d = $row[0]."-".str_pad($row[1],2,'0',STR_PAD_LEFT)."-".str_pad($row[2],2,'0',STR_PAD_LEFT);
            if (!isset($dailies[$d])) $dailies[$d] = array(0,0);
            $dailies[$d][1] = $row[3];
        }
fannie/modules/plugins2.0/OverShortTools/OverShortSafecountPage.php on lines 470..474
fannie/modules/plugins2.0/OverShortTools/OverShortSafecountV2.php on lines 342..346

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 137.

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 3 locations. Consider refactoring.
Open

        while($row = $dbc->fetch_row($posR)){
            $d = $row[0]."-".str_pad($row[1],2,'0',STR_PAD_LEFT)."-".str_pad($row[2],2,'0',STR_PAD_LEFT);
            if (!isset($dailies[$d])) $dailies[$d] = array(0,0);
            $dailies[$d][1] = $row[3];
        }
fannie/modules/plugins2.0/OverShortTools/OverShortSafecountPage.php on lines 470..474
fannie/modules/plugins2.0/OverShortTools/OverShortSafecountV3.php on lines 351..355

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 137.

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 3 locations. Consider refactoring.
Open

    protected function get_resultID_view()
    {
        $table = $this->config->get('TRANS_DB') . $this->connection->sep() . 'PaycardTransactions';
        $prep = $this->connection->prepare("SELECT * FROM {$table} WHERE storeRowID=? and dateID=?");
        $row = $this->connection->getRow($prep, array($this->resultID, date('Ymd')));
Severity: Major
Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php and 2 other locations - About 2 hrs to fix
fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php on lines 68..82
fannie/modules/plugins2.0/PaycardFix/PaycardFixVoid.php on lines 53..67

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 137.

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 3 locations. Consider refactoring.
Open

    protected function get_resultID_view()
    {
        $table = $this->config->get('TRANS_DB') . $this->connection->sep() . 'PaycardTransactions';
        $prep = $this->connection->prepare("SELECT * FROM {$table} WHERE storeRowID=? and dateID=?");
        $row = $this->connection->getRow($prep, array($this->resultID, date('Ymd')));
Severity: Major
Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixVoid.php and 2 other locations - About 2 hrs to fix
fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php on lines 68..82
fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php on lines 68..82

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 137.

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

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

<?php
/*******************************************************************************

    Copyright 2009,2013 Whole Foods Co-op

Severity: Major
Found in fannie/batches/UNFI/VendorPricingIndex.php and 3 other locations - About 2 hrs to fix
fannie/batches/CAP/CapSalesIndexPage.php on lines 1..75
fannie/mem/MemCorrectionIndex.php on lines 1..67
fannie/mem/MemberIndexPage.php on lines 1..76

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 137.

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 2 locations. Consider refactoring.
Open

    private function getDrawer()
    {
        /**
          Find a drawer for the cashier
        */
Severity: Major
Found in pos/is4c-nf/ajax/AjaxLogin.php and 1 other location - About 2 hrs to fix
pos/is4c-nf/gui-modules/login2.php on lines 179..197

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 137.

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    $fieldNames = "  ".substr("Time".$blank, 0, 10)
            .substr("Lane".$blank, 0, 8)
            .substr("Trans #".$blank, 0, 8)
            .substr("Emp #".$blank, 0, 10)
            .substr("Mem #".$blank, 0, 10)
pos/is4c-nf/lib/ReceiptBuilding/TenderReports/WefcTorontoTenderReport.php on lines 199..204
pos/is4c-nf/lib/ReceiptBuilding/TenderReports/WefcTorontoTenderReport.php on lines 410..415

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 137.

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    $fieldNames = "  ".substr("Time".$blank, 0, 10)
            .substr("Lane".$blank, 0, 8)
            .substr("Trans #".$blank, 0, 10)
            .substr("Emp #".$blank, 0, 8)
            .substr("Mem #".$blank, 0, 11)
pos/is4c-nf/lib/ReceiptBuilding/TenderReports/WefcTorontoTenderReport.php on lines 410..415
pos/is4c-nf/lib/ReceiptBuilding/TenderReports/YPSITenderReport.php on lines 161..166

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 137.

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    $fieldNames = "  ".substr("Time".$blank, 0, 10)
            .substr("Lane".$blank, 0, 8)
            .substr("Trans #".$blank, 0, 10)
            .substr("Emp #".$blank, 0, 8)
            .substr("Mem #".$blank, 0, 11)
pos/is4c-nf/lib/ReceiptBuilding/TenderReports/WefcTorontoTenderReport.php on lines 199..204
pos/is4c-nf/lib/ReceiptBuilding/TenderReports/YPSITenderReport.php on lines 161..166

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 137.

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

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

<?php
/*******************************************************************************

    Copyright 2007 Alberta Cooperative Grocery, Portland, Oregon.

Severity: Major
Found in fannie/mem/MemCorrectionIndex.php and 3 other locations - About 2 hrs to fix
fannie/batches/CAP/CapSalesIndexPage.php on lines 1..75
fannie/batches/UNFI/VendorPricingIndex.php on lines 1..108
fannie/mem/MemberIndexPage.php on lines 1..76

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 137.

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 2 locations. Consider refactoring.
Open

    private function getDrawer()
    {
        /**
          Find a drawer for the cashier
        */
Severity: Major
Found in pos/is4c-nf/gui-modules/login2.php and 1 other location - About 2 hrs to fix
pos/is4c-nf/ajax/AjaxLogin.php on lines 31..49

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 137.

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

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

<?php
/*******************************************************************************

    Copyright 2013 Whole Foods Co-op

Severity: Major
Found in fannie/batches/CAP/CapSalesIndexPage.php and 3 other locations - About 2 hrs to fix
fannie/batches/UNFI/VendorPricingIndex.php on lines 1..108
fannie/mem/MemCorrectionIndex.php on lines 1..67
fannie/mem/MemberIndexPage.php on lines 1..76

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 137.

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

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

<?php
/*******************************************************************************

    Copyright 2010 Whole Foods Co-op, Duluth, MN

Severity: Major
Found in fannie/mem/MemberIndexPage.php and 3 other locations - About 2 hrs to fix
fannie/batches/CAP/CapSalesIndexPage.php on lines 1..75
fannie/batches/UNFI/VendorPricingIndex.php on lines 1..108
fannie/mem/MemCorrectionIndex.php on lines 1..67

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 137.

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

File CoopDealsReviewPage.php has 282 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*******************************************************************************

    Copyright 2009,2013 Whole Foods Co-op

Severity: Minor
Found in fannie/batches/CAP/CoopDealsReviewPage.php - About 2 hrs to fix

    File New_WFC_Deli_Short.php has 282 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    if (!class_exists('FpdfWithBarcode')) {
        include(dirname(__FILE__) . '/../FpdfWithBarcode.php');
    }
    if (!class_exists('FannieAPI')) {
    Severity: Minor
    Found in fannie/admin/labels/pdf_layouts/New_WFC_Deli_Short.php - About 2 hrs to fix

      File SkuMapPage.php has 282 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*******************************************************************************
      
          Copyright 2014 Foods Co-op
      
      
      Severity: Minor
      Found in fannie/item/vendors/SkuMapPage.php - About 2 hrs to fix

        File PluRangePage.php has 282 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*******************************************************************************
        
            Copyright 2014 Whole Foods Co-op, Duluth, MN
        
        
        Severity: Minor
        Found in fannie/item/PluRangePage.php - About 2 hrs to fix

          Method fetch_report_data has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function fetch_report_data()
              {        
                  
                  $item = array();
                  $dbc = $this->connection;
          Severity: Major
          Found in fannie/reports/VariableItems/VariableItems.php - About 2 hrs to fix

            Method generateSimpleTag2 has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function generateSimpleTag2($x, $y, $guide, $width, $height, $pdf, $row, $dbc)
            {
                $upc = $row['upc'];
                $desc = $row['description'];
                $args = array($row['upc']);
            Severity: Major
            Found in fannie/admin/labels/pdf_layouts/WFC_Dark_Simple_24UP.php - About 2 hrs to fix

              Method WFC_MEAT_14UP has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function WFC_MEAT_14UP($data,$offset=0,$showPrice=0)
              {
                  $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
                  $pdf = new WFC_MEAT_14UP_PDF('L','mm','Letter');
                  $pdf->AddPage();
              Severity: Major
              Found in fannie/admin/labels/pdf_layouts/WFC_MEAT_14UP.php - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language