CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    function fetch_report_data(){
        global $FANNIE_OP_DB, $FANNIE_COOP_ID,
             $FANNIE_TRANS_DB, $FANNIE_URL;

        try {
Severity: Major
Found in fannie/reports/PatronageOverDates/PatronageOverDatesReport.php - About 4 hrs to fix

    File TsAdminView.php has 340 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    include(dirname(__FILE__).'/../../../../config.php');
    if (!class_exists('FannieAPI')) {
        include_once(__DIR__ . '/../../../../classlib2.0/FannieAPI.php');
    }
    Severity: Minor
    Found in fannie/modules/plugins2.0/TimesheetPlugin/admin/TsAdminView.php - About 4 hrs to fix

      File StatementsPluginIndex.php has 340 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*******************************************************************************
      
          Copyright 2014 Whole Foods Co-op
      
      
      Severity: Minor
      Found in fannie/modules/plugins2.0/StatementsPlugin/StatementsPluginIndex.php - About 4 hrs to fix

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

            function fetch_report_data(){
                global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
                $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
                $periodID = FormLib::get_form_value('period',0);
                $this->session->periodID = $periodID;
        Severity: Major
        Found in fannie/modules/plugins2.0/TimesheetPlugin/TimesheetExport.php - About 4 hrs to fix

          Method listItems has 104 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function listItems()
              {
                  // preserve values from re-posting form
                  $overrides = array();
                  $upc = FormLib::get('update_upc', array());
          Severity: Major
          Found in fannie/classlib2.0/item/FannieSignage.php - About 4 hrs to fix

            Method body_content has 104 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function body_content()
                {
                    global $FANNIE_OP_DB;
                    $dbc = FannieDB::get($FANNIE_OP_DB);
                    $def = $dbc->tableDefinition('superDeptNames');
            Severity: Major
            Found in fannie/item/departments/SuperDeptEditor.php - About 4 hrs to fix

              File util.php has 339 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /*******************************************************************************
              
                  Copyright 2010 Whole Foods Co-op
              
              
              Severity: Minor
              Found in fannie/install/util.php - About 4 hrs to fix

                File SaHandheldPage.php has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /*******************************************************************************
                
                    Copyright 2013 Whole Foods Co-op
                
                
                Severity: Minor
                Found in fannie/modules/plugins2.0/ShelfAudit/SaHandheldPage.php - About 4 hrs to fix

                  File MercatoIntake.php has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  class MercatoIntake
                  {
                      private $dbc = null;
                  Severity: Minor
                  Found in fannie/modules/plugins2.0/Mercato/MercatoIntake.php - About 4 hrs to fix

                    File NewStoreFloorsPage.php has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    include(dirname(__FILE__) . '/../../config.php');
                    if (!class_exists('FannieAPI')) {
                        include_once(__DIR__ . '/../../classlib2.0/FannieAPI.php');
                    Severity: Minor
                    Found in fannie/item/mapping/NewStoreFloorsPage.php - About 4 hrs to fix

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

                          if (($row['numflag'] & $organicFlag) != 0) {
                              $pdf->SetFont($font,'B',10);  //Set the font
                              $pdf->Cell($width,4,'ORGANIC',0,1,'L');
                              $descY += 4;
                              $maxLines = 1;
                      Severity: Major
                      Found in fannie/admin/labels/pdf_layouts/WFC_Produce.php and 1 other location - About 4 hrs to fix
                      fannie/admin/labels/pdf_layouts/WFC_Produce_Single.php on lines 127..137

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

                      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 (($row['numflag'] & $organicFlag) != 0) {
                              $pdf->SetFont($font,'B',10);  //Set the font
                              $pdf->Cell($width,4,'ORGANIC',0,1,'L');
                              $descY += 4;
                              $maxLines = 1;
                      Severity: Major
                      Found in fannie/admin/labels/pdf_layouts/WFC_Produce_Single.php and 1 other location - About 4 hrs to fix
                      fannie/admin/labels/pdf_layouts/WFC_Produce.php on lines 133..143

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

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

                          public static function weekView($id, $year, $week)
                          {
                              $sql = CalendarPluginDB::get();
                              $calendarModel = new CalendarsModel($sql);
                              $calendarModel->calendarID($id);
                      Severity: Major
                      Found in fannie/modules/plugins2.0/CalendarPlugin/CalendarPluginDisplayLib.php - About 4 hrs to fix

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

                            function fetch_report_data(){
                        
                                global $FANNIE_ARCHIVE_METHOD, $FANNIE_ARCHIVE_DB,
                                    $FANNIE_OP_DB, $FANNIE_TRANS_DB;
                        
                        

                          Method addUPC has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function addUPC($orderID, $memNum, $upc, $num_cases=1)
                              {
                                  $dbc = $this->connection;
                                  $dbc->selectDB($this->config->get('OP_DB'));
                                  $TRANS = $this->config->get('TRANS_DB') . $dbc->sep();
                          Severity: Major
                          Found in fannie/ordering/OrderViewPage.php - About 4 hrs to fix

                            Method ToObject has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public object ToObject(Type objectType)
                                    {
                                        if (JsonConvert.DefaultSettings == null)
                                        {
                                            bool isEnum;

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

                                  mod.saveShipping = function(s) {
                                      var dstr = 'id='+$('#vendorselect').val()+'&shipping='+s;
                                      $.ajax({
                                          url: 'VendorIndexPage.php',
                                          method: 'post',
                              Severity: Major
                              Found in fannie/item/vendors/index.js and 1 other location - About 4 hrs to fix
                              fannie/item/vendors/index.js on lines 104..115

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

                              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

                                  mod.saveDiscountRate = function(s) {
                                      var dstr = 'id='+$('#vendorselect').val()+'&rate='+s;
                                      $.ajax({
                                          url: 'VendorIndexPage.php',
                                          method: 'post',
                              Severity: Major
                              Found in fannie/item/vendors/index.js and 1 other location - About 4 hrs to fix
                              fannie/item/vendors/index.js on lines 91..102

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

                              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

                                  mod.newDept = function (oid,tid){
                                      var dstr = $('.more-item-info :input').serialize();
                                      $.ajax({
                                          type: 'post',
                                          data: 'orderID='+oid+'&transID='+tid+'&'+dstr
                              Severity: Major
                              Found in fannie/ordering/orderview.js and 1 other location - About 4 hrs to fix
                              fannie/ordering/orderview.js on lines 267..276

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

                              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

                                  mod.newQty = function (oid,tid){
                                      var qty = $('#newqty').val();
                                      $.ajax({
                                          type: 'post',
                                          data: 'orderID='+oid+'&transID='+tid+'&qty='+qty
                              Severity: Major
                              Found in fannie/ordering/orderview.js and 1 other location - About 4 hrs to fix
                              fannie/ordering/orderview.js on lines 277..286

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

                              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