CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method get_review_view has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get_review_view()
    {
        $ret = "";
        $ret .= '<a class="btn btn-default" href="
            http://localhost/IS4C/fannie/modules/plugins2.0/DeliCateringOrders/DeliCateringOrdersPage.php">

    Method finish_content has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function finish_content() {
            global $FANNIE_URL;
    
            if (!empty($this->errors)) {
                return "<p style='font-size:1.2em;'>" . $this->errors . "</p>";

      Method javascriptContent has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function javascriptContent()
          {
              ob_start();
              ?>
      function itemEditing()
      Severity: Major
      Found in fannie/item/vendors/EditVendorItems.php - About 3 hrs to fix

        Method showEditForm has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function showEditForm($upc, $display_mode=1, $expand_mode=1)
            {
                $db = $this->db();
                $product = new ProductsModel($db);
                $product->upc($upc);
        Severity: Major
        Found in fannie/item/modules/ItemMarginModule.php - About 3 hrs to fix

          File GumIssueDividendPage.php has 313 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php 
          /*******************************************************************************
          
              Copyright 2013 Whole Foods Co-op
          
          
          Severity: Minor
          Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumIssueDividendPage.php - About 3 hrs to fix

            DisplayLib has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class DisplayLib 
            {
            
            /**
              Get the standard footer with total and
            Severity: Minor
            Found in pos/is4c-nf/lib/DisplayLib.php - About 3 hrs to fix

              OrderViewPage has 29 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class OrderViewPage extends FannieRESTfulPage
              {
                  protected $header = 'View Order';
                  protected $title = 'View Order';
                  protected $must_authenticate = true;
              Severity: Minor
              Found in fannie/ordering/OrderViewPage.php - About 3 hrs to fix

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

                            if ($input == "CL") {
                                $this->conf->set("msgrepeat",0);
                                $this->conf->set("toggletax",0);
                                $this->conf->set("togglefoodstamp",0);
                                $this->conf->reset();
                Severity: Major
                Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvPage.php and 3 other locations - About 3 hrs to fix
                pos/is4c-nf/plugins/Paycards/gui/PaycardEmvGift.php on lines 57..80
                pos/is4c-nf/plugins/Paycards/gui/PaycardEmvRecurring.php on lines 42..66
                pos/is4c-nf/plugins/Paycards/gui/paycardboxMsgAuth.php on lines 44..69

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

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

                            if ($input == "CL") {
                                $this->conf->set("msgrepeat",0);
                                $this->conf->set("toggletax",0);
                                $this->conf->set("togglefoodstamp",0);
                                $this->conf->reset();
                Severity: Major
                Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvRecurring.php and 3 other locations - About 3 hrs to fix
                pos/is4c-nf/plugins/Paycards/gui/PaycardEmvGift.php on lines 57..80
                pos/is4c-nf/plugins/Paycards/gui/PaycardEmvPage.php on lines 44..87
                pos/is4c-nf/plugins/Paycards/gui/paycardboxMsgAuth.php on lines 44..69

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

                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

                <?php
                /*******************************************************************************
                
                    Copyright 2013 Whole Foods Co-op
                
                
                Severity: Major
                Found in fannie/classlib2.0/data/models/op/EmployeesModel.php and 1 other location - About 3 hrs to fix
                pos/is4c-nf/lib/models/op/EmployeesModel.php on lines 24..61

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

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

                            if( $input == "CL") {
                                $this->conf->set("msgrepeat",0);
                                $this->conf->set("toggletax",0);
                                $this->conf->set("togglefoodstamp",0);
                                $this->conf->reset();
                Severity: Major
                Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvGift.php and 3 other locations - About 3 hrs to fix
                pos/is4c-nf/plugins/Paycards/gui/PaycardEmvPage.php on lines 44..87
                pos/is4c-nf/plugins/Paycards/gui/PaycardEmvRecurring.php on lines 42..66
                pos/is4c-nf/plugins/Paycards/gui/paycardboxMsgAuth.php on lines 44..69

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

                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

                    public function save()
                    {
                        $stack = debug_backtrace();
                        $lane_push = false;
                        if (isset($stack[1]) && $stack[1]['function'] == 'pushToLanes') {
                Severity: Major
                Found in fannie/classlib2.0/data/models/op/CustomersModel.php and 1 other location - About 3 hrs to fix
                fannie/classlib2.0/data/models/op/CustomerAccountsModel.php on lines 231..251

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

                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

                namespace COREPOS\pos\lib\models\op;
                use COREPOS\pos\lib\models\BasicModel;
                
                class EmployeesModel extends BasicModel 
                {
                Severity: Major
                Found in pos/is4c-nf/lib/models/op/EmployeesModel.php and 1 other location - About 3 hrs to fix
                fannie/classlib2.0/data/models/op/EmployeesModel.php on lines 1..59

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

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

                            if ($input === "CL") {
                                $this->conf->set("msgrepeat",0);
                                $this->conf->set("toggletax",0);
                                $this->conf->set("togglefoodstamp",0);
                                $this->conf->reset();
                Severity: Major
                Found in pos/is4c-nf/plugins/Paycards/gui/paycardboxMsgAuth.php and 3 other locations - About 3 hrs to fix
                pos/is4c-nf/plugins/Paycards/gui/PaycardEmvGift.php on lines 57..80
                pos/is4c-nf/plugins/Paycards/gui/PaycardEmvPage.php on lines 44..87
                pos/is4c-nf/plugins/Paycards/gui/PaycardEmvRecurring.php on lines 42..66

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

                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

                    public function save()
                    {
                        $stack = debug_backtrace();
                        $lane_push = false;
                        if (isset($stack[1]) && $stack[1]['function'] == 'pushToLanes') {
                Severity: Major
                Found in fannie/classlib2.0/data/models/op/CustomerAccountsModel.php and 1 other location - About 3 hrs to fix
                fannie/classlib2.0/data/models/op/CustomersModel.php on lines 215..235

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

                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

                            while ($row = $dbc->fetchRow($res)) {
                                $salesLY = $dbc->getValue($lyP, array($lyStart, $lyEnd . ' 23:59:59', $row['storeID']));
                                $growth = ($row['ttl'] - $salesLY) / $salesLY;
                                $orgLY += $salesLY;
                                $pctGrowth = sprintf('%.1f%%', $growth * 100);
                Severity: Major
                Found in fannie/modules/plugins2.0/Otto/OttoTask.php and 1 other location - About 3 hrs to fix
                fannie/modules/plugins2.0/Otto/OttoTask.php on lines 83..90

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

                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

                            case "Q+": // must purchase more than X
                                $minQ = "select case when sum(ItemQtty) is null
                                    then 0 else sum(ItemQtty) end
                                    " . $this->baseSQL($transDB, $coupID, 'upc');
                                $minR = $transDB->query($minQ);
                Severity: Major
                Found in pos/is4c-nf/lib/Scanning/SpecialUPCs/HouseCoupon.php and 1 other location - About 3 hrs to fix
                pos/is4c-nf/lib/Scanning/SpecialUPCs/HouseCoupon.php on lines 253..265

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

                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 ($canEdit) {
                            $ret .= '<select name="dept[]" multiple class="form-control" size="5">';
                            foreach ($dept->find('departmentName') as $d) {
                                $selected = $this->connection->getValue($prep, array($emp->employeeID(), $d->departmentID())) ? 'selected' : '';
                                $ret .= sprintf('<option %s value="%d">%s</option>', $selected, $d->departmentID(), $d->departmentName());
                Severity: Major
                Found in fannie/modules/plugins2.0/HrWeb/Employee/EmployeesPage.php and 1 other location - About 3 hrs to fix
                fannie/modules/plugins2.0/HrWeb/Employee/EmployeesPage.php on lines 235..248

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

                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

                        while ($row = $dbc->fetchRow($res)) {
                            $salesLY = $dbc->getValue($lyP, array($lastYear, $lastYear . ' 23:59:59', $row['storeID']));
                            $growth = ($row['ttl'] - $salesLY) / $salesLY;
                            $orgLY += $salesLY;
                            $pctGrowth = sprintf('%.1f%%', $growth * 100);
                Severity: Major
                Found in fannie/modules/plugins2.0/Otto/OttoTask.php and 1 other location - About 3 hrs to fix
                fannie/modules/plugins2.0/Otto/OttoTask.php on lines 112..119

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

                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 ($canEdit) {
                            $ret .= '<select name="pos[]" multiple class="form-control" size="5">';
                            foreach ($pos->find('positionName') as $p) {
                                $selected = $this->connection->getValue($prep, array($emp->employeeID(), $p->positionID())) ? 'selected' : '';
                                $ret .= sprintf('<option %s value="%d">%s</option>', $selected, $p->positionID(), $p->positionName());
                Severity: Major
                Found in fannie/modules/plugins2.0/HrWeb/Employee/EmployeesPage.php and 1 other location - About 3 hrs to fix
                fannie/modules/plugins2.0/HrWeb/Employee/EmployeesPage.php on lines 219..232

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

                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