CORE-POS/IS4C

View on GitHub

Showing 8,297 of 8,298 total issues

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

    public function cleanup($json)
    {
        switch ($this->conf->get("paycard_mode")) {
            case PaycardLib::PAYCARD_MODE_BALANCE:
                $resp = $this->conf->get("paycard_response");
Severity: Major
Found in pos/is4c-nf/plugins/Paycards/MercuryGift.php and 1 other location - About 2 days to fix
pos/is4c-nf/plugins/Paycards/ValueLink.php on lines 165..219

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

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


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

    Copyright 2010 Whole Foods Co-op
Severity: Major
Found in fannie/batches/UNFI/VPBPV.php - About 2 days to fix

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

    var batchReport = (function ($) {
    
        var mod = {};
    
        var drawChart = function(yData, xLabels, yMin, yMax, name) {
    Severity: Major
    Found in fannie/reports/FloorSectionSales/floorSectionSalesReport.js and 1 other location - About 2 days to fix
    fannie/reports/BatchReport/batchReport.js on lines 1..54

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

    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

    var batchReport = (function ($) {
    
        var mod = {};
    
        var drawChart = function(yData, xLabels, yMin, yMax, name) {
    Severity: Major
    Found in fannie/reports/BatchReport/batchReport.js and 1 other location - About 2 days to fix
    fannie/reports/FloorSectionSales/floorSectionSalesReport.js on lines 1..54

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

    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 DefaultContractResolver.cs has 944 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Collections;
    #if !(NET35 || NET20 || PORTABLE || PORTABLE40)
    using System.Collections.Concurrent;
    #endif

      File FannieReportPage.php has 939 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*******************************************************************************
      
          Copyright 2012 Whole Foods Co-op
      
      
      Severity: Major
      Found in fannie/classlib2.0/FannieReportPage.php - About 2 days to fix

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

            protected $columns = array(
                'programID' => array('type'=>'SMALLINT(6)', 'default'=>0, 'primary_key'=>True,
                    'increment'=>True),
                'programName' => array('type'=>'VARCHAR(100)', 'not_null'=>True,
                    'default'=>"''"),
        Severity: Major
        Found in pos/is4c-nf/plugins/CoopCred/models/CCredProgramsModel.php and 1 other location - About 2 days to fix
        fannie/modules/plugins2.0/CoopCred/models/CCredProgramsModel.php on lines 35..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 463.

        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

            protected $columns = array(
                'programID' => array('type'=>'SMALLINT(6)', 'default'=>0, 'primary_key'=>True,
                    'increment'=>True),
                'programName' => array('type'=>'VARCHAR(100)', 'not_null'=>True,
                    'default'=>"''"),
        pos/is4c-nf/plugins/CoopCred/models/CCredProgramsModel.php on lines 37..71

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

        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

                while ($accessW = $dbc->fetch_row($accessR)) {
                    /**
                      Setup receipt notifications. This uses both old-style custReceiptMessage
                      and new-style CustomerNotifications. This notification is always
                      present.
        Severity: Major
        Found in fannie/modules/plugins2.0/WfcGazetteBilling/WfcB2BTask.php and 1 other location - About 2 days to fix
        fannie/modules/plugins2.0/WfcVirtualCoupon/WfcVcTask.php on lines 94..138

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

        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

                while ($accessW = $dbc->fetch_row($accessR)) {
                    /**
                      Setup receipt notifications. This uses both old-style custReceiptMessage
                      and new-style CustomerNotifications. This notification is always
                      present.
        Severity: Major
        Found in fannie/modules/plugins2.0/WfcVirtualCoupon/WfcVcTask.php and 1 other location - About 2 days to fix
        fannie/modules/plugins2.0/WfcGazetteBilling/WfcB2BTask.php on lines 94..138

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

        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

        Function render_data has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
        Open

            public function render_data($data,$headers=array(),$footers=array(),$format='html')
            {
                $url = $this->config->get('URL');
                $ret = "";
                switch(strtolower($format)) {
        Severity: Minor
        Found in fannie/classlib2.0/FannieReportPage.php - About 2 days to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function body_content has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring.
        Open

            function body_content(){
                //Should this really be done with global?
                global $FANNIE_PLUGIN_LIST, $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
                ob_start();
        
        
        Severity: Minor
        Found in fannie/install/InstallPluginsPage.php - About 2 days to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        File ReceiptLib.php has 927 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*******************************************************************************
        
            Copyright 2001, 2004 Wedge Community Co-op
        
        
        Severity: Major
        Found in pos/is4c-nf/lib/ReceiptLib.php - About 2 days to fix

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

              public function fetch_report_data()
              {
                  $class_lib = $this->class_lib;
                  $dbc = $class_lib::getDB();
                  
          Severity: Major
          Found in fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php - About 2 days to fix

            Function rpOrder has 440 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var rpOrder = (function ($) {
            
                var mod = {};
                var state = {
                    'retention': 60,
            Severity: Major
            Found in fannie/modules/plugins2.0/RP/rpOrder.js - About 2 days to fix

              Function WFC_Hybrid_Single has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring.
              Open

              function WFC_Hybrid_Single($data,$offset=0){
              
              $pdf=new WFC_Hybrid_Single_PDF('L','mm',array(25.4, 53.975)); //start new instance of PDF
              $pdf->Open(); //open new PDF Document
              $pdf->setTagDate(date("m/d/Y"));
              Severity: Minor
              Found in fannie/admin/labels/pdf_layouts/WFC_Hybrid_Single.php - About 2 days to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                          foreach($s['depts'] as $d){
                              $record = array(
                                  $d['name'],
                                  sprintf('%.2f',$d['qty']),
                                  sprintf('$%.2f',$d['costs'])
              Severity: Major
              Found in fannie/reports/StoreSummary/StoreSummaryReportAlt.php and 1 other location - About 2 days to fix
              fannie/reports/StoreSummary/StoreSummaryReport.php on lines 297..335

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

              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

                          foreach($s['depts'] as $d){
                              $record = array(
                                  $d['name'],
                                  sprintf('%.2f',$d['qty']),
                                  sprintf('$%.2f',$d['costs'])
              Severity: Major
              Found in fannie/reports/StoreSummary/StoreSummaryReport.php and 1 other location - About 2 days to fix
              fannie/reports/StoreSummary/StoreSummaryReportAlt.php on lines 254..292

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

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

              <?php
              /*******************************************************************************
              
                  Copyright 2012 Whole Foods Co-op
              
              
              Severity: Major
              Found in fannie/classlib2.0/lib/FormLib.php - About 2 days to fix

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

                            if ($count % 16 == 0) {
                                $pdf->AddPage();
                                // draw tick marks for cutting
                                $pdf->Line(2, $height+1.5, 6, $height+1.5);
                                $pdf->Line(2, (2*$height)+1.5, 6, (2*$height)+1.5);
                fannie/modules/plugins2.0/CoopDealsSigns/WfcSmartSigns16UpP.php on lines 48..64

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

                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