CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    function fetch_report_data(){

        //global $FANNIE_TRANS_DB,
        global $FANNIE_OP_DB, $FANNIE_URL;
        global $FANNIE_PLUGIN_SETTINGS;

    File PaycardFixReturn.php has 383 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    include(__DIR__ . '/../../../config.php');
    if (!class_exists('FannieAPI')) {
        include(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
    Severity: Minor
    Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php - About 5 hrs to fix

      File PaycardFixSale.php has 383 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      include(__DIR__ . '/../../../config.php');
      if (!class_exists('FannieAPI')) {
          include(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
      Severity: Minor
      Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php - About 5 hrs to fix

        File view.js has 382 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        
        $(document).ready(function(){
            var initoid = $('#init_oid').val();
            $.ajax({
            url: 'ajax-calls.php',
        Severity: Minor
        Found in fannie/ordering/view.js - About 5 hrs to fix

          File Creator.php has 382 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace COREPOS\pos\install\db;
          use COREPOS\pos\lib\CoreState;
          
          
          Severity: Minor
          Found in pos/is4c-nf/install/db/Creator.php - About 5 hrs to fix

            File LikeCodeAjax.php has 382 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /*******************************************************************************
            
                Copyright 2009 Whole Foods Co-op
            
            
            Severity: Minor
            Found in fannie/item/likecodes/LikeCodeAjax.php - About 5 hrs to fix

              Class BsonWriter has 39 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  public class BsonWriter : JsonWriter
                  {
                      private readonly BsonBinaryWriter _writer;
              
                      private BsonToken _root;

                Class TraceJsonWriter has 39 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    internal class TraceJsonWriter : JsonWriter
                    {
                        private readonly JsonWriter _innerWriter;
                        private readonly JsonTextWriter _textWriter;
                        private readonly StringWriter _sw;

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

                      function preprocess(){
                          // set variable ahead of time
                          // so we know if lookup found no one
                          // vs. lookup didn't happen
                          $this->temp_num_rows = -1;
                  Severity: Major
                  Found in pos/is4c-nf/gui-modules/memlist_cards.php - About 5 hrs to fix

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

                        function javascript_content(){
                            ob_start();
                        ?>
                    
                    function setdate()
                    Severity: Major
                    Found in fannie/modules/plugins2.0/OverShortTools/OverShortDayPage.php - About 5 hrs to fix

                      Method process has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function process($filename)
                          {
                              $fp = fopen($filename, 'r');
                              $currentOrder = array('id' => false, 'total' => 0, 'qty' => 0, 'fees' => 0, 'card_no' => 11, 'tdate' => '', 'items' => array());
                              $storeID = 0;
                      Severity: Major
                      Found in fannie/modules/plugins2.0/Mercato/MercatoConvert.php - About 5 hrs to fix

                        File PcMonthlyReport.php has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /*******************************************************************************
                        
                            Copyright 2013 Whole Foods Co-op
                        
                        
                        Severity: Minor
                        Found in fannie/reports/Paycards/PcMonthlyReport.php - About 5 hrs to fix

                          File DepartmentMovementReport.php has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /*******************************************************************************
                          
                              Copyright 2012 Whole Foods Co-op
                          
                          
                          Severity: Minor
                          Found in fannie/reports/DepartmentMovement/DepartmentMovementReport.php - About 5 hrs to fix

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

                            class WFC_Double_PDF extends FpdfWithBarcode
                            {
                                private $tagdate;
                                function setTagDate($str){
                                    $this->tagdate = $str;
                            Severity: Major
                            Found in fannie/admin/labels/pdf_layouts/WFC_Double.php and 2 other locations - About 5 hrs to fix
                            fannie/admin/labels/pdf_layouts/WFC_Produce.php on lines 33..50
                            fannie/admin/labels/pdf_layouts/WFC_Produce_Single.php on lines 33..50

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

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

                            class WFC_Produce_PDF extends FpdfWithBarcode
                            {
                                private $tagdate;
                                function setTagDate($str){
                                    $this->tagdate = $str;
                            Severity: Major
                            Found in fannie/admin/labels/pdf_layouts/WFC_Produce.php and 2 other locations - About 5 hrs to fix
                            fannie/admin/labels/pdf_layouts/WFC_Double.php on lines 33..50
                            fannie/admin/labels/pdf_layouts/WFC_Produce_Single.php on lines 33..50

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

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

                            class WFC_Produce_Single_PDF extends FpdfWithBarcode
                            {
                                private $tagdate;
                                function setTagDate($str){
                                    $this->tagdate = $str;
                            Severity: Major
                            Found in fannie/admin/labels/pdf_layouts/WFC_Produce_Single.php and 2 other locations - About 5 hrs to fix
                            fannie/admin/labels/pdf_layouts/WFC_Double.php on lines 33..50
                            fannie/admin/labels/pdf_layouts/WFC_Produce.php on lines 33..50

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

                            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 ($w['card_no'] != 11 && $w['card_no'] != 9) {
                                            $r = $dbc->execute($afterBasketP, array($w['card_no'], $date_id, $basket['start_time']));
                                            while ($after = $dbc->fetchRow($r)) {
                                                $record[] = substr($after[0], 0, 4) . '-' . substr($after[0], 4, 2) . '-' . substr($after[0], -2) . ' ' . $after[2];
                                                $avg_after += $after[2];
                            fannie/modules/plugins2.0/CoreWarehouse/reports/CWCouponReport.php on lines 121..131

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

                            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 ($w['card_no'] != 11 && $w['card_no'] != 9) {
                                            $r = $dbc->execute($beforeBasketP, array($w['card_no'], $date_id, $basket['start_time']));
                                            while ($before = $dbc->fetchRow($r)) {
                                                $befores[] = substr($before[0], 0, 4) . '-' . substr($before[0], 4, 2) . '-' . substr($before[0], -2) . ' ' . $before[2];
                                                $avg_before += $before[2];
                            fannie/modules/plugins2.0/CoreWarehouse/reports/CWCouponReport.php on lines 148..158

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

                            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 doc has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function doc()
                                {
                                    return '
                            Use:
                            This is IT CORE\'s transaction log. A rather important table.
                            Severity: Major
                            Found in pos/is4c-nf/lib/models/trans/DTransactionsModel.php - About 5 hrs to fix

                              Method viewOrEdit has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function viewOrEdit($emp)
                                  {
                                      $canEdit = FannieAuth::validateUserQuiet('hr_editor');
                                      $this->connection->selectDB($this->default_db);
                                      $store = new StoresModel($this->connection);
                              Severity: Major
                              Found in fannie/modules/plugins2.0/HrWeb/Employee/EmployeesPage.php - About 5 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language