CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method YPSI_BulkLabel has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

$pdf=new YPSI_BulkLabel_PDF('P','mm','Letter'); //start new instance of PDF
$pdf->Open(); //open new PDF Document
$pdf->SetTopMargin(40);  //Set top margin of the page
Severity: Major
Found in fannie/admin/labels/pdf_layouts/YPSI_BulkLabel.php - About 3 hrs to fix

    Method post_handler has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function post_handler()
        {
            $dateID = str_replace('-', '', FormLib::get('date'));
            $ref =trim(FormLib::get('ref'));
            $xml = trim(FormLib::get('xml'));
    Severity: Major
    Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixResult.php - About 3 hrs to fix

      Method get_orders has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function get_orders($placed, $store=0, $month=0, $year=0)
          {
              $dbc = $this->connection;
              $store = FormLib::get('store', $store);
      
      
      Severity: Major
      Found in fannie/purchasing/ViewPurchaseOrders.php - About 3 hrs to fix

        Method pushTable has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            static public function pushTable($table,$db='op',$truncate=self::TRUNCATE_DESTINATION,$includeOffline=false)
            {
                $config = \FannieConfig::factory();
                $op_db = $config->get('OP_DB');
                $trans_db = $config->get('TRANS_DB');
        Severity: Major
        Found in fannie/classlib2.0/data/SyncLanes.php - About 3 hrs to fix

          Method TryParseDateIso has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  internal static bool TryParseDateIso(string text, DateParseHandling dateParseHandling, DateTimeZoneHandling dateTimeZoneHandling, out object dt)
                  {
                      DateTimeParser dateTimeParser = new DateTimeParser();
                      if (!dateTimeParser.Parse(text))
                      {

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

                    while($w = $dbc->fetch_row($skuR)){
                        $result = array(
                        'sku' => $w['sku'],
                        'title' => '['.$w['vendorName'].'] '.$w['brand'].' - '.$w['description'],
                        'unitSize' => $w['size'],   
            Severity: Major
            Found in fannie/purchasing/EditManyPurchaseOrders.php and 1 other location - About 3 hrs to fix
            fannie/purchasing/EditManyPurchaseOrders.php on lines 83..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 150.

            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

                    while($w = $dbc->fetch_row($upcR)){
                        $result = array(
                        'sku' => $w['sku'],
                        'title' => '['.$w['vendorName'].'] '.$w['brand'].' - '.$w['description'],
                        'unitSize' => $w['size'],   
            Severity: Major
            Found in fannie/purchasing/EditManyPurchaseOrders.php and 1 other location - About 3 hrs to fix
            fannie/purchasing/EditManyPurchaseOrders.php on lines 59..70

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

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

            <?php
            /*******************************************************************************
            
                Copyright 2014 Whole Foods Co-op, Duluth, MN
            
            
            Severity: Minor
            Found in fannie/classlib2.0/item/HobartDgwLib.php - About 3 hrs to fix

              Method addItem has 27 arguments (exceeds 4 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='') 
              Severity: Major
              Found in pos/is4c-nf/lib/TransRecord.php - About 3 hrs to fix

                File memlist.php has 307 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /*******************************************************************************
                
                   Copyright 2010 Whole Foods Co-op
                
                
                Severity: Minor
                Found in pos/is4c-nf/gui-modules/memlist.php - About 3 hrs to fix

                  File NutriFacts.php has 307 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /*******************************************************************************
                  
                      Copyright 2013 Whole Foods Community Co-op
                  
                  
                  Severity: Minor
                  Found in fannie/item/images/NutriFacts.php - About 3 hrs to fix

                    Method wicReceiptHandler has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function wicReceiptHandler($dbc, $xml, $transID)
                        {
                            if ($xml->query('/RStream/TranResponse/TranCode') == 'ReverseSale') {
                                $clearP = $dbc->prepare('DELETE FROM EmvReceipt WHERE dateID=? AND empNo=? AND registerNo=? AND transNo=? AND transID=?');
                                $dbc->execute($clearP, array(
                    Severity: Major
                    Found in pos/is4c-nf/plugins/Paycards/MercuryDC.php - About 3 hrs to fix

                      Method sendAuth has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function sendAuth()
                          {
                              $dbTrans = PaycardLib::paycard_db();
                              if( !$dbTrans){
                                  $this->conf->reset();
                      Severity: Major
                      Found in pos/is4c-nf/plugins/Paycards/FirstData.php - About 3 hrs to fix

                        Method voidupc has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function voidupc($upc, $json, $itemNum=-1)
                            {
                                $deliflag = false;
                                $quantity = 0;
                        
                        
                        Severity: Major
                        Found in pos/is4c-nf/parser/parse/VoidCmd.php - About 3 hrs to fix

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

                              public function run()
                              {
                                  $dbc = FannieDB::get($this->config->get('TRANS_DB'));
                                  $date = date('Y-m-d', strtotime('yesterday'));
                                  $dlog = DTransactionsModel::selectDlog($date);
                          Severity: Major
                          Found in fannie/cron/tasks/FixRepackWeightsTask.php - About 3 hrs to fix

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

                                public function body_content()
                                {
                                    $dbc = $this->connection;
                                    $dbc->selectDB($this->config->get('OP_DB'));
                                    $transDB = $this->config->get('TRANS_DB') . $dbc->sep();
                            Severity: Major
                            Found in fannie/reports/SalesToday/SalesTodayChartOnly.php - About 3 hrs to fix

                              Method post_id_handler has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function post_id_handler()
                                  {
                                      $shelfLife = FormLib::get('shelfLife', false);
                                      list($inStr, $args) = $this->connection->safeInClause($this->id);
                                      $map = array();
                              Severity: Major
                              Found in fannie/admin/labels/PickTagsPage.php - About 3 hrs to fix

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

                                    public function drawPDF($dbc)
                                    {
                                        $keySize = 15;
                                
                                        $pdf = new FPDF('P', 'mm', 'Letter');
                                Severity: Major
                                Found in fannie/admin/PosKeyboards/PosKeyboard.php - About 3 hrs to fix

                                  Method indexView has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function indexView($uid)
                                      {
                                          global $FANNIE_URL;
                                          $yours = CalendarPluginPermissions::get_own_calendars($uid);
                                          $theirs = CalendarPluginPermissions::get_other_calendars($uid);             
                                  Severity: Major
                                  Found in fannie/modules/plugins2.0/CalendarPlugin/CalendarPluginDisplayLib.php - About 3 hrs to fix

                                    Method post_id_handler has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        protected function post_id_handler()
                                        {
                                            $section = FormLib::get('section');
                                            $store = COREPOS\Fannie\API\lib\Store::getIdByIp();
                                            $super = FormLib::get('super');
                                    Severity: Major
                                    Found in fannie/modules/plugins2.0/ShelfAudit/SaFullPage.php - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language