CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

            else if (contract.DefaultCreator != null && (!contract.DefaultCreatorNonPublic || Serializer._constructorHandling == ConstructorHandling.AllowNonPublicDefaultConstructor))
            {
                object list = contract.DefaultCreator();

                if (contract.ShouldCreateWrapper)
pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs on lines 1075..1096

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

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

            else if (contract.DefaultCreator != null && (!contract.DefaultCreatorNonPublic || Serializer._constructorHandling == ConstructorHandling.AllowNonPublicDefaultConstructor))
            {
                object dictionary = contract.DefaultCreator();

                if (contract.ShouldCreateWrapper)
pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs on lines 1044..1065

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

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

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

    Copyright 2007,2010 Whole Foods Co-op

Severity: Minor
Found in pos/is4c-nf/lib/gui/BasicCorePage.php - About 2 hrs to fix

    File New_WFC_Deli_Regular.php has 279 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    use COREPOS\Fannie\API\FanniePlugin;
    if (!class_exists('FpdfWithBarcode')) {
        include(dirname(__FILE__) . '/../FpdfWithBarcode.php');
    }
    Severity: Minor
    Found in fannie/admin/labels/pdf_layouts/New_WFC_Deli_Regular.php - About 2 hrs to fix

      File PayrollSummaryPage.php has 279 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php # payroll.php - Generates a bi-monthly statement from timesheet table.
      include(dirname(__FILE__).'/../../../config.php');
      if (!class_exists('FannieAPI')) {
          include_once(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
      }
      Severity: Minor
      Found in fannie/modules/plugins2.0/TimesheetPlugin/PayrollSummaryPage.php - About 2 hrs to fix

        Method varied_message has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function varied_message($ref, $reprint=false, $sigSlip=false)
            {
                if (CoreLocal::get('autoReprint') == 1) {
                    $sigSlip = true;
                }
        Severity: Major
        Found in pos/is4c-nf/lib/ReceiptBuilding/Messages/GCReceiptMessage.php - About 2 hrs to fix

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

              public function run()
              {
                  $dbc = FannieDB::get($this->config->get('TRANS_DB'));
          
                  $currentMax = $this->findMax($dbc);
          Severity: Major
          Found in fannie/cron/tasks/one-time/AddIDsToOldTransactions.php - About 2 hrs to fix

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

                public function helpContent()
                {
                    return '<p>Recalculate suggested retail prices for items from
                        a given vendor. This takes place in three steps.
                        <ul>
            Severity: Major
            Found in fannie/batches/UNFI/RecalculateVendorSRPs.php - About 2 hrs to fix

              Method basicForm has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function basicForm()
                  {
                      $batchtypes = $this->get_batch_types();
                      $dbc = FannieDB::get($this->config->get('OP_DB'));
                      $owners = new MasterSuperDeptsModel($dbc);
              Severity: Major
              Found in fannie/batches/xlsbatch/XlsBatchPage.php - About 2 hrs to fix

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

                    public function form_content()
                    {
                        ob_start();
                        ?>
                <form method="get" class="form-horizontal">
                Severity: Major
                Found in fannie/reports/HourlyTrans/HourlyTransReport.php - About 2 hrs to fix

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

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

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

                        public function fetch_report_data()
                        {
                            $dbc = $this->connection;
                            $tx_dbc = $dbc;
                            $op_dbc = $dbc;
                    Severity: Major
                    Found in fannie/reports/DDD/SingleItemDDDReport.php - About 2 hrs to fix

                      Method WFC_Deli_Narrow_24UP has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function WFC_Deli_Narrow_24UP($data,$offset=0,$showPrice=0)
                      {
                          $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
                          $pdf = new WFC_Deli_Narrow_24UP_PDF('L','mm','Letter');
                          $pdf->AddPage();
                      Severity: Major
                      Found in fannie/admin/labels/pdf_layouts/WFC_Deli_Narrow_24UP.php - About 2 hrs to fix

                        Method WFC_Dark_Extended_24UP has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function WFC_Dark_Extended_24UP($data,$offset=0,$showPrice=0)
                        {
                            $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
                            $pdf = new WFC_Dark_Extended_24UP_PDF('L','mm','Letter');
                            $pdf->AddPage();
                        Severity: Major
                        Found in fannie/admin/labels/pdf_layouts/WFC_Dark_Extended_24UP.php - About 2 hrs to fix

                          Method WFC_Deli_Short_24UP has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function WFC_Deli_Short_24UP($data,$offset=0,$showPrice=0)
                          {
                              $dbc = FannieDB::get(FannieConfig::config('OP_DB'));
                              $pdf = new WFC_Deli_Short_24UP_PDF('L','mm','Letter');
                              $pdf->AddPage();
                          Severity: Major
                          Found in fannie/admin/labels/pdf_layouts/WFC_Deli_Short_24UP.php - About 2 hrs to fix

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

                                public function run()
                                {
                                    $settings = $this->config->get('PLUGIN_SETTINGS');
                                    $dbc = FannieDB::get($settings['ScheduledEmailDB']);
                            
                            
                            Severity: Major
                            Found in fannie/modules/plugins2.0/ScheduledEmails/ScheduledEmailSendTask.php - About 2 hrs to fix

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

                                  protected function get_view()
                                  {
                                      $hrEdit = FannieAuth::validateUserQuiet('hr_editor');
                                      $illnessEdit = FannieAuth::validateUserQuiet('illness_editor');
                                      $ret  = '<table class="table table-bordered table-striped">';
                              Severity: Major
                              Found in fannie/modules/plugins2.0/HrWeb/HrMenu.php - About 2 hrs to fix

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

                                    public function run()
                                    {
                                        $settings = $this->config->get('PLUGIN_SETTINGS');
                                        $dbc = FannieDB::get($settings['CommentDB']);
                                        $cmP = $dbc->prepare("SELECT * FROM Comments WHERE categoryID=? AND ccNotified=0");
                                Severity: Major
                                Found in fannie/modules/plugins2.0/CommentTracker/CommentSummaryTask.php - About 2 hrs to fix

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

                                      public function fetch_report_data()
                                      {
                                          $dbc = FannieDB::get('HoursTracking');
                                          
                                          // get level info
                                  Severity: Major
                                  Found in fannie/modules/plugins2.0/WfcHoursTracking/reports/WfcPtoStudy.php - About 2 hrs to fix

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

                                        function body_content(){
                                            global $FANNIE_OP_DB, $FANNIE_PLUGIN_SETTINGS;
                                            $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
                                            if ($this->display_func == 'ts_error')
                                                return $this->error_content();
                                    Severity: Major
                                    Found in fannie/modules/plugins2.0/TimesheetPlugin/EditTimesheetDatePage.php - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language