CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    public function fetch_report_data()
    {
        try {
            $super = $this->form->buyer;
            $dept1 = $this->form->deptStart;
Severity: Major
Found in fannie/reports/InUseDiff/InUseDiffReport.php - About 2 hrs to fix

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

        public function get_view()
        {
            $lib_class = $this->lib_class;
            $dbc = $lib_class::getDB();
    
    
    Severity: Major
    Found in fannie/modules/plugins2.0/OpenBookFinancing/ObfMappingPage.php - About 2 hrs to fix

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

          public function run()
          {
              $dbc = FannieDB::get($this->config->get('OP_DB'));
      
              if (!class_exists('InstaFileV3')) {
      Severity: Major
      Found in fannie/modules/plugins2.0/InstaCart/InstaWfcExport.php - About 2 hrs to fix

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

            public function run()
            {
                $dbc = FannieDB::get($this->config->get('OP_DB'));
                $dbc->query("INSERT INTO RpSnapshots (userID, tdate, data, dataType)
                    SELECT userID, " . $dbc->now() . ", data, dataType FROM RpSessions");
        Severity: Major
        Found in fannie/modules/plugins2.0/RP/RpCleanupTask.php - About 2 hrs to fix

          Method definition has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function definition()
              {
                  global $FANNIE_TRANS_DB;
          
                  /* List of CoopCred paymentDepartment's

            Method drawItem has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function drawItem($pdf, $item, $row, $column)
                {
                    $effective_width = $this->width - (2*$this->left);
                    $price = $this->printablePrice($item);
            
            
            Severity: Major
            Found in fannie/modules/plugins2.0/CoopDealsSigns/Produce4UpP.php - About 2 hrs to fix

              Method javascript_content has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function javascript_content()
                  {
                      ob_start();
                      ?>
              function doubleBeep() {
              Severity: Major
              Found in fannie/modules/plugins2.0/ShelfAudit/SaHandheldPage.php - About 2 hrs to fix

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

                    protected function get_id_view()
                    {
                        $model = new CustomerNotificationsModel($this->connection);
                        $model->cardNo($this->id);
                        $body = '';
                Severity: Major
                Found in fannie/mem/MemNotifications.php - About 2 hrs to fix

                  Method legacySync has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function legacySync($card_no)
                      {
                          $dbc = $this->connection;
                  
                          $custdata = new CustdataModel($dbc);
                  Severity: Major
                  Found in fannie/classlib2.0/data/models/op/CustomerAccountsModel.php - About 2 hrs to fix

                    Method drawPDF has 70 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/TagsNoPrice.php - About 2 hrs to fix

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

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

                        Method ReadNormal has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                private bool ReadNormal()
                                {
                                    switch (CurrentState)
                                    {
                                        case State.Start:

                          Method ReadMetadataPropertiesToken has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  private bool ReadMetadataPropertiesToken(JTokenReader reader, ref Type objectType, ref JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue, out object newValue, out string id)
                                  {
                                      id = null;
                                      newValue = null;
                          
                          

                            Method Read has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public override void Read()
                                { 
                                    ReInitDevice();
                                    RBA_Stub emailRBA = null;
                                    if (device_identifier.Contains("INGENICO")) {
                            Severity: Major
                            Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Datacap_EMVX.cs - About 2 hrs to fix

                              Method Choice has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private bool Choice(string str)
                                  {
                                      bool ret = false;
                                      if (str.Substring(1,4) == "24.0") {
                                          switch (str.Substring(5,1)) {
                              Severity: Major
                              Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/RBA_Stub.cs - About 2 hrs to fix

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

                                function issueCheck(id) {
                                    if ($('#issueCheckbox').attr('checked')) {
                                        location = 'GumEquityPayoffPage.php?id=' + id + '&pdf=1&issued=1';
                                        $('#issueCheckbox').attr('disabled', 'disabled');
                                        var d = new Date();
                                fannie/modules/plugins2.0/GiveUsMoneyPlugin/js/loan_payoff.js on lines 4..11

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

                                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

                                function issueCheck(id) {
                                    if ($('#issueCheckbox').prop('checked')) {
                                        location = 'GumLoanPayoffPage.php?id=' + id + '&pdf=1&issued=1';
                                        $('#issueCheckbox').attr('disabled', 'disabled');
                                        var d = new Date();
                                fannie/modules/plugins2.0/GiveUsMoneyPlugin/js/equity_payoff.js on lines 4..11

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

                                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 ScanTransferPage.php has 283 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/purchasing/ScanTransferPage.php - About 2 hrs to fix

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

                                          while($row = $dbc->fetch_row($posR)){
                                              $d = $row[0]."-".str_pad($row[1],2,'0',STR_PAD_LEFT)."-".str_pad($row[2],2,'0',STR_PAD_LEFT);
                                              if (!isset($dailies[$d])) $dailies[$d] = array(0,0);
                                              $dailies[$d][1] = $row[3];
                                          }
                                  fannie/modules/plugins2.0/OverShortTools/OverShortSafecountV2.php on lines 342..346
                                  fannie/modules/plugins2.0/OverShortTools/OverShortSafecountV3.php on lines 351..355

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

                                  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 3 locations. Consider refactoring.
                                  Open

                                      protected function get_resultID_view()
                                      {
                                          $table = $this->config->get('TRANS_DB') . $this->connection->sep() . 'PaycardTransactions';
                                          $prep = $this->connection->prepare("SELECT * FROM {$table} WHERE storeRowID=? and dateID=?");
                                          $row = $this->connection->getRow($prep, array($this->resultID, date('Ymd')));
                                  Severity: Major
                                  Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php and 2 other locations - About 2 hrs to fix
                                  fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php on lines 68..82
                                  fannie/modules/plugins2.0/PaycardFix/PaycardFixVoid.php on lines 53..67

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

                                  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