CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    function preprocess(){
        global $FANNIE_OP_DB,$FANNIE_PLUGIN_SETTINGS;
        $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
        if (isset($_GET['submitted'])) { // If the form has been submitted.
            // Validate the data.
Severity: Major
Found in fannie/modules/plugins2.0/TimesheetPlugin/admin/TsAdminAdd.php - About 4 hrs to fix

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

        public function post_id_handler()
        {
            $dbc = FannieDB::get($this->config->get('OP_DB'));
            $ret = array('error' => false);
    
    
    Severity: Major
    Found in fannie/purchasing/ManualPurchaseOrderPage.php - About 4 hrs to fix

      Method finishForce has 117 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function finishForce($id, $updateType, $has_limit=true)
          {
              $columnsP = $this->connection->prepare('
                  SELECT p.upc,
                      p.normal_price,
      Severity: Major
      Found in fannie/classlib2.0/data/models/op/BatchesModel.php - About 4 hrs to fix

        FannieReportPage has 36 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class FannieReportPage extends FanniePage 
        {
        
            public $required = True;
        
        
        Severity: Minor
        Found in fannie/classlib2.0/FannieReportPage.php - About 4 hrs to fix

          Class JTokenWriter has 36 methods (exceeds 20 allowed). Consider refactoring.
          Open

              public class JTokenWriter : JsonWriter
              {
                  private JContainer _token;
                  private JContainer _parent;
                  // used when writer is writing single value and the value has no containing parent

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

                    if ($maxes['bacon'] > 0) {
                        $this->connection->startTransaction();
                        $upP = $this->connection->prepare("UPDATE {$mydb}MyStats SET stat=? WHERE myStatID=?");
                        $res = $this->connection->query("SELECT myStatID, stat FROM {$mydb}MyStats WHERE statID=3");
                        while ($row = $this->connection->fetchRow($res)) {
            Severity: Major
            Found in fannie/modules/plugins2.0/MyWeb/models/MyStatsModel.php and 1 other location - About 4 hrs to fix
            fannie/modules/plugins2.0/MyWeb/models/MyStatsModel.php on lines 187..197

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

            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

                public function calculate_footers($data)
                {
                    if (count($data) == 0) {
                        return array();
                    }
            Severity: Major
            Found in fannie/reports/HourlyTrans/HourlyTransReport.php and 1 other location - About 4 hrs to fix
            fannie/reports/HourlySales/HourlySalesReport.php on lines 315..337

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

            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

                    if ($maxes['coffee'] > 0) {
                        $this->connection->startTransaction();
                        $upP = $this->connection->prepare("UPDATE {$mydb}MyStats SET stat=? WHERE myStatID=?");
                        $res = $this->connection->query("SELECT myStatID, stat FROM {$mydb}MyStats WHERE statID=2");
                        while ($row = $this->connection->fetchRow($res)) {
            Severity: Major
            Found in fannie/modules/plugins2.0/MyWeb/models/MyStatsModel.php and 1 other location - About 4 hrs to fix
            fannie/modules/plugins2.0/MyWeb/models/MyStatsModel.php on lines 200..210

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

            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

                public function calculate_footers($data)
                {
                    if (count($data) == 0) {
                        return array();
                    }
            Severity: Major
            Found in fannie/reports/HourlySales/HourlySalesReport.php and 1 other location - About 4 hrs to fix
            fannie/reports/HourlyTrans/HourlyTransReport.php on lines 312..334

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

            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

            Method prepareDataCapVoid has 116 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function prepareDataCapVoid($pcID)
                {
                    $dbc = Database::tDataConnect();
                    $prep = $dbc->prepare('SELECT transNo, registerNo FROM PaycardTransactions WHERE paycardTransactionID=?');
                    $row = $dbc->getRow($prep, $pcID);
            Severity: Major
            Found in pos/is4c-nf/plugins/Paycards/MercuryDC.php - About 4 hrs to fix

              Method renderAsHTML has 116 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function renderAsHTML()
                  {
                      $ret = '<table style="border: 1px solid black; border-collapse: collapse;">';
              
                      $ret .= '<tr>';

                Method post_id_upc_terms_handler has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function post_id_upc_terms_handler()
                    {
                        $this->id = preg_split('/[^\d]/', $this->id, 0, PREG_SPLIT_NO_EMPTY);
                
                        $pdf = new FPDF('P', 'mm', 'Letter');
                Severity: Major
                Found in fannie/modules/plugins2.0/CustomMailing/CheckCouponMailing.php - About 4 hrs to fix

                  Method renderAsHTML has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function renderAsHTML()
                      {
                          $ret = '<table style="border: 1px solid black; border-collapse: collapse;">';
                  
                          $ret .= '<tr>';
                  Severity: Major
                  Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumTaxFormTemplate.php - About 4 hrs to fix

                    Method renderAsHTML has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function renderAsHTML()
                        {
                            $ret = '<table style="border: 1px solid black; border-collapse: collapse;">';
                    
                            $ret .= '<tr>';

                      File RenderReceiptPage.php has 359 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/admin/LookupReceipt/RenderReceiptPage.php - About 4 hrs to fix

                        File LikeCodeModule.php has 359 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/LikeCodeModule.php - About 4 hrs to fix

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

                              public function changeCosts($changes)
                              {
                                  $actual = array();
                                  $prodP = $this->connection->prepare("SELECT cost FROM products WHERE upc=?");
                                  $lcP = $this->connection->prepare("SELECT upc FROM upcLike WHERE likeCode=?");
                          Severity: Major
                          Found in fannie/modules/plugins2.0/RP/RpImport.php and 1 other location - About 4 hrs to fix
                          fannie/modules/plugins2.0/RP/RpImportCsv.php on lines 13..36

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

                          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

                              public function changeCosts($changes)
                              {
                                  $actual = array();
                                  $prodP = $this->connection->prepare("SELECT cost FROM products WHERE upc=?");
                                  $lcP = $this->connection->prepare("SELECT upc FROM upcLike WHERE likeCode=?");
                          Severity: Major
                          Found in fannie/modules/plugins2.0/RP/RpImportCsv.php and 1 other location - About 4 hrs to fix
                          fannie/modules/plugins2.0/RP/RpImport.php on lines 13..36

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

                          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

                          Method buildLTTViewsGeneric has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function buildLTTViewsGeneric($db, $type, $errors=array())
                          {
                              //--------------------------------------------------------------
                              // CREATE lttSummary VIEW
                              //--------------------------------------------------------------
                          Severity: Major
                          Found in pos/is4c-nf/install/buildLTTViews.php - About 4 hrs to fix

                            Method fetch_report_data has 115 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/HourlySales/HourlySalesReport.php - About 4 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language