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

        while($w = $dbc->fetch_row($skuR)){
            $result = array(
            'sku' => $w['sku'],
            'title' => $this->asciiFilter($w['brand']).' - '. $this->asciiFilter($w['description']),
            'unitSize' => $w['size'],   
Severity: Major
Found in fannie/purchasing/EditOnePurchaseOrder.php and 1 other location - About 3 hrs to fix
fannie/purchasing/EditOnePurchaseOrder.php on lines 95..106

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

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

        while($w = $dbc->fetch_row($upcR)){
            $result = array(
            'sku' => $w['sku'],
            'title' => $this->asciiFilter($w['brand']).' - '. $this->asciiFilter($w['description']),
            'unitSize' => $w['size'],   
Severity: Major
Found in fannie/purchasing/EditOnePurchaseOrder.php and 1 other location - About 3 hrs to fix
fannie/purchasing/EditOnePurchaseOrder.php on lines 73..84

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

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 (CoreLocal::get("balance") < CoreLocal::get("memChargeTotal") && CoreLocal::get("memChargeTotal") > 0){
        if (CoreLocal::get('msgrepeat') == 0){
            CoreLocal::set("boxMsg",sprintf("<b>A/R Imbalance</b><br />
                Total AR payments $%.2f exceeds AR balance %.2f<br />",
                CoreLocal::get("memChargeTotal"),
Severity: Major
Found in pos/is4c-nf/lib/PrehLib.php and 1 other location - About 3 hrs to fix
pos/is4c-nf/lib/TotalActions/ArOverpayAction.php on lines 48..61

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

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 (CoreLocal::get("balance") < CoreLocal::get("memChargeTotal") && CoreLocal::get("memChargeTotal") > 0) {
            if (CoreLocal::get('msgrepeat') == 0) {
                CoreLocal::set("boxMsg",sprintf("<b>A/R Imbalance</b><br />
                    Total AR payments $%.2f exceeds AR balance %.2f<br />",
                    CoreLocal::get("memChargeTotal"),
Severity: Major
Found in pos/is4c-nf/lib/TotalActions/ArOverpayAction.php and 1 other location - About 3 hrs to fix
pos/is4c-nf/lib/PrehLib.php on lines 394..407

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

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

    public function message($val, $ref, $reprint=False){

        global $CORE_LOCAL;

        if ($val == 0) {
Severity: Major
Found in pos/is4c-nf/plugins/CoopCred/receiptMessages/CCredUsedBalances.php - About 3 hrs to fix

    Method omtr_ttl has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    static public function omtr_ttl() 
    {
        // Must have gotten member number before totaling.
        if (CoreLocal::get("memberID") == "0") {
            return MiscLib::baseURL()."gui-modules/memlist.php";
    Severity: Major
    Found in pos/is4c-nf/lib/PrehLib.php - About 3 hrs to fix

      Method checkPassword has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      static public function checkPassword($password)
      {
          $password = strtoupper($password);
          $password = str_replace("'", "", $password);
          $password = str_replace(",", "", $password);
      Severity: Major
      Found in pos/is4c-nf/lib/Authenticate.php - About 3 hrs to fix

        Database has 26 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Database 
        {
        
        /***********************************************************************************************
        
        
        Severity: Minor
        Found in pos/is4c-nf/lib/Database.php - About 3 hrs to fix

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

              public function run()
              {
                  global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
                  $dbc = FannieDB::get($FANNIE_OP_DB);
          
          
          Severity: Major
          Found in fannie/cron/tasks/AutoParsTask.php - About 3 hrs to fix

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

                protected function get_id_view()
                {
                    $idP = $this->connection->prepare('SELECT b.upc, p.department, p.brand, p.description
                            FROM batchList AS b
                                LEFT JOIN products AS p ON b.upc=p.upc AND p.store_id=?
            Severity: Major
            Found in fannie/batches/SplitBatch.php - About 3 hrs to fix

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

                  public function get_view()
                  {
              
                      $dbc = $this->connection;
                      $dbc->selectDB($this->config->get('OP_DB'));
              Severity: Major
              Found in fannie/batches/CAP/CoopDealsSignsPage.php - About 3 hrs to fix

                Method post_u_handler has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function post_u_handler()
                    {
                        if (!is_array($this->u)) {
                            $this->u = array($this->u);
                        }
                Severity: Major
                Found in fannie/admin/labels/SignFromSearch.php - About 3 hrs to fix

                  Method drawSingleKey has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function drawSingleKey($dbc, $id, $n)
                      {
                          $keySize = 15;
                  
                          $pdf = new FPDF('P', 'mm', 'Letter');
                  Severity: Major
                  Found in fannie/admin/PosKeyboards/PosKeyboard.php - About 3 hrs to fix

                    Method post_id_print_handler has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function post_id_print_handler()
                        {
                    
                            $pdf=new FPDF('P','mm','Letter'); //start new instance of PDF
                            $pdf->Open(); //open new PDF Document
                    Severity: Major
                    Found in fannie/modules/plugins2.0/Pickup/ViewPickups.php - About 3 hrs to fix

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

                          protected function get_view()
                          {
                              $settings = $this->config->get('PLUGIN_SETTINGS');
                              $dbc = $this->connection;
                              $dbc->selectDB('HoursTracking');
                      Severity: Major
                      Found in fannie/modules/plugins2.0/WfcHoursTracking/eval/WfcHtEvalList.php - About 3 hrs to fix

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

                            function body_content(){
                                ob_start();
                                ?>
                                <ul>
                                <li><a href="OverShortDayPage.php" target="_WholeByCashier">Whole Day O/S</a>
                        Severity: Major
                        Found in fannie/modules/plugins2.0/OverShortTools/OverShortIndexPage.php - About 3 hrs to fix

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

                              protected function get_id_view()
                              {
                                  $row = $this->getIncident($this->id);
                                  $row['details'] = nl2br($row['details']);
                                  $row['details'] = preg_replace('/#(\d+)/', '<a href="?id=$1">#$1</a>', $row['details']);
                          Severity: Major
                          Found in fannie/modules/plugins2.0/IncidentTracker/PosIncident.php - About 3 hrs to fix

                            Method get_id_sendAs_handler has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function get_id_sendAs_handler()
                                {
                                    if (!file_exists('exporters/'.$this->sendAs.'.php')) {
                                        return $this->unknownRequestHandler();
                                    }
                            Severity: Major
                            Found in fannie/purchasing/ViewPurchaseOrders.php - About 3 hrs to fix

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

                                  public function process_file($linedata, $indexes)
                                  {
                                      global $FANNIE_OP_DB;
                                      $dbc = FannieDB::get($FANNIE_OP_DB);
                              
                              
                              Severity: Major
                              Found in fannie/mem/import/MemNameNumImportPage.php - About 3 hrs to fix

                                Method results_content has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function results_content()
                                    {
                                        global $FANNIE_OP_DB, $FANNIE_SERVER_DBMS;
                                        $dbc = FannieDB::get($FANNIE_OP_DB);
                                
                                
                                Severity: Major
                                Found in fannie/mem/NewMemberTool.php - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language