CORE-POS/IS4C

View on GitHub

Showing 8,297 of 8,298 total issues

Method WFC_Hybrid has 381 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function WFC_Hybrid($data,$offset=0){

$pdf=new WFC_Hybrid_PDF('P','mm','Letter'); //start new instance of PDF
$pdf->Open(); //open new PDF Document
$pdf->setTagDate(date("m/d/Y"));
Severity: Major
Found in fannie/admin/labels/pdf_layouts/WFC_Hybrid.php - About 1 day to fix

    File InstallIndexPage.php has 800 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*******************************************************************************
    
        Copyright 2011 Whole Foods Co-op
    
    
    Severity: Major
    Found in fannie/install/InstallIndexPage.php - About 1 day to fix

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

              while ($row = $dbc->fetchRow($res)) {
                  $rID = $row['RecordID'];
      
                  /**
                   * Initialize record if needed with name and null weight, volume
      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 209..248

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

      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 ($valid === false) {
                  echo PaycardLib::paycardMsgBox("Invalid Amount: $amt",
                      $validmsg, "[clear] to cancel");
              } elseif ($balanceLimit > 0) {
                  $msg = "Tender ".PaycardLib::moneyFormat($amt);
      Severity: Major
      Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvPage.php and 1 other location - About 1 day to fix
      pos/is4c-nf/plugins/Paycards/gui/paycardboxMsgAuth.php on lines 103..135

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

      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($res)) {
                  $rID = $row['RecordID'];
      
                  /**
                   * Initialize record if needed with name and null weight, volume
      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 80..119

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

      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 ($valid === false) {
                  echo PaycardLib::paycardMsgBox("Invalid Amount: $amt",
                      $validmsg, "[clear] to cancel");
              } elseif ($balanceLimit > 0) {
                  $msg = "Tender ".PaycardLib::moneyFormat($amt);
      Severity: Major
      Found in pos/is4c-nf/plugins/Paycards/gui/paycardboxMsgAuth.php and 1 other location - About 1 day to fix
      pos/is4c-nf/plugins/Paycards/gui/PaycardEmvPage.php on lines 172..204

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

      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

          protected byte[] ManualEntryExp(){
              byte[] ret = new byte[70];
      
              int pos = 0;
              ret[pos++] = 0x75;
      pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1524..1617
      pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1714..1807

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

      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

          protected byte[] ManualEntryPAN(){
              byte[] ret = new byte[68];
      
              int pos = 0;
              ret[pos++] = 0x75;
      pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1619..1712
      pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1714..1807

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

      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

          protected byte[] ManualEntryCVV(){
              byte[] ret = new byte[75];
      
              int pos = 0;
              ret[pos++] = 0x75;
      pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1524..1617
      pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1619..1712

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

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

      <?php
      /*******************************************************************************
      
          Copyright 2010 Whole Foods Co-op
      
      
      Severity: Major
      Found in pos/is4c-nf/lib/Scanning/SpecialUPCs/HouseCoupon.php - About 1 day to fix

        File MercuryDC.php has 790 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        use COREPOS\pos\lib\Database;
        use COREPOS\pos\lib\ReceiptLib;
        use COREPOS\pos\lib\TransRecord;
        Severity: Major
        Found in pos/is4c-nf/plugins/Paycards/MercuryDC.php - About 1 day to fix

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

              public function fetch_report_data()
              {
                  global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
                  $dbc = $this->connection;
                  $dbc->selectDB($this->config->get('OP_DB'));
          Severity: Major
          Found in fannie/reports/OwnerJoinLeave/OwnerJoinLeaveReport.php - About 1 day to fix

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

                protected function get_id_store_export_handler()
                {
                    $lcP = $this->connection->prepare('
                        SELECT l.likeCode
                        FROM LikeCodeActiveMap AS l
            Severity: Major
            Found in fannie/item/likecodes/LikeCodeSKUsPage.php and 1 other location - About 1 day to fix
            fannie/item/likecodes/LikeCodeBatchPage.php on lines 135..202

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

            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_store_export_handler()
                {
                    $lcP = $this->connection->prepare('
                        SELECT l.likeCode
                        FROM LikeCodeActiveMap AS l
            Severity: Major
            Found in fannie/item/likecodes/LikeCodeBatchPage.php and 1 other location - About 1 day to fix
            fannie/item/likecodes/LikeCodeSKUsPage.php on lines 24..91

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

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

                public function getTable()
                {
                    $this->addScript('pricing-batch-II.js');
                    $dbc = $this->connection;
                    $dbc->selectDB($this->config->OP_DB);
            Severity: Major
            Found in fannie/batches/UNFI/VPBPV.php - About 1 day to fix

              File ReflectionUtils.cs has 781 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

                Function outputPDF has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
                Open

                    function outputPDF(){
                        global $FANNIE_PLUGIN_SETTINGS;
                        $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['OverShortDatabase']);
                        $start = FormLib::get_form_value('startDate');
                        $end = FormLib::get_form_value('endDate');
                Severity: Minor
                Found in fannie/modules/plugins2.0/OverShortTools/OverShortDepositSlips.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

                Function ajax_save_program has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function ajax_save_program(){
                
                        global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
                
                        $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['CoopCredDatabase']);
                Severity: Minor
                Found in fannie/modules/plugins2.0/CoopCred/programs/CoopCredProgramEditor.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

                function updateOpenSafeCount(d){
                    var newval = Number(document.getElementById('safeCount1'+d).value);
                    
                    var v = newval;
                    var elem = document.getElementById('changeOrder'+d);
                Severity: Major
                Found in fannie/modules/plugins2.0/OverShortTools/js/countV3.js and 1 other location - About 1 day to fix
                fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 120..144

                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

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

                function updateOpenSafeCount(d){
                    var newval = Number(document.getElementById('safeCount1'+d).value);
                    
                    var v = newval;
                    var elem = document.getElementById('changeOrder'+d);
                Severity: Major
                Found in fannie/modules/plugins2.0/OverShortTools/js/countV2.js and 1 other location - About 1 day to fix
                fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 123..147

                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

                Severity
                Category
                Status
                Source
                Language