CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    public function fetch_report_data()
    {
        $dbc = $this->connection;
        $dbc->selectDB($this->config->get('OP_DB'));
        $FANNIE_TRANS_DB = $this->config->get('TRANS_DB');
Severity: Major
Found in fannie/reports/DDD/DDDReport.php - About 3 hrs to fix

    Method helpContent has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function helpContent()
        {
            return '<p>
                Create signs and/or tags. First select a layout
                that controls how the tags look. Then select which
    Severity: Major
    Found in fannie/admin/labels/SignFromSearch.php - About 3 hrs to fix

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

          public function body_content()
          {
              $edit = FannieAuth::validateUserQuiet('edit_employees');
      
              $sort = $this->getSort();
      Severity: Major
      Found in fannie/modules/plugins2.0/WfcHoursTracking/WfcHtListPage.php - About 3 hrs to fix

        Method run has 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function run()
            {
                if (!class_exists('Automattic\WooCommerce\Client')) {
                    $this->cronMsg('Library missing. Use composer to install automattic/woocommerce');
                    return false;
        Severity: Major
        Found in fannie/modules/plugins2.0/WooSync/WooOrdersTask.php - About 3 hrs to fix

          Method get_id_view has 89 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function get_id_view()
              {
                  $dbc = FannieDB::getReadOnly($this->config->get('OP_DB'));
                  $codes = new ReasoncodesModel($dbc);
                  $plan = new EquityPaymentPlansModel($dbc);
          Severity: Major
          Found in fannie/mem/PaymentPlanEditor.php - About 3 hrs to fix

            Method get_live_view has 89 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function get_live_view()
                {
                    try {
                        $store = $this->form->store;
                    } catch (Exception $ex) {
            Severity: Major
            Found in fannie/item/inventory/InvCountPage.php - About 3 hrs to fix

              Method get_upc_date1_date2_view has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function get_upc_date1_date2_view()
                  {
                      $dbc = FannieDB::get($this->config->get('OP_DB'));
              
                      if (!is_array($this->receipts) || count($this->receipts) == 0) {
              Severity: Major
              Found in fannie/item/OpenRingReceipts.php - About 3 hrs to fix

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

                    protected virtual void RebootTerminal()
                    {
                        try {
                            SendReport(BuildCommand(ResetDevice()));
                        }
                pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 100..137
                pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Native.cs on lines 100..137

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

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

                    protected override void RebootTerminal()
                    {
                        try {
                            SendReport(BuildCommand(ResetDevice()));
                        }
                pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Native.cs on lines 100..137
                pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 157..190

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

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

                    protected override void RebootTerminal()
                    {
                        try {
                            SendReport(BuildCommand(ResetDevice()));
                        }
                pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 100..137
                pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 157..190

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

                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 newDept(oid,tid){
                    var d = $('#newdept').val();
                    $.ajax({
                    url: 'ajax-calls.php',
                    type: 'post',
                Severity: Major
                Found in fannie/ordering/view.js and 1 other location - About 3 hrs to fix
                fannie/ordering/view.js on lines 179..190

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

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

                function saveRow(rowName){
                    var ret = '';
                    $('.denom').each(function(){
                        var denom = $(this).val();
                        var elem = document.getElementById(rowName+denom);
                Severity: Major
                Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 2 other locations - About 3 hrs to fix
                fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 40..50
                fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 43..53

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

                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 newQty(oid,tid){
                    var qty = $('#newqty').val();
                    $.ajax({
                    url: 'ajax-calls.php',
                    type: 'post',
                Severity: Major
                Found in fannie/ordering/view.js and 1 other location - About 3 hrs to fix
                fannie/ordering/view.js on lines 191..202

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

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

                function saveRow(rowName){
                    var ret = '';
                    $('.denom').each(function(){
                        var denom = $(this).val();
                        var elem = document.getElementById(rowName+denom);
                Severity: Major
                Found in fannie/modules/plugins2.0/OverShortTools/js/countV3.js and 2 other locations - About 3 hrs to fix
                fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 41..51
                fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 40..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 106.

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

                function saveRow(rowName){
                    var ret = '';
                    $('.denom').each(function(){
                        var denom = $(this).val();
                        var elem = document.getElementById(rowName+denom);
                Severity: Major
                Found in fannie/modules/plugins2.0/OverShortTools/js/countV2.js and 2 other locations - About 3 hrs to fix
                fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 41..51
                fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 43..53

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

                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

                    if (isset($formOrganic)) {
                        if ($formOrganic != false) {
                            if (strToLower($formOrganic) == 'organic') {
                                $item['organic'] = true;
                            } elseif (strToLower($formOrganic) == 'local organic') {
                Severity: Major
                Found in fannie/admin/labels/pdf_layouts/WFC_Produce_SmartSigns.php and 1 other location - About 3 hrs to fix
                fannie/admin/labels/pdf_layouts/WFC_New_Produce_Mockup.php on lines 184..198

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

                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

                    if (isset($formOrganic)) {
                        if ($formOrganic != false) {
                            if (strToLower($formOrganic) == 'organic') {
                                $item['organic'] = true;
                            } elseif (strToLower($formOrganic) == 'local organic') {
                Severity: Major
                Found in fannie/admin/labels/pdf_layouts/WFC_New_Produce_Mockup.php and 1 other location - About 3 hrs to fix
                fannie/admin/labels/pdf_layouts/WFC_Produce_SmartSigns.php on lines 190..204

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

                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 delete_item($filename,$scaletype,$scaleip,$department,$plu){
                  $fp = fopen($filename,"w+");
                  fputs($fp,"Record Type,Task Department,Task Destination,Task Destination Device,Task Destination Type\r\n");
                  fputs($fp,"ExecuteOneTask,{$department},{$scaleip},{$scaletype},SCALE\r\n");
                  fputs($fp,"Record Type,PLU Number\r\n");
                Severity: Major
                Found in fannie/item/hobartcsv/writecsv.php and 1 other location - About 3 hrs to fix
                fannie/item/hobartcsv/writecsv.php on lines 114..129

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

                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 delete_text($filename,$scaletype,$scaleip,$department,$plu){
                  $fp = fopen($filename,"w+");
                  fputs($fp,"Record Type,Task Department,Task Destination,Task Destination Device,Task Destination Type\r\n");
                  fputs($fp,"ExecuteOneTask,{$department},{$scaleip},{$scaletype},SCALE\r\n");
                  fputs($fp,"Record Type,Expanded Text Number\r\n");
                Severity: Major
                Found in fannie/item/hobartcsv/writecsv.php and 1 other location - About 3 hrs to fix
                fannie/item/hobartcsv/writecsv.php on lines 97..112

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

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

                    private function getBathchesBySuperDept($superDepts,$contacts)
                    {
                        $dbc = FannieDB::get($this->config->get('OP_DB'));
                        $date = date('Y-m-d').' 00:00:00';
                        $d = date('d');
                Severity: Major
                Found in fannie/cron/tasks/PriceBatchAlertTask.php - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language