CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method calculateHoldings has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function calculateHoldings($endDate)
    {
        global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
        $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['GiveUsMoneyDB']);
        
Severity: Major
Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumIssueDividendPage.php - About 2 hrs to fix

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

        protected function post_id_handler()
        {
            // forcing sequential requests here
            $_SESSION['appendingOrder'] = true;
    
    
    Severity: Major
    Found in fannie/modules/plugins2.0/RP/RpDirectPage.php - About 2 hrs to fix

      Method etl has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function etl($config)
          {
              $settings = $config->get('PLUGIN_SETTINGS');
              $mydb = $settings['MyWebDB'] . $this->connection->sep();
              $opdb = $config->get('OP_DB') . $this->connection->sep();
      Severity: Major
      Found in fannie/modules/plugins2.0/MyWeb/models/MyReceiptsModel.php - About 2 hrs to fix

        Method refresh_data has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function refresh_data($trans_db, $month, $year, $day=False)
            {
                list($start_id, $start_date, $end_id, $end_date) = $this->dates($month, $year, $day);
        
                $config = FannieConfig::factory();
        Severity: Major
        Found in fannie/modules/plugins2.0/CoreWarehouse/models/WfcTopDaysModel.php - About 2 hrs to fix

          Method get_id_view has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function get_id_view()
              {
                  $model = new NcgCouponsModel($this->connection);
                  $model->couponUPC($this->id);
                  $model->load();
          Severity: Major
          Found in fannie/modules/plugins2.0/NcgCoupons/NcgCouponReport.php - About 2 hrs to fix

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

                function preprocess(){
            
                    global $FANNIE_URL,$FANNIE_PLUGIN_LIST,$FANNIE_PLUGIN_SETTINGS;
            
                    if (!isset($FANNIE_PLUGIN_LIST) || !in_array('CoopCred', $FANNIE_PLUGIN_LIST)) {

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

                  public function get_view()
                  {
                      $dbc = $this->connection;
                      $settings = $this->config->get('PLUGIN_SETTINGS');
                      $dbc->selectDB($settings['VolunteerHoursDB']);
              Severity: Major
              Found in fannie/modules/plugins2.0/VolunteerHours/VhAccountPage.php - About 2 hrs to fix

                Method get_id_view has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function get_id_view()
                    {
                        global $FANNIE_OP_DB;
                        $dbc = FannieDB::get($FANNIE_OP_DB);
                        $userID = FannieAuth::getUID($this->current_user);
                Severity: Major
                Found in fannie/purchasing/EditOnePurchaseOrder.php - About 2 hrs to fix

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

                      public function drawPDF()
                      {
                          $pdf = new \FPDF('P', 'mm', 'Letter');
                  
                          $pdf->SetTopMargin($this->top);  //Set top margin of the page
                  Severity: Major
                  Found in fannie/classlib2.0/item/signage/Tags4x8P.php - About 2 hrs to fix

                    Method get_id_view has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function get_id_view()
                        {
                            $store = FormLib::get('store', false);
                            if (!$store) {
                                $store = Store::getIdByIp();
                    Severity: Major
                    Found in fannie/item/vendors/ParsPage.php - About 2 hrs to fix

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

                          function body_content()
                          {
                              global $FANNIE_OP_DB, $FANNIE_URL;
                              $vid = FormLib::get_form_value('vid');
                              if ($vid === ''){
                      Severity: Major
                      Found in fannie/item/vendors/BrowseVendorItems.php - About 2 hrs to fix

                        Method getExistingItem has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function getExistingItem($upc)
                            {
                                $dbc = $this->db();
                                $itemQ = '
                                    SELECT
                        Severity: Major
                        Found in fannie/item/modules/BaseItemModule.php - About 2 hrs to fix

                          Method SaveFormData has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function SaveFormData($upc){
                                  $upc = BarcodeLib::padUPC($upc);
                                  $ids = FormLib::get_form_value('v_id',array());
                                  $skus = FormLib::get_form_value('v_sku',array());
                                  $costs = FormLib::get_form_value('v_cost',array());
                          Severity: Major
                          Found in fannie/item/modules/VendorItemModule.php - About 2 hrs to fix

                            Method WriteTo has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)
                                    {
                                        if (converters != null && converters.Length > 0 && _value != null)
                                        {
                                            JsonConverter matchingConverter = JsonSerializer.GetMatchingConverter(converters, _value.GetType());

                              Method ProcessEMV has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected string ProcessEMV(string xml, bool autoReset)
                                  {
                                      /* 
                                         Substitute values into the XML request
                                         This is so the driver can handle any change
                              Severity: Major
                              Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Datacap_Gen2.cs - About 2 hrs to fix

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

                                        if($labelCount == 32){
                                            $pdf->AddPage('P');
                                            $descTop = $top + $hspace;
                                            $barLeft = $left + 4;
                                            $barTop = $descTop + 16;
                                Severity: Major
                                Found in fannie/admin/labels/pdf_layouts/Fannie_Standard.php and 1 other location - About 2 hrs to fix
                                fannie/admin/labels/pdf_layouts/YPSI_rev_001.php on lines 90..103

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

                                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($labelCount == 32){
                                            $pdf->AddPage('P');
                                            $descTop = $top + $hspace;
                                            $barLeft = $left + 4;
                                            $barTop = $descTop + 16;
                                Severity: Major
                                Found in fannie/admin/labels/pdf_layouts/YPSI_rev_001.php and 1 other location - About 2 hrs to fix
                                fannie/admin/labels/pdf_layouts/Fannie_Standard.php on lines 90..103

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

                                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 form_content()
                                    {
                                        $vid = FormLib::get('vid');
                                        if ($vid === ''){
                                            $this->add_onload_command("\$('#FannieUploadForm').remove();");
                                Severity: Major
                                Found in fannie/item/vendors/UpdateUploadPage.php and 1 other location - About 2 hrs to fix
                                fannie/item/vendors/DefaultUploadPage.php on lines 349..367

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

                                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 form_content()
                                    {
                                        $vid = FormLib::get('vid');
                                        if ($vid === ''){
                                            $this->add_onload_command("\$('#FannieUploadForm').remove();");
                                Severity: Major
                                Found in fannie/item/vendors/DefaultUploadPage.php and 1 other location - About 2 hrs to fix
                                fannie/item/vendors/UpdateUploadPage.php on lines 369..387

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

                                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

                                <?php
                                
                                /*******************************************************************************
                                
                                    Copyright 2018 Whole Foods Co-op
                                fannie/classlib2.0/data/models/op/EquityPaymentPlanAccountsModel.php on lines 1..52

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

                                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