CORE-POS/IS4C

View on GitHub

Showing 8,297 of 8,298 total issues

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

            if ($count % 16 == 0) {
                $pdf->AddPage();
                // draw tick marks for cutting
                $pdf->Line(2, $height+1.5, 6, $height+1.5);
                $pdf->Line(2, (2*$height)+1.5, 6, (2*$height)+1.5);
fannie/modules/plugins2.0/CoopDealsSigns/CoopDeals16UpDarkP.php on lines 38..54

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

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 VPBPIV.php has 886 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Copyright 2010 Whole Foods Co-op

Severity: Major
Found in fannie/batches/UNFI/VPBPIV.php - About 2 days to fix

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

                if (isset($batchUPCs[$row['upc']]) && !$row['likecoded']) {
                    $background = 'selection';
                } elseif (in_array($row['priceRuleTypeID'], $acceptPrtID) || $row['variable_pricing'] == 0 && $row['normal_price'] < 10.00) {
                    $background = (
                        ($row['normal_price']+0.10 < $row['rawSRP'])
    Severity: Major
    Found in fannie/batches/UNFI/VPBPIII.php and 3 other locations - About 2 days to fix
    fannie/batches/UNFI/VPBPIV.php on lines 901..926
    fannie/batches/UNFI/VPBPV.php on lines 958..983
    fannie/batches/UNFI/VendorPricingBatchPage.php on lines 325..350

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

    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

                if (isset($batchUPCs[$row['upc']]) && !$row['likecoded']) {
                    $background = 'selection';
                } elseif (in_array($row['priceRuleTypeID'], $acceptPrtID) || $row['variable_pricing'] == 0 && $row['normal_price'] < 10.00) {
                    $background = (
                        ($row['normal_price']+0.10 < $row['rawSRP'])
    Severity: Major
    Found in fannie/batches/UNFI/VPBPV.php and 3 other locations - About 2 days to fix
    fannie/batches/UNFI/VPBPIII.php on lines 803..828
    fannie/batches/UNFI/VPBPIV.php on lines 901..926
    fannie/batches/UNFI/VendorPricingBatchPage.php on lines 325..350

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

    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

                if (isset($batchUPCs[$row['upc']]) && !$row['likecoded']) {
                    $background = 'selection';
                } elseif (in_array($row['priceRuleTypeID'], $acceptPrtID) || $row['variable_pricing'] == 0 && $row['normal_price'] < 10.00) {
                    $background = (
                        ($row['normal_price']+0.10 < $row['rawSRP'])
    Severity: Major
    Found in fannie/batches/UNFI/VPBPIV.php and 3 other locations - About 2 days to fix
    fannie/batches/UNFI/VPBPIII.php on lines 803..828
    fannie/batches/UNFI/VPBPV.php on lines 958..983
    fannie/batches/UNFI/VendorPricingBatchPage.php on lines 325..350

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

    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

                if (isset($batchUPCs[$row['upc']]) && !$row['likecoded']) {
                    $background = 'selection';
                } elseif (in_array($row['priceRuleTypeID'], $acceptPrtID) || $row['variable_pricing'] == 0 && $row['normal_price'] < 10.00) {
                    $background = (
                        ($row['normal_price']+0.10 < $row['rawSRP'])
    Severity: Major
    Found in fannie/batches/UNFI/VendorPricingBatchPage.php and 3 other locations - About 2 days to fix
    fannie/batches/UNFI/VPBPIII.php on lines 803..828
    fannie/batches/UNFI/VPBPIV.php on lines 901..926
    fannie/batches/UNFI/VPBPV.php on lines 958..983

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

    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 RpDirectPage.php has 883 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    include(__DIR__ . '/../../../config.php');
    if (!class_exists('FannieAPI')) {
        include(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
    Severity: Major
    Found in fannie/modules/plugins2.0/RP/RpDirectPage.php - About 2 days to fix

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

          private function createBatch($dbc, $i)
          {
              $upcs = $this->upcs;
              $date = new DateTime();
              $name = "UNFI ROUNDING FIXER ".$date->format('Y-m-d')." [$i]";
      Severity: Major
      Found in fannie/item/RoundingFixerTool.php and 1 other location - About 2 days to fix
      fannie/admin/labels/pdf_layouts/Cheftec_Signs_4UP.php on lines 100..107

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

      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

              if ($week) {
                  $projected = number_format($week['sales']);
                  $baseRetain = $week['retention'];
                  $days = json_decode($week['segmentation'], true);
                  $days = array_map(function ($i) { return sprintf('%.2f%%', $i*100); }, $days);
      Severity: Major
      Found in fannie/modules/plugins2.0/RP/RpDualPage.php and 2 other locations - About 2 days to fix
      fannie/modules/plugins2.0/RP/RpDirectPage.php on lines 738..770
      fannie/modules/plugins2.0/RP/RpOrderPage.php on lines 664..696

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

      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

              if ($week) {
                  $projected = number_format($week['sales']);
                  $baseRetain = $week['retention'];
                  $days = json_decode($week['segmentation'], true);
                  $days = array_map(function ($i) { return sprintf('%.2f%%', $i*100); }, $days);
      Severity: Major
      Found in fannie/modules/plugins2.0/RP/RpOrderPage.php and 2 other locations - About 2 days to fix
      fannie/modules/plugins2.0/RP/RpDirectPage.php on lines 738..770
      fannie/modules/plugins2.0/RP/RpDualPage.php on lines 693..725

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

      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

              if ($week) {
                  $projected = number_format($week['sales']);
                  $baseRetain = $week['retention'];
                  $days = json_decode($week['segmentation'], true);
                  $days = array_map(function ($i) { return sprintf('%.2f%%', $i*100); }, $days);
      Severity: Major
      Found in fannie/modules/plugins2.0/RP/RpDirectPage.php and 2 other locations - About 2 days to fix
      fannie/modules/plugins2.0/RP/RpDualPage.php on lines 693..725
      fannie/modules/plugins2.0/RP/RpOrderPage.php on lines 664..696

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

      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

      Method showBatchDisplay has 425 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function showBatchDisplay($id, $order='natural')
          {
              global $FANNIE_SERVER_DBMS,$FANNIE_URL;
              $dbc = $this->connection;
              $uid = getUID($this->current_user);
      Severity: Major
      Found in fannie/batches/newbatch/EditBatchPage.php - About 2 days to fix

        Function batchEdit has 420 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var batchEdit = (function ($) {
            var mod = {};
        
            var alerthi = function() {
                alert('hi');
        Severity: Major
        Found in fannie/batches/newbatch/edit.js - About 2 days to fix

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

              protected function get_searchVendor_handler()
              {
                  $query = "SELECT * FROM vendorItems WHERE (description LIKE ? OR brand LIKE ?)";
                  $args = array('%' . $this->searchVendor . '%', '%' . $this->searchVendor . '%');
                  if (FormLib::get('vendorID')) {
          Severity: Major
          Found in fannie/modules/plugins2.0/RP/RpOrderPage.php and 1 other location - About 2 days to fix
          fannie/modules/plugins2.0/RP/RpDualPage.php on lines 173..232

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

          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

              protected function get_searchVendor_handler()
              {
                  $query = "SELECT * FROM vendorItems WHERE (description LIKE ? OR brand LIKE ?)";
                  $args = array('%' . $this->searchVendor . '%', '%' . $this->searchVendor . '%');
                  if (FormLib::get('vendorID')) {
          Severity: Major
          Found in fannie/modules/plugins2.0/RP/RpDualPage.php and 1 other location - About 2 days to fix
          fannie/modules/plugins2.0/RP/RpOrderPage.php on lines 174..233

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

          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 RpDualPage.php has 866 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          include(__DIR__ . '/../../../config.php');
          if (!class_exists('FannieAPI')) {
              include(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
          Severity: Major
          Found in fannie/modules/plugins2.0/RP/RpDualPage.php - About 2 days to fix

            Function orderView has 413 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var orderView = (function($) {
                var mod = {};
                var forceUPC = true;
            
                mod.forceUPC = function(f) {
            Severity: Major
            Found in fannie/ordering/orderview.js - About 2 days to fix

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

                  function getIncoming(min, max) {
                      var store = $('select[name=store]').val();
                      $.ajax({
                          type: 'get',
                          data: 'date1='+min+'&date2='+max+'&store='+store,
              Severity: Major
              Found in fannie/modules/plugins2.0/RP/rpOrder.js and 1 other location - About 2 days to fix
              fannie/modules/plugins2.0/RP/rpDual.js on lines 103..131

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

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

                  function getIncoming(min, max) {
                      var store = $('select[name=store]').val();
                      $.ajax({
                          type: 'get',
                          data: 'date1='+min+'&date2='+max+'&store='+store,
              Severity: Major
              Found in fannie/modules/plugins2.0/RP/rpDual.js and 1 other location - About 2 days to fix
              fannie/modules/plugins2.0/RP/rpOrder.js on lines 101..129

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

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

              <?php
              /*******************************************************************************
              
                  Copyright 2013 Whole Foods Co-op
              
              
              Severity: Major
              Found in pos/is4c-nf/lib/models/trans/MemDiscountRemoveModel.php and 1 other location - About 2 days to fix
              pos/is4c-nf/lib/models/trans/MemDiscountAddModel.php on lines 1..157

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

              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

              Severity
              Category
              Status
              Source
              Language