CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method doc has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function doc()
    {
        return '
Use:
WFC runs custom barcoded coupons with
Severity: Major
Found in fannie/classlib2.0/data/models/op/HouseCouponsModel.php - About 2 hrs to fix

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

        protected function get_view()
        {
            $dbc = FannieDB::get($this->config->get('OP_DB'));
            $ret = '';
    
    
    Severity: Major
    Found in fannie/item/vendors/OrderTags.php - About 2 hrs to fix

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

          public function get_view()
          {
              $dbc = $this->connection;
      
              //$nutriCols = array("servingSize","calories","fatCalories","totalFat","saturatedFat","transFat","cholesterol","sodium","totalCarbs","fiber","sugar","addedSugar","protein");
      Severity: Major
      Found in fannie/item/images/NutriFactEntry.php - About 2 hrs to fix

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

            public function body_content()
            {
        
                $ingrHead = FormLib::get("ingrHead", '');
                $ingrCheck = ($ingrHead == 1) ? ' checked ' : '';
        Severity: Major
        Found in fannie/item/images/IngredientSOPFormatter.php - About 2 hrs to fix

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

                  else if (s.Substring(0,4) == "S08A" ||
                       s.Substring(0,4) == "S08F")
                      return s.Substring(4);
                  else if (s.Substring(0,4) == "S08E")
                      return this.ExpandUPCE(s.Substring(4));
          pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Magellan_Classic.cs on lines 190..202

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

          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

                  else if (s.Substring(0,4) == "S08A" ||
                       s.Substring(0,4) == "S08F")
                      return s.Substring(4);
                  else if (s.Substring(0,4) == "S08E")
                      return this.ExpandUPCE(s.Substring(4));
          pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Magellan_Locking.cs on lines 199..211

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

          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

          Function initState has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              mod.initState = function(s) {
                  if (typeof s == 'object') {
                      state = s;
                      if (state['onHand'].__proto__ == Array.prototype) {
                          state['onHand'] = {};
          Severity: Major
          Found in fannie/modules/plugins2.0/RP/rpDirect.js - About 2 hrs to fix

            Method printfooter has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            static public function printfooter($readOnly=False) 
            {
                $FOOTER_MODULES = CoreLocal::get("FooterModules");
                // use defaults if modules haven't been configured
                // properly
            Severity: Major
            Found in pos/is4c-nf/lib/DisplayLib.php - About 2 hrs to fix

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

                  public function fetch_report_data()
                  {
                      $dbc = $this->connection;
                      $dbc->selectDB($this->config->get('OP_DB'));
              
              
              Severity: Major
              Found in fannie/reports/MovementPrice/PriceMovementReport.php - About 2 hrs to fix

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

                    public function preprocess()
                    {
                        global $FANNIE_OP_DB, $FANNIE_STORE_MODE, $FANNIE_STORE_ID;
                        $model = new StoresModel(FannieDB::get($FANNIE_OP_DB));
                        $posted = false;
                Severity: Major
                Found in fannie/install/InstallStoresPage.php - About 2 hrs to fix

                  Method report_description_content has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function report_description_content()
                      {
                          $settings = $this->config->get('PLUGIN_SETTINGS');
                          $dbc = FannieDB::get($settings['HrWebDB']);
                          $ret = array();
                  Severity: Major
                  Found in fannie/modules/plugins2.0/HrWeb/IllnessReport/IllnessLogReport.php - About 2 hrs to fix

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

                        public function fetch_report_data()
                        {
                            global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
                            $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['GiveUsMoneyDB']);
                            $dt = FormLib::get('endDate', date('Y-m-d'));

                      Method addItems has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function addItems($dbc, $orderID, $items, $cardNo)
                          {
                              $PENDING = FannieDB::fqn('PendingSpecialOrder', 'trans');
                              $tidP = $dbc->prepare("SELECT MAX(trans_id),MAX(voided),MAX(numflag) 
                                      FROM {$PENDING} WHERE order_id=?");
                      Severity: Major
                      Found in fannie/modules/plugins2.0/MyWeb/MyWebSpoImport.php - About 2 hrs to fix

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

                            public function get_id_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 drawPDF has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function drawPDF()
                              {
                                  $pdf = $this->createPDF();
                                  $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
                                  $basicP = $dbc->prepare("SELECT
                          Severity: Major
                          Found in fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns4UpP.php - About 2 hrs to fix

                            Method printTags has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function printTags($tags)
                                {
                                    $dbc = $this->connection;
                                    $dbc->selectDB($this->config->get('OP_DB'));
                                    $TRANS = $this->config->get('TRANS_DB').$dbc->sep();
                            Severity: Major
                            Found in fannie/ordering/SpecialOrderTags.php - About 2 hrs to fix

                              Method post_upc_discounttype_handler has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function post_upc_discounttype_handler()
                                  {
                                      $discountType = FormLib::get('discounttype');
                                      $isMember = FormLib::get('isMember');
                                      $id = FormLib::get('orderid');
                              Severity: Major
                              Found in fannie/ordering/OrderAjax.php - About 2 hrs to fix

                                Method bodyContent has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function bodyContent()
                                    {
                                        ob_start();
                                        $dbc = $this->connection;
                                        $dbc->selectDB($this->config->get('TRANS_DB'));
                                Severity: Major
                                Found in fannie/ordering/SoReceivingReport.php - About 2 hrs to fix

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

                                      protected function get_view()
                                      {
                                          $dbc = $this->connection;
                                          $dbc->selectDB($this->config->get('OP_DB'));
                                  
                                  
                                  Severity: Major
                                  Found in fannie/item/AdvancedItemSearch.php - About 2 hrs to fix

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

                                        public function SaveFormData($upc)
                                        {
                                            try {
                                                $likecode = $this->form->likeCode;
                                            } catch (Exception $ex) {
                                    Severity: Major
                                    Found in fannie/item/modules/LikeCodeModule.php - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language