CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    public function get_view()
    {
        $obj = $this->getCRUDModel();
        $id_col = $this->getIdCol();
        $columns = $obj->getColumns();
Severity: Major
Found in fannie/classlib2.0/FannieCRUDPage.php - About 3 hrs to fix

    Method batchNotification has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static public function batchNotification($batchID, $upc, $type, $is_likecode=false)
        {
            $conf = FannieConfig::factory();
            $dbc = FannieDB::getReadOnly($conf->get('OP_DB'));
    
    
    Severity: Major
    Found in fannie/classlib2.0/lib/AuditLib.php - About 3 hrs to fix

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

          protected function get_view()
          {
              $scaleTypes = array();
              $res = $this->connection->query('SELECT scaleType FROM ServiceScales GROUP BY scaleType ORDER BY scaleType');
              while ($row = $this->connection->fetchRow($res)) {
      Severity: Major
      Found in fannie/item/hobartcsv/ScaleLabelEditor.php - About 3 hrs to fix

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

            function body_content()
            {
                global $FANNIE_COOP_ID;
                ob_start();
                // If there were errors in preprocess().
        Severity: Major
        Found in fannie/item/ItemFlags.php - About 3 hrs to fix

          Method PopulateDictionary has 84 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private object PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, string id)
                  {
                      IWrappedDictionary wrappedDictionary = dictionary as IWrappedDictionary;
                      object underlyingDictionary = wrappedDictionary != null ? wrappedDictionary.UnderlyingDictionary : dictionary;
          
          

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

                    if ($this->validDate($item['startDate']) && $this->validDate($item['endDate'])) {
                        // intl would be nice
                        $datestr = $this->getDateString($item['startDate'], $item['endDate']);
                        $pdf->SetXY($this->left + ($this->width*$column), $this->top + ($this->height*$row) + ($this->height - 33));
                        $pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
            Severity: Major
            Found in fannie/classlib2.0/item/signage/Signage12UpL.php and 1 other location - About 3 hrs to fix
            fannie/classlib2.0/item/signage/Compact12UpL.php on lines 104..110

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

            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 ($this->validDate($item['startDate']) && $this->validDate($item['endDate'])) {
                        // intl would be nice
                        $datestr = $this->getDateString($item['startDate'], $item['endDate']);
                        $pdf->SetXY($this->left + ($this->width*$column), $this->top + ($this->height*$row) + ($this->height - 42));
                        $pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
            Severity: Major
            Found in fannie/classlib2.0/item/signage/Compact12UpL.php and 1 other location - About 3 hrs to fix
            fannie/classlib2.0/item/signage/Signage12UpL.php on lines 102..108

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

            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 catList(id,category){
                var dstr = 'action=catList&id='+id+'&category='+category;
                $.ajax({
                    url: 'DeliInventoryPage.php',
                    type: 'get',
            Severity: Major
            Found in fannie/modules/plugins2.0/DeliInventory/index.js and 1 other location - About 3 hrs to fix
            fannie/modules/plugins2.0/DeliInventory/index3.js on lines 147..157

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

            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

                $.ajax({
                    url: ws_url,
                    type: 'post',
                    data: JSON.stringify(req),
                    dataType: 'json',
            Severity: Major
            Found in fannie/purchasing/js/manual.js and 1 other location - About 3 hrs to fix
            fannie/item/autocomplete.js on lines 12..24

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

            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

                mod.savePNN = function(commentID, pnn) {
                    $.ajax({
                        url: 'ManageComments.php',
                        method: 'post',
                        data: 'id='+commentID+'&pnn='+pnn
            fannie/modules/plugins2.0/CommentTracker/js/manageComments.js on lines 50..60

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

            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

                mod.saveCategory = function(commentID, catID) {
                    $.ajax({
                        url: 'ManageComments.php',
                        method: 'post',
                        data: 'id='+commentID+'&catID='+catID
            fannie/modules/plugins2.0/CommentTracker/js/manageComments.js on lines 74..84

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

            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 catList(id,category){
                var dstr = 'action=catList&id='+id+'&category='+category;
                $.ajax({
                    url: 'DeliInventoryPage2.php',
                    type: 'get',
            Severity: Major
            Found in fannie/modules/plugins2.0/DeliInventory/index3.js and 1 other location - About 3 hrs to fix
            fannie/modules/plugins2.0/DeliInventory/index.js on lines 147..157

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

            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

                $.ajax({
                    url: ws_url,
                    type: 'post',
                    data: JSON.stringify(req),
                    dataType: 'json',
            Severity: Major
            Found in fannie/item/autocomplete.js and 1 other location - About 3 hrs to fix
            fannie/purchasing/js/manual.js on lines 230..242

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

            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 FannieAuth.php has 306 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /*******************************************************************************
            
                Copyright 2013 Whole Foods Co-op
            
            
            Severity: Minor
            Found in fannie/classlib2.0/auth/FannieAuth.php - About 3 hrs to fix

              FannieUploadPage has 28 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class FannieUploadPage extends \FanniePage 
              {
              
                  public $required = true;
              
              
              Severity: Minor
              Found in fannie/classlib2.0/FannieUploadPage.php - About 3 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                                else if (objA is int || objA is uint || objA is long || objA is short || objA is ushort || objA is sbyte || objA is byte ||
                                         objB is int || objB is uint || objB is long || objB is short || objB is ushort || objB is sbyte || objB is byte)
                                {
                                    if (objA == null || objB == null)
                                    {

                  Function full has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var full = (function ($) {
                      var mod = {};
                  
                      var lastSearch = 0;
                  
                  
                  Severity: Major
                  Found in fannie/modules/plugins2.0/ShelfAudit/js/full.js - About 3 hrs to fix

                    Method checkLimits has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function checkLimits($coupID)
                        {
                            $infoW = $this->lookupCoupon($coupID);
                            if ($infoW === false) {
                                return $this->errorOrQuiet(_('coupon not found'), false);
                    Severity: Major
                    Found in pos/is4c-nf/lib/Scanning/SpecialUPCs/HouseCoupon.php - About 3 hrs to fix

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

                          public function fetch_report_data()
                          {
                              // creates a temporary table so requesting a writable connection
                              // does make sense here
                              $dbc = FannieDB::get($this->config->get('OP_DB'));
                      Severity: Major
                      Found in fannie/reports/Correlated/CorrelatedMovementReport.php - About 3 hrs to fix

                        Method get_view has 83 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/reports/Store-Specific/WFC/ECouponReport.php - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language