CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

                <p>
                    <div className="input-group">
                        <span className="input-group input-group-addon">Name</span>
                        <input type="text" className="form-control" value={this.props.ecName}
                            onChange={(ev) => this.props.manageData.save(ev.target.value)} />
Severity: Major
Found in fannie/batches/EndCapper/src/ToolBar.js and 2 other locations - About 4 hrs to fix
fannie/batches/EndCapper/src/ToolBar.js on lines 145..151
fannie/batches/EndCapper/src/ToolBar.js on lines 152..158

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

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

                <p>
                    <div className="input-group">
                        <span className="input-group input-group-addon">Start Date</span>
                        <input type="text" className="form-control date-field" value={this.props.startDate}
                            onChange={(ev) => this.props.manageData.start(ev.target.value)} />
Severity: Major
Found in fannie/batches/EndCapper/src/ToolBar.js and 2 other locations - About 4 hrs to fix
fannie/batches/EndCapper/src/ToolBar.js on lines 138..144
fannie/batches/EndCapper/src/ToolBar.js on lines 152..158

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

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

    protected function variable_slip($ref, $reprint=False, $sigSlip=False){
        global $CORE_LOCAL;
        $date = ReceiptLib::build_time(time());
        list($emp,$reg,$trans) = explode('-', $ref);
        $sort = 'asc';
Severity: Major
Found in pos/is4c-nf/plugins/CoopCred/receiptMessages/CCredSigSlip.php - About 4 hrs to fix

    Method draw has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function draw()
        {
            if (!CoreLocal::get('touchscreen')) {
                return '';
            }
    Severity: Major
    Found in pos/is4c-nf/lib/Notifiers/NumPad.php - About 4 hrs to fix

      Method javascript_content has 101 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function javascript_content()
          {
              ob_start();
              ?>
              $('.green-green').each(function(){
      Severity: Major
      Found in fannie/batches/UNFI/VendorPricingBatchPage.php - About 4 hrs to fix

        Method get_view has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function get_view()
            {
                $dbc = $this->connection;
                $activeP = $dbc->prepare("
                    SELECT COUNT(*) AS num
        Severity: Major
        Found in fannie/modules/plugins2.0/CoreWarehouse/reports/CwNewDemos.php - About 4 hrs to fix

          Method drawPDF has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function drawPDF()
              {
                  $pdf = new \FPDF('P', 'mm', 'Letter');
                  $pdf->SetMargins(6.35, 6.35, 6.35);
                  $pdf->SetAutoPageBreak(false);
          Severity: Major
          Found in fannie/classlib2.0/item/signage/Giganto2UpP.php - About 4 hrs to fix

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

                        if ($item['originShortName'] != '') {
                            $pdf->SetXY($this->left, $this->top + ($this->height*$row) + ($this->height - $this->top - 20));
                            $pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
                            $lower = trim(strtolower($item['originShortName']));
                            if (substr($lower, 0, 10) !== 'product of') {
            Severity: Major
            Found in fannie/classlib2.0/item/signage/Giganto2UpP.php and 1 other location - About 4 hrs to fix
            fannie/classlib2.0/item/signage/Signage2UpP.php on lines 122..130

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

            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 ($item['originShortName'] != '') {
                        $pdf->SetXY($this->left, $this->top + ($this->height*$row) + ($this->height - $this->top - 20));
                        $pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
                        $lower = trim(strtolower($item['originShortName']));
                        if (substr($lower, 0, 10) !== 'product of') {
            Severity: Major
            Found in fannie/classlib2.0/item/signage/Signage2UpP.php and 1 other location - About 4 hrs to fix
            fannie/classlib2.0/item/signage/Giganto2UpP.php on lines 132..157

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

            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

                    $data[] = array(
                        'Sales',
                        number_format($total_sales->lastYear, 0),
                        number_format($total_sales->projected, 0),
                        '',
            fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 645..659

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

            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

                    $data[] = array(
                        'Sales',
                        number_format($total_sales->lastYear, 0),
                        number_format($total_sales->projected, 0),
                        '',
            fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 719..733

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

            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 ($transNum) {
                        $dlog = $this->config->get('TRANS_DB') . $this->connection->sep() . 'dlog';
                        $correctP = $this->connection->prepare("
                            SELECT *
                            FROM {$dlog}
            Severity: Major
            Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php and 1 other location - About 4 hrs to fix
            fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php on lines 355..377

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

            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 ($transNum) {
                        $dlog = $this->config->get('TRANS_DB') . $this->connection->sep() . 'dlog';
                        $correctP = $this->connection->prepare("
                            SELECT *
                            FROM {$dlog}
            Severity: Major
            Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php and 1 other location - About 4 hrs to fix
            fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php on lines 355..377

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

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

            using System;
            using System.Collections.Generic;
            
            namespace HidSharp.ReportDescriptors.Parser
            {

              Method variable_slip has 100 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function variable_slip($ref, $reprint=False, $sigSlip=False){
                      global $CORE_LOCAL;
                      $date = ReceiptLib::build_time(time());
                      list($emp,$reg,$trans) = explode('-', $ref);
                      $sort = 'asc';
              Severity: Major
              Found in pos/is4c-nf/plugins/CoopCred/receiptMessages/CCredUsedBalances.php - About 4 hrs to fix

                TenderEditor has 32 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class TenderEditor extends FannieRESTfulPage 
                {
                    protected $title = "Fannie : Tenders";
                    protected $header = "Tenders";
                    protected $must_authenticate = True;
                Severity: Minor
                Found in fannie/admin/Tenders/TenderEditor.php - About 4 hrs to fix

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

                      protected function get_id_view()
                      {
                          $order = new PickupOrdersModel($this->connection);
                          $order->pickupOrderID($this->id);
                          $order->load();
                  Severity: Major
                  Found in fannie/modules/plugins2.0/Pickup/ViewPickups.php - About 4 hrs to fix

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

                        public function process_file($linedata, $indexes)
                        {
                            global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
                            $EMP_NO = $this->config->get('EMP_NO');
                            $LANE_NO = $this->config->get('REGISTER_NO');
                    Severity: Major
                    Found in fannie/modules/plugins2.0/WfcAbandonEquity/WfcAbandonEquityImport.php - About 4 hrs to fix

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

                          protected function get_id_view()
                          {
                              $dbc = FannieDB::get($this->config->get('OP_DB'));
                              $ret = '<form method="post">
                                  <input type="hidden" name="id" value="' . $this->id . '" />
                      Severity: Major
                      Found in fannie/item/vendors/DeliVendorAliasPage.php - About 4 hrs to fix

                        Class JsonReader has 32 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                            public abstract class JsonReader : IDisposable
                            {
                                /// <summary>
                                /// Specifies the state of the reader.
                                /// </summary>
                          Severity
                          Category
                          Status
                          Source
                          Language