CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

File SyncFromSearch.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Copyright 2013 Whole Foods Community Co-op

Severity: Minor
Found in fannie/item/hobartcsv/SyncFromSearch.php - About 3 hrs to fix

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

    function delEntry(id){
        if (!confirm("Delete this eval score")) return false;
    
        $.ajax({
            type: 'get',
    Severity: Major
    Found in fannie/modules/plugins2.0/WfcHoursTracking/eval/view.js and 1 other location - About 3 hrs to fix
    fannie/modules/plugins2.0/WfcHoursTracking/eval/view.js on lines 95..106

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

    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

                for (i=0; i<sIDs.length; i++) {
                    var elemID = sIDs[i];
                    if (state['secFarms'][elemID] !== '') {
                        var field = document.getElementById(elemID);
                        if (field) {
    Severity: Major
    Found in fannie/modules/plugins2.0/RP/rpDirect.js and 1 other location - About 3 hrs to fix
    fannie/modules/plugins2.0/RP/rpDirect.js on lines 176..184

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

    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

                for (i=0; i<pIDs.length; i++) {
                    var elemID = pIDs[i];
                    if (state['priFarms'][elemID] !== '') {
                        var field = document.getElementById(elemID);
                        if (field) {
    Severity: Major
    Found in fannie/modules/plugins2.0/RP/rpDirect.js and 1 other location - About 3 hrs to fix
    fannie/modules/plugins2.0/RP/rpDirect.js on lines 187..195

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

    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 deleteComment(id){
        if (!confirm("Delete this comment")) return false;
    
        $.ajax({
            type: 'delete',
    Severity: Major
    Found in fannie/modules/plugins2.0/WfcHoursTracking/eval/view.js and 1 other location - About 3 hrs to fix
    fannie/modules/plugins2.0/WfcHoursTracking/eval/view.js on lines 82..94

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

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

    static private function addItem($strupc, $strdescription, $strtransType, $strtranssubType, $strtransstatus, $intdepartment, $dblquantity, $dblunitPrice, $dbltotal, $dblregPrice, $intscale, $inttax, $intfoodstamp, $dbldiscount, $dblmemDiscount, $intdiscountable, $intdiscounttype, $dblItemQtty, $intvolDiscType, $intvolume, $dblVolSpecial, $intmixMatch, $intmatched, $intvoided, $cost=0, $numflag=0, $charflag='') 
    {
        //$dbltotal = MiscLib::truncate2(str_replace(",", "", $dbltotal)); replaced by apbw 7/27/05 with the next 4 lines -- to fix thousands place errors
        $dbltotal = self::formatDouble($dbltotal);
        $dblunitPrice = self::formatDouble($dblunitPrice);
    Severity: Major
    Found in pos/is4c-nf/lib/TransRecord.php - About 3 hrs to fix

      Method addItem has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function addItem(array $row, $quantity, $priceObj)
          {
              if ($quantity == 0) return false;
      
              // enforce limit on discounting sale items
      Severity: Major
      Found in pos/is4c-nf/lib/Scanning/PriceMethods/MoreThanQttyPM.php - About 3 hrs to fix

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

            public function run()
            {
                global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
                $dbc = FannieDB::get($FANNIE_OP_DB);
                $local_dtrans = $FANNIE_TRANS_DB . $dbc->sep() . 'dtransactions';
        Severity: Major
        Found in fannie/cron/tasks/PullRemoteTransactionsTask.php - About 3 hrs to fix

          Method process_file has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function process_file($linedata, $indexes)
              {
                  $dbc = $this->connection;
                  $VENDOR_ID = $this->getVendorID();
                  if ($VENDOR_ID === false) {
          Severity: Major
          Found in fannie/batches/UNFI/load-classes/KeheUploadPage.php - About 3 hrs to fix

            Method getBatchHistory has 76 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getBatchHistory($bid)
                {
                    global $FANNIE_OP_DB;
                    $dbc = FannieDB::get($FANNIE_OP_DB);
            
            
            Severity: Major
            Found in fannie/batches/batchhistory/BatchHistoryPage.php - About 3 hrs to fix

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

                  function get_view()
                  {
                      $value = FormLib::get_form_value('id');
                      $this->add_onload_command('$(\'#memnum\').val($(\'#sel\').val());');
                      $this->addScript('../../src/javascript/vue.js');
              Severity: Major
              Found in fannie/admin/GenericBilling/GenericBillingPage.php - About 3 hrs to fix

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

                    function preprocess(){
                        global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
                        $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
                
                        if (!$this->current_user && $_GET['login'] == 1 ){
                Severity: Major
                Found in fannie/modules/plugins2.0/TimesheetPlugin/ViewsheetPage.php - About 3 hrs to fix

                  Method getItemRow has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function getItemRow($item)
                      {
                          $item = $item->toStdClass();
                          $item->metadata = json_decode($item->metadata, true);
                          $ret = <<<HTML
                  Severity: Major
                  Found in fannie/modules/plugins2.0/MenuScreens/MSItems.php - About 3 hrs to fix

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

                        public function run()
                        {
                            $settings = $this->config->get('PLUGIN_SETTINGS');
                    
                            $user = $settings['MercatoBotUser'];
                    Severity: Major
                    Found in fannie/modules/plugins2.0/Mercato/MOrderBotTask.php - About 3 hrs to fix

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

                          function preprocess(){
                              global $FANNIE_PLUGIN_SETTINGS;
                              $this->status = 'waiting - no input';
                      
                              /**
                      Severity: Major
                      Found in fannie/modules/plugins2.0/ShelfAudit/SaScanningPage.php - About 3 hrs to fix

                        Method drawPDF has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function drawPDF()
                            {
                                $pdf = new \FPDF('P', 'mm', 'Letter');
                        
                                $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
                        Severity: Major
                        Found in fannie/classlib2.0/item/signage/MovementTags.php - About 3 hrs to fix

                          Method ReadAttributeElements has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  private Dictionary<string, string> ReadAttributeElements(JsonReader reader, XmlNamespaceManager manager)
                                  {
                                      Dictionary<string, string> attributeNameValues = new Dictionary<string, string>();
                                      bool finishedAttributes = false;
                                      bool finishedElement = false;

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

                            foreach ($aisles as $arr) {
                                $min = $arr[2];
                                $max = $arr[3];
                                foreach (range($min, $max) as $v) {
                                    $data[$i]['subsection'] = $arr[1]."$v";
                            Severity: Major
                            Found in fannie/admin/labels/pdf_layouts/WFC_Aisle_Tags.php and 2 other locations - About 3 hrs to fix
                            fannie/admin/labels/pdf_layouts/FPDF_EditPage.php on lines 28..39
                            fannie/admin/labels/pdf_layouts/WFC_AnythingOnATag.php on lines 32..43

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

                            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

                            foreach ($aisles as $arr) {
                                $min = $arr[2];
                                $max = $arr[3];
                                foreach (range($min, $max) as $v) {
                                    $data[$i]['subsection'] = $arr[1]."$v";
                            Severity: Major
                            Found in fannie/admin/labels/pdf_layouts/FPDF_EditPage.php and 2 other locations - About 3 hrs to fix
                            fannie/admin/labels/pdf_layouts/WFC_Aisle_Tags.php on lines 118..129
                            fannie/admin/labels/pdf_layouts/WFC_AnythingOnATag.php on lines 32..43

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

                            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

                            foreach ($aisles as $arr) {
                                $min = $arr[2];
                                $max = $arr[3];
                                foreach (range($min, $max) as $v) {
                                    $data[$i]['subsection'] = $arr[1]."$v";
                            Severity: Major
                            Found in fannie/admin/labels/pdf_layouts/WFC_AnythingOnATag.php and 2 other locations - About 3 hrs to fix
                            fannie/admin/labels/pdf_layouts/FPDF_EditPage.php on lines 28..39
                            fannie/admin/labels/pdf_layouts/WFC_Aisle_Tags.php on lines 118..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 142.

                            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