CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method TryConvertInternal has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring.
Open

        private static ConvertResult TryConvertInternal(object initialValue, CultureInfo culture, Type targetType, out object value)
        {
            if (initialValue == null)
                throw new ArgumentNullException("initialValue");

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

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

function saveChangeOrder(){
    var ret = '';
    $('.denom').each(function(){
        var denom = $(this).val();
        var elem = document.getElementById('changeOrder'+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 84..94
fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 87..97

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

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 saveChangeOrder(){
    var ret = '';
    $('.denom').each(function(){
        var denom = $(this).val();
        var elem = document.getElementById('changeOrder'+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 73..83
fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 84..94

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

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 saveChangeOrder(){
    var ret = '';
    $('.denom').each(function(){
        var denom = $(this).val();
        var elem = document.getElementById('changeOrder'+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 73..83
fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 87..97

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

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

  class Fannie_Standard_PDF extends FpdfWithBarcode
  {
    function barcodeText($x, $y, $h, $barcode, $len)
    {
      $this->SetFont('Arial','',9);
Severity: Major
Found in fannie/admin/labels/pdf_layouts/Fannie_Standard.php and 2 other locations - About 3 hrs to fix
fannie/admin/labels/pdf_layouts/YPSI_rev_001.php on lines 27..37
fannie/admin/labels/pdf_layouts/Zebra_Single_Label.php on lines 27..37

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

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

  class Zebra_Single_Label_PDF extends FpdfWithBarcode
  {
    function barcodeText($x, $y, $h, $barcode, $len)
    {
      $this->SetFont('Arial','',9);
Severity: Major
Found in fannie/admin/labels/pdf_layouts/Zebra_Single_Label.php and 2 other locations - About 3 hrs to fix
fannie/admin/labels/pdf_layouts/Fannie_Standard.php on lines 27..37
fannie/admin/labels/pdf_layouts/YPSI_rev_001.php on lines 27..37

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

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

  class YPSI_rev_001_PDF extends FpdfWithBarcode
  {
    function barcodeText($x, $y, $h, $barcode, $len)
    {
      $this->SetFont('Arial','',9);
Severity: Major
Found in fannie/admin/labels/pdf_layouts/YPSI_rev_001.php and 2 other locations - About 3 hrs to fix
fannie/admin/labels/pdf_layouts/Fannie_Standard.php on lines 27..37
fannie/admin/labels/pdf_layouts/Zebra_Single_Label.php on lines 27..37

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

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

var qlEdit = (function () {

    var mod = {};

    /** Vue instance
Severity: Major
Found in fannie/modules/plugins2.0/QuickLookups/qlEdit.js - About 3 hrs to fix

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

        public function fetch_report_data()
        {
            $dbc = $this->connection;
            try {
                $supers = $this->form->super;
    Severity: Major
    Found in fannie/reports/OrderingReport/OrderingReport.php - About 3 hrs to fix

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

          function fetch_report_data()
          {
              $super = FormLib::get('super', null);
              $dept1 = FormLib::get('deptStart', null);
              $dept2 = FormLib::get('deptEnd', null);
      Severity: Major
      Found in fannie/reports/ScalePLUs/ScalePLUReport.php - About 3 hrs to fix

        Method generateSquareTagsTag has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function generateSquareTagsTag($x, $y, $guide, $width, $height, $pdf, $row, $dbc)
        {
            $upc = $row['upc'];
            $desc = $row['description'];
            $showPrice = FormLib::get('showPrice', false);
        Severity: Major
        Found in fannie/admin/labels/pdf_layouts/New_WFC_Deli_SquareTags.php - About 3 hrs to fix

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

              protected function get_id_view()
              {
                  if (!$this->invoice) {
                      return '<div class="alert alert-danger">Invoice not found</div>' . $this->get_view();
                  }
          Severity: Major
          Found in fannie/modules/plugins2.0/PIKiller/B2BInvoicePage.php - About 3 hrs to fix

            File taxonly.php has 328 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            use COREPOS\Fannie\API\item\StandardAccounting;
            //header('Content-Type: application/ms-excel');
            //header('Content-Disposition: attachment; filename="EOMreport.xls"');
            include('../../../../config.php');
            Severity: Minor
            Found in fannie/reports/Store-Specific/WFC/EOMreport/taxonly.php - About 3 hrs to fix

              Method getItemData has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function getItemData($arr)
                  {
                      $ret = '';
                      /**
                        Convert balance to a more useful format.
              Severity: Major
              Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvWic.php - About 3 hrs to fix

                Method sendVoid has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function sendVoid()
                    {
                        // initialize
                        $dbTrans = PaycardLib::paycard_db();
                        if (!$dbTrans) {
                Severity: Major
                Found in pos/is4c-nf/plugins/Paycards/GoEMerchant.php - About 3 hrs to fix

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

                      public function fetch_report_data()
                      {
                          global $FANNIE_OP_DB, $FANNIE_ARCHIVE_DB;
                          $dbc = FannieDB::get($FANNIE_OP_DB);
                          try {
                  Severity: Major
                  Found in fannie/reports/WicSalesReport/WicSalesReport.php - About 3 hrs to fix

                    Method generateHerbNspiceFlatLabel has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function generateHerbNspiceFlatLabel($x, $y, $guide, $width, $height, $pdf, $row, $dbc, $showPrice, $offset, $tagNo)
                    {
                        $pdf->SetFont('Gill','', 16);
                        define('FPDF_FONTPATH', __DIR__. '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/');
                        $signage = new COREPOS\Fannie\API\item\FannieSignage(array());
                    Severity: Major
                    Found in fannie/admin/labels/pdf_layouts/WFC_HerbNspice_Flat.php - About 3 hrs to fix

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

                          protected function get_id_view(){
                              global $FANNIE_TRANS_DB,$FANNIE_URL;
                              $table = DTransactionsModel::selectDlog($this->__models['start'],$this->__models['end']);
                              $my = date('Ym',strtotime($this->__models['start']));
                      
                      
                      Severity: Major
                      Found in fannie/modules/plugins2.0/PIKiller/PIPurchasesPage.php - About 3 hrs to fix

                        Method process_file has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function process_file($linedata, $indexes)
                            {
                                $getStoreP = $this->connection->prepare("SELECT posID FROM LbmxStores WHERE lbmxID=?");
                                $getVendorP = $this->connection->prepare("SELECT posID FROM LbmxVendors WHERE lbmxID=?");
                                $getPoP = $this->connection->prepare("SELECT orderID FROM PurchaseOrder WHERE storeID=? AND vendorID=? AND vendorInvoiceID=?");
                        Severity: Major
                        Found in fannie/modules/plugins2.0/LBMX/LbmxImport.php - About 3 hrs to fix

                          Method getTotals has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function getTotals($date1, $date2, $store)
                              {
                                  $settings = $this->config->get('PLUGIN_SETTINGS');
                                  $dbc = $this->connection;
                                  $dbc->selectDB($settings['OverShortDatabase']);
                          Severity: Major
                          Found in fannie/modules/plugins2.0/OverShortTools/OsVarianceReport.php - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language