CORE-POS/IS4C

View on GitHub

Showing 8,297 of 8,298 total issues

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

class WFC_Dark_ServiceCase_12UP_PDF extends FpdfWithBarcode
{
    private $tagdate;
    public function setTagDate($str){
        $this->tagdate = $str;
fannie/admin/labels/pdf_layouts/WFC_Dark_HFM_12UP.php on lines 10..42
fannie/admin/labels/pdf_layouts/WFC_Dark_Simple_24UP.php on lines 10..42

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

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

    foreach ($accounts as $account){
        echo "<br /><b>Total for $account</b>";
        $totalR = $dbc->execute($totalQ,array($account,$span[0],$span[1],$store));
        $data = array();
        while ($totalW=$dbc->fetch_row($totalR)){
Severity: Major
Found in fannie/reports/Store-Specific/WFC/EOM-Nabs/index.php and 1 other location - About 1 day to fix
fannie/reports/Store-Specific/WFC/EOM-Nabs/anydate.php on lines 186..205

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

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

    foreach ($accounts as $account){
        echo "<br /><b>Total for $account</b>";
        $totalR = $dbc->execute($totalQ,array($account,$span[0],$span[1],$store));
        $data = array();
        while ($totalW=$dbc->fetch_row($totalR)){
Severity: Major
Found in fannie/reports/Store-Specific/WFC/EOM-Nabs/anydate.php and 1 other location - About 1 day to fix
fannie/reports/Store-Specific/WFC/EOM-Nabs/index.php on lines 220..239

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

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

class WFC_Dark_HFM_12UP_PDF extends FpdfWithBarcode
{
    private $tagdate;
    public function setTagDate($str){
        $this->tagdate = $str;
Severity: Major
Found in fannie/admin/labels/pdf_layouts/WFC_Dark_HFM_12UP.php and 2 other locations - About 1 day to fix
fannie/admin/labels/pdf_layouts/WFC_Dark_ServiceCase_12UP.php on lines 10..42
fannie/admin/labels/pdf_layouts/WFC_Dark_Simple_24UP.php on lines 10..42

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

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

class WFC_Dark_Simple_24UP_PDF extends FpdfWithBarcode
{
    private $tagdate;
    public function setTagDate($str){
        $this->tagdate = $str;
Severity: Major
Found in fannie/admin/labels/pdf_layouts/WFC_Dark_Simple_24UP.php and 2 other locations - About 1 day to fix
fannie/admin/labels/pdf_layouts/WFC_Dark_HFM_12UP.php on lines 10..42
fannie/admin/labels/pdf_layouts/WFC_Dark_ServiceCase_12UP.php on lines 10..42

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

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

    function body_content()
    {
        ?>
        <div class="baseHeight">
        <div class="listbox">
Severity: Major
Found in pos/is4c-nf/gui-modules/rplist.php and 2 other locations - About 1 day to fix
pos/is4c-nf/gui-modules/TransList.php on lines 158..214
pos/is4c-nf/gui-modules/giftReceiptList.php on lines 139..194

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

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

    function body_content()
    {
        ?>
        <div class="baseHeight">
        <div class="listbox">
Severity: Major
Found in pos/is4c-nf/gui-modules/TransList.php and 2 other locations - About 1 day to fix
pos/is4c-nf/gui-modules/giftReceiptList.php on lines 139..194
pos/is4c-nf/gui-modules/rplist.php on lines 173..230

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

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

    function body_content()
    {
        ?>
        <div class="baseHeight">
        <div class="listbox">
Severity: Major
Found in pos/is4c-nf/gui-modules/giftReceiptList.php and 2 other locations - About 1 day to fix
pos/is4c-nf/gui-modules/TransList.php on lines 158..214
pos/is4c-nf/gui-modules/rplist.php on lines 173..230

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

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

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

    Copyright 2007,2010 Whole Foods Co-op

Severity: Major
Found in pos/is4c-nf/plugins/Paycards/MercuryGift.php - About 1 day to fix

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

        public function fetch_report_data()
        {
            $this->month = FormLib::get('month', date('n'));
            $this->year = FormLib::get('year', date('Y'));
    
    
    Severity: Major
    Found in fannie/reports/Paycards/PcMonthlyReport.php - About 1 day to fix

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

              while($row = $dbc->fetchRow($costsR)){
                  if ($curSuper != $row['sid']){
                      $curSuper = $row['sid'];
                  }
                  if (!isset($supers[$curSuper])) {
      Severity: Major
      Found in fannie/reports/StoreSummary/StoreSummaryReportAlt.php and 1 other location - About 1 day to fix
      fannie/reports/StoreSummary/StoreSummaryReport.php on lines 255..282

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

      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

              while($row = $dbc->fetchRow($costsR)){
                  if ($curSuper != $row['sid']){
                      $curSuper = $row['sid'];
                  }
                  if (!isset($supers[$curSuper])) {
      Severity: Major
      Found in fannie/reports/StoreSummary/StoreSummaryReport.php and 1 other location - About 1 day to fix
      fannie/reports/StoreSummary/StoreSummaryReportAlt.php on lines 218..245

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

      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 getCustomerForm has 292 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getCustomerForm($orderID,$memNum="0")
      {
          global $FANNIE_OP_DB, $TRANS, $FANNIE_TRANS_DB, $canEdit;
          $dbc = FannieDB::get($FANNIE_OP_DB);
      
      
      Severity: Major
      Found in fannie/ordering/ajax-calls.php - About 1 day to fix

        File GoEMerchant.php has 651 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*******************************************************************************
        
            Copyright 2007,2010 Whole Foods Co-op
        
        
        Severity: Major
        Found in pos/is4c-nf/plugins/Paycards/GoEMerchant.php - About 1 day to fix

          Function generateWFC_Produce_SmartSigns_label has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
          Open

          function generateWFC_Produce_SmartSigns_label($x, $y, $guide, $width, $height, $pdf, $row, $dbc, $showPrice, $offset, $tagNo, $lc)
          {
              $pdf->SetFont('Gill','', 16);
              if (!defined('FPDF_FONTPATH')) {
                  define('FPDF_FONTPATH', __DIR__. '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/');
          Severity: Minor
          Found in fannie/admin/labels/pdf_layouts/WFC_Produce_SmartSigns.php - About 1 day 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

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

              protected function get_id_view()
              {
                  $dbc = CTDB::get();
                  $nameP = $dbc->prepare("SELECT RecipeName, Instructions FROM Recipe WHERE RecipeID=?");
                  $recipe= $dbc->getRow($nameP, array($this->id));
          Severity: Major
          Found in fannie/admin/labels/pdf_layouts/Cheftec_Signs_4UP.php and 1 other location - About 1 day to fix
          fannie/modules/plugins2.0/ChefTec/CTRecipes.php on lines 249..294

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

          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_id_view()
              {
                  $dbc = CTDB::get();
                  $nameP = $dbc->prepare("SELECT RecipeName, Instructions FROM Recipe WHERE RecipeID=?");
                  $recipe= $dbc->getRow($nameP, array($this->id));
          Severity: Major
          Found in fannie/modules/plugins2.0/ChefTec/CTRecipes.php and 1 other location - About 1 day to fix
          fannie/admin/labels/pdf_layouts/Cheftec_Signs_4UP.php on lines 394..439

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

          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 BsonReader.cs has 646 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          using System;
          using System.Collections.Generic;
          using System.Globalization;
          using System.Text;
          using System.IO;

            File ConvertUtils.cs has 645 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            using System;
            using System.Collections.Generic;
            using System.Globalization;
            using System.ComponentModel;
            #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)

              File VendorIndexPage.php has 643 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /*******************************************************************************
              
                  Copyright 2009,2013 Whole Foods Co-op
              
              
              Severity: Major
              Found in fannie/item/vendors/VendorIndexPage.php - About 1 day to fix
                Severity
                Category
                Status
                Source
                Language