CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Class HidStream has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

    [ComVisible(true), Guid("0C263D05-0D58-4c6c-AEA7-EB9E0C5338A2")]
    public abstract class HidStream : Stream
    {
        int _opened, _closed;
        volatile int _refCount;
Severity: Minor
Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/HidSharp/HidStream.cs - About 2 hrs to fix

    Class SPH_Datacap_Gen2 has 23 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class SPH_Datacap_Gen2 : SerialPortHandler 
    {
        private DsiEMVX emv_ax_control = null;
        private DsiPDCX pdc_ax_control = null;
        private string device_identifier = null;
    Severity: Minor
    Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Datacap_Gen2.cs - About 2 hrs to fix

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

          static private function getCaseSize($dbc, $upc, $sku, $vendorID)
          {
              if (self::$lookups === null) { 
                  $vend = $dbc->prepare('
                      SELECT units 
      Severity: Major
      Found in fannie/modules/plugins2.0/UnfiInvoiceGrabber/UIGLib.php and 1 other location - About 2 hrs to fix
      fannie/modules/plugins2.0/UnfiInvoiceGrabber/MyUIGLib.php on lines 167..196

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

      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

              if (CoreLocal::get("enableFranking") != 1) {
                  /*
                   * This is the same as defaultPrompt() above,
                   * but the inheritence structure makes calling
                   * it trickier than it should be
      Severity: Major
      Found in pos/is4c-nf/lib/Tenders/TenderModule.php and 1 other location - About 2 hrs to fix
      pos/is4c-nf/lib/Tenders/TenderModule.php on lines 250..264

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

      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

          static private function getCaseSize($dbc, $upc, $sku, $vendorID)
          {
              if (self::$lookups === null) { 
                  $vend = $dbc->prepare('
                      SELECT units 
      Severity: Major
      Found in fannie/modules/plugins2.0/UnfiInvoiceGrabber/MyUIGLib.php and 1 other location - About 2 hrs to fix
      fannie/modules/plugins2.0/UnfiInvoiceGrabber/UIGLib.php on lines 181..210

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

      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

          public function defaultPrompt()
          {
              $amt = $this->DefaultTotal();
              CoreLocal::set('boxMsg',
                  '<br />'
      Severity: Major
      Found in pos/is4c-nf/lib/Tenders/TenderModule.php and 1 other location - About 2 hrs to fix
      pos/is4c-nf/lib/Tenders/TenderModule.php on lines 284..302

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

      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

                  } else {
                      $numTrans[2] += $row[2];
                      $avgTender[2] += $row[3] * $row[2];
                      $avgItemQty[2] += $row[4] * $row[2];
                      $avgItemTtl[2] += $row[5] * $row[2];
      fannie/modules/plugins2.0/CoreWarehouse/reports/CWTransactionsReport.php on lines 113..127

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

      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

          private function sortIngredients($ing)
          {
              $compare = function($a, $b) {
                  if ($a['volume'] < $b['volume']) {
                      return 1;
      Severity: Major
      Found in fannie/modules/plugins2.0/ChefTec/CTRecipes.php and 1 other location - About 2 hrs to fix
      fannie/admin/labels/pdf_layouts/Cheftec_Signs_4UP.php on lines 297..318

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

      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

          public function sortIngredients($ing)
          {
              $compare = function($a, $b) {
                  if ($a['volume'] < $b['volume']) {
                      return 1;
      Severity: Major
      Found in fannie/admin/labels/pdf_layouts/Cheftec_Signs_4UP.php and 1 other location - About 2 hrs to fix
      fannie/modules/plugins2.0/ChefTec/CTRecipes.php on lines 152..173

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

      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

                  if ($row[1] == 'Yes') {
                      $numTrans[1] += $row[2];
                      $avgTender[1] += $row[3] * $row[2];
                      $avgItemQty[1] += $row[4] * $row[2];
                      $avgItemTtl[1] += $row[5] * $row[2];
      fannie/modules/plugins2.0/CoreWarehouse/reports/CWTransactionsReport.php on lines 120..127

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

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

          private function handleResponseVoid($vdResult)
          {
              $json = json_decode($vdResult['response'], true);
      
              // initialize
      Severity: Major
      Found in pos/is4c-nf/plugins/Paycards/ValueLink.php - About 2 hrs to fix

        Method preprocess has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function preprocess()
            {
                $this->boxColor = "coloredArea";
                $this->msg = _("Undo transaction");
        
        
        Severity: Major
        Found in pos/is4c-nf/gui-modules/undo.php - About 2 hrs to fix

          Method writeLine has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function writeLine($text, $to=false)
              {
                  $text = substr($text,0,strlen($text)-2);
                  if (CoreLocal::get("print") != 0 && $to !== false) {
          
          
          Severity: Major
          Found in pos/is4c-nf/lib/PrintHandlers/HtmlEmailPrintHandler.php - About 2 hrs to fix

            Method run has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function run()
                {
                    $dbc = FannieDB::get($this->config->get('OP_DB'));
                    $this->clearEntries($dbc, $this->store_id, $this->vendor_id);
                    $this->deepClean($dbc, $this->store_id, $this->vendor_id);
            Severity: Major
            Found in fannie/cron/tasks/InventoryTask.php - About 2 hrs to fix

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

                  public function fetch_report_data()
                  {
                      $dbc = $this->connection;
                      $dbc->setDefaultDB($this->config->get('OP_DB'));
                      $date1 = $this->form->date1;
              Severity: Major
              Found in fannie/reports/TaxCollected/TaxCollectedReport.php - About 2 hrs to fix

                Method getTransactions has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function getTransactions($date_id, $store, $processor, $invertReturns=false)
                    {
                        // voids have trans_id from original dtrans record, not void dtrans record
                        $invert = $invertReturns ? "'VOID','Return'" : "'VOID'";
                        $mercuryQ = "
                Severity: Major
                Found in fannie/reports/Paycards/PcDailyReport.php - About 2 hrs to fix

                  Method generateMirrorMeatTagSN has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

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

                        protected function get_view()
                        {
                            $batchR = $this->connection->query("SELECT batchID, batchName, endDate FROM batches WHERE batchName LIKE '%FRESH DEAL%' ORDER BY batchID DESC");
                            $opts = '';
                            while ($row = $this->connection->fetchRow($batchR)) {
                    Severity: Major
                    Found in fannie/modules/plugins2.0/FreshDeals/FreshDealsData.php - About 2 hrs to fix

                      Method javascript_content has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function javascript_content(){
                              ob_start();
                              ?>
                              ZeroClipboard.setMoviePath( '../src/ZeroClipboard10.swf' );
                              var clip = new ZeroClipboard.Client();
                      Severity: Major
                      Found in fannie/modules/plugins2.0/TimesheetPlugin/TsWagesReport.php - About 2 hrs to fix

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

                            protected function get_id_view(){
                                ob_start();
                                echo '<tr><td>';
                        
                                $totals = array('cash'=>0.00,'equity'=>0.00);
                        Severity: Major
                        Found in fannie/modules/plugins2.0/PIKiller/PIPatronagePage.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language