CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method listHouseCoupons has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function listHouseCoupons()
    {
        $FANNIE_URL = $this->config->get('URL');

        $this->addScript($FANNIE_URL . 'src/javascript/fancybox/jquery.fancybox-1.3.4.js?v=1');
Severity: Major
Found in fannie/modules/plugins2.0/HouseCoupon/HouseCouponEditor.php - About 3 hrs to fix

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

        function preprocess(){
            global $FANNIE_AR_DEPARTMENTS;
            global $FANNIE_EQUITY_DEPARTMENTS;
            global $FANNIE_OP_DB;
            global $FANNIE_EMP_NO, $FANNIE_REGISTER_NO;
    Severity: Major
    Found in fannie/mem/correction_pages/MemArEquityDumpTool.php - About 3 hrs to fix

      Method get_upc_view has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function get_upc_view()
          {
              $dbc = FannieDB::get($this->config->get('OP_DB'));
              $newUpc = FormLib::get('newUpc', false);
      
      
      Severity: Major
      Found in fannie/item/addShelfTag.php - About 3 hrs to fix

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

                if (count(isset($locations[$upc]) ? $locations[$upc] : array()) > 1 && $store == 2) {
                    $pdf->SetFillColor(255, 100, 0); // orange
                    $pdf->Circle($baseX+27.5, $baseY-7.5, 1.25, 'F');
                    $pdf->SetTextColor(255,255,255);
                    $pdf->SetFontSize(6);
        Severity: Major
        Found in fannie/admin/labels/pdf_layouts/WFC_Hybrid.php and 1 other location - About 3 hrs to fix
        fannie/admin/labels/pdf_layouts/WFC_Hybrid_Single.php on lines 465..473

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

        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 (count(isset($locations[$upc]) ? $locations[$upc] : array()) > 1 && $store == 2) {
                    $pdf->SetFillColor(255, 100, 0); // orange
                    $pdf->Circle($baseX+27.5, $baseY-7.5, 1.25, 'F');
                    $pdf->SetTextColor(255,255,255);
                    $pdf->SetFontSize(6);
        Severity: Major
        Found in fannie/admin/labels/pdf_layouts/WFC_Hybrid_Single.php and 1 other location - About 3 hrs to fix
        fannie/admin/labels/pdf_layouts/WFC_Hybrid.php on lines 499..507

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

        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

        Class JsonValidatingReader has 31 methods (exceeds 20 allowed). Consider refactoring.
        Open

            public class JsonValidatingReader : JsonReader, IJsonLineInfo
            {
                private class SchemaScope
                {
                    private readonly JTokenType _tokenType;

          Class NativeMethods has 31 methods (exceeds 20 allowed). Consider refactoring.
          Open

              static class NativeMethods
              {
                  const string Libusb = "libusb-1.0";
                  
                  public struct DeviceDescriptor

            Class NativeMethods has 31 methods (exceeds 20 allowed). Consider refactoring.
            Open

                static class NativeMethods
                {
                    const string libc = "libc";
                    const string libudev = "libudev";
            
            

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

                  public function run()
                  {
                      // clean cache
                      $this->cleanFileCache();
              
              
              Severity: Major
              Found in fannie/cron/tasks/SpecialOrdersTask.php - About 3 hrs to fix

                Method WFC_Old has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function WFC_Old($data,$offset=0){
                
                $pdf=new WFC_Old_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/WFC_Old.php - About 3 hrs to fix

                  Method WFC_Standard has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function WFC_Standard($data,$offset=0){
                  
                  $pdf=new WFC_Standard_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/WFC_Standard.php - About 3 hrs to fix

                    File MailChimpTask.php has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

                      Method get_id_loanstatement_handler has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function get_id_loanstatement_handler()
                          {
                              global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
                              $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['GiveUsMoneyDB']);
                              $loan = new GumLoanAccountsModel($dbc);
                      Severity: Major
                      Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumEmailPage.php - About 3 hrs to fix

                        Method import has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            static public function import($filename, $vendorID, $repeat=false)
                            {
                                echo $filename . "\n";
                                global $FANNIE_OP_DB;
                                $dbc = FannieDB::get($FANNIE_OP_DB);
                        Severity: Major
                        Found in fannie/modules/plugins2.0/UnfiInvoiceGrabber/MyUIGLib.php - About 3 hrs to fix

                          Method htmlLine has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function htmlLine($row, $header=False)
                              {
                                  $url = $this->config->get('URL');
                                  $meta = 0;
                                  if (isset($row['meta'])) {
                          Severity: Major
                          Found in fannie/classlib2.0/FannieReportPage.php - About 3 hrs to fix

                            Method pricePerUnit has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function pricePerUnit($price,$sizeStr)
                                {
                                    $country = \FannieConfig::factory()->get('COUNTRY', 'US');
                            
                                    $num = "";
                            Severity: Major
                            Found in fannie/classlib2.0/lib/PriceLib.php - About 3 hrs to fix

                              Method showCategoryItems has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function showCategoryItems($vid,$did,$brand,$ds=-999)
                                  {
                                      global $FANNIE_OP_DB;
                                      $dbc = FannieDB::get($FANNIE_OP_DB);
                              
                              
                              Severity: Major
                              Found in fannie/item/vendors/BrowseVendorItems.php - About 3 hrs to fix

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

                                    public function get_view()
                                    {
                                        $dbc = $this->connection;
                                        $dbc->selectDB($this->config->get('OP_DB'));
                                        // for now, only denfeld is being shown
                                Severity: Major
                                Found in fannie/item/FloorSections/NewPageO.php - About 3 hrs to fix

                                  Method ProcessSchemaProperties has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          private void ProcessSchemaProperties(JObject schemaObject)
                                          {
                                              foreach (KeyValuePair<string, JToken> property in schemaObject)
                                              {
                                                  switch (property.Key)

                                    File ItemMarginModule.php has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    <?php
                                    /*******************************************************************************
                                    
                                        Copyright 2013 Whole Foods Co-op, Duluth, MN
                                    
                                    
                                    Severity: Minor
                                    Found in fannie/item/modules/ItemMarginModule.php - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language