CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

  function getElementLeft() {
    var x = 0;
    var elm;
    if(typeof(p_elm) == "object"){
      elm = p_elm;
fannie/modules/plugins2.0/CoopCred/programs/CalendarControl.js on lines 38..51

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

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

    override public void HandleMsg(string msg)
    {
        if (msg == "errorBeep") {
            Beeps(3);
        } else if (msg == "beepTwice") {
pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Magellan_Scale.cs on lines 90..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 221.

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

    override public void HandleMsg(string msg)
    {
        if (msg == "errorBeep") {
            Beeps(3);
        } else if (msg == "beepTwice") {
pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Magellan_WeighOnly.cs on lines 89..118

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

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

<?php
/*******************************************************************************

    Copyright 2014 Foods Co-op

Severity: Minor
Found in fannie/item/vendors/VendorAliasesPage.php - About 3 hrs to fix

    Method parse has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function parse($str)
        {
            $ret = $this->default_json();
    
            // this is the currently selected item
    Severity: Major
    Found in pos/is4c-nf/parser/parse/LineItemDiscount.php - About 3 hrs to fix

      Method doc has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function doc()
          {
              return '
      Use:
      This table records information about integrated
      Severity: Major
      Found in pos/is4c-nf/lib/models/trans/PaycardTransactionsModel.php - About 3 hrs to fix

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

            function body_content()
            {
                $this->addScript('type-editor.js');
                global $FANNIE_OP_DB;
                $dbc = FannieDB::get($FANNIE_OP_DB);
        Severity: Major
        Found in fannie/batches/BatchTypeEditor.php - About 3 hrs to fix

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

              function preprocess()
              {
                  global $FANNIE_OP_DB;
                  $dbc = FannieDB::get($FANNIE_OP_DB);
          
          
          Severity: Major
          Found in fannie/batches/BatchTypeEditor.php - About 3 hrs to fix

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

                public function fetch_report_data()
                {
                    $dbc = $this->connection;
                    $parts = FormLib::standardItemFromWhere(); 
                    $query = $parts['query'];
            Severity: Major
            Found in fannie/reports/SaleTypeMovement/SaleTypeMovementReport.php - About 3 hrs to fix

              Method form_content has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function form_content()
                  {
                      $dbc = $this->connection;
                      $dbc->selectDB($this->config->get('OP_DB'));
                      ob_start();
              Severity: Major
              Found in fannie/reports/FloorSectionSales/floorSectionSalesReport.php - About 3 hrs to fix

                Method getIngredientList has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getIngredientList($dbc, $id)
                    {
                        /**
                         * Query notes:
                         *
                Severity: Major
                Found in fannie/admin/labels/pdf_layouts/Cheftec_Signs_4UP.php - About 3 hrs to fix

                  Method wideReportData has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function wideReportData($date1, $date2, $store)
                      {
                          $itemP = $this->connection->prepare("SELECT u.brand, u.description, i.upc
                                      FROM PickupOrders AS o
                                          INNER JOIN PickupOrderItems AS i ON i.pickupOrderID=o.pickupOrderID
                  Severity: Major
                  Found in fannie/modules/plugins2.0/Pickup/PickupOrdersReport.php - About 3 hrs to fix

                    Method doInsert has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function doInsert($dtrans,$amount,$department,$cardno){
                            global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
                            $dbc = FannieDB::get($FANNIE_TRANS_DB);
                            $OP = $FANNIE_OP_DB.$dbc->sep();
                    
                    
                    Severity: Major
                    Found in fannie/modules/plugins2.0/CoopCred/membership/CoopCredJiggerTool.php - About 3 hrs to fix

                      Method doc has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function doc()
                          {
                              return '
                      Use:
                      This table records information about integrated
                      Severity: Major
                      Found in fannie/classlib2.0/data/models/trans/PaycardTransactionsModel.php - About 3 hrs to fix

                        Method lineaJS has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function lineaJS()
                            {
                                ob_start();
                                ?>
                        function lineaBarcode(upc, selector, callback) {
                        Severity: Major
                        Found in fannie/classlib2.0/FanniePage.php - About 3 hrs to fix

                          Method post_newbatch_tags_upcs_newprices_handler has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function post_newbatch_tags_upcs_newprices_handler()
                              {
                                  global $FANNIE_OP_DB, $FANNIE_URL;
                                  $this->upcs = json_decode($this->upcs);
                                  $this->newprices = json_decode($this->newprices);
                          Severity: Major
                          Found in fannie/item/MarginToolFromSearch.php - About 3 hrs to fix

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

                                        $item = array(
                                            'upc' => '',
                                            'description' => $descriptions[$i],
                                            'posDescription' => $descriptions[$i],
                                            'brand' => $brands[$i],
                            Severity: Major
                            Found in fannie/admin/labels/ManualSignsPage.php and 1 other location - About 3 hrs to fix
                            fannie/admin/labels/FpdfEditorPage.php on lines 155..172

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

                            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

                                        $item = array(
                                            'upc' => '',
                                            'description' => $descriptions[$i],
                                            'posDescription' => $descriptions[$i],
                                            'brand' => $brands[$i],
                            Severity: Major
                            Found in fannie/admin/labels/FpdfEditorPage.php and 1 other location - About 3 hrs to fix
                            fannie/admin/labels/ManualSignsPage.php on lines 155..172

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

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

                            <?php
                            
                            /**
                             * This page does not really have a UI and just exists
                             * to run javascript and process responses. It flows like this:
                            Severity: Minor
                            Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvWic.php - About 3 hrs to fix

                              File SpecialOrdersTask.php has 298 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /*******************************************************************************
                              
                                  Copyright 2011 Whole Foods Co-op
                              
                              
                              Severity: Minor
                              Found in fannie/cron/tasks/SpecialOrdersTask.php - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language