CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method GetInfo has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        internal unsafe bool GetInfo()
        {
            IntPtr udev = NativeMethods.udev_new();
            if (IntPtr.Zero != udev)
            {

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

            if ($dow >= 6 || $dow <= 2) {
                $ts = time();
                while (date('N', $ts) != 3) {
                    $ts = mktime(0, 0, 0, date('n',$ts), date('j',$ts) + 1, date('Y',$ts));
                }
    Severity: Major
    Found in fannie/modules/plugins2.0/RP/RpDirectPage.php and 2 other locations - About 2 hrs to fix
    fannie/modules/plugins2.0/RP/RpDualPage.php on lines 470..476
    fannie/modules/plugins2.0/RP/RpOrderPage.php on lines 450..456

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

    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

            if ($dow >= 6 || $dow <= 2) {
                $ts = time();
                while (date('N', $ts) != 3) {
                    $ts = mktime(0, 0, 0, date('n',$ts), date('j',$ts) + 1, date('Y',$ts));
                }
    Severity: Major
    Found in fannie/modules/plugins2.0/RP/RpDualPage.php and 2 other locations - About 2 hrs to fix
    fannie/modules/plugins2.0/RP/RpDirectPage.php on lines 431..437
    fannie/modules/plugins2.0/RP/RpOrderPage.php on lines 450..456

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

    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

            if ($dow >= 6 || $dow <= 2) {
                $ts = time();
                while (date('N', $ts) != 3) {
                    $ts = mktime(0, 0, 0, date('n',$ts), date('j',$ts) + 1, date('Y',$ts));
                }
    Severity: Major
    Found in fannie/modules/plugins2.0/RP/RpOrderPage.php and 2 other locations - About 2 hrs to fix
    fannie/modules/plugins2.0/RP/RpDirectPage.php on lines 431..437
    fannie/modules/plugins2.0/RP/RpDualPage.php on lines 470..476

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

    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 ($d == '5.00'){
                    $val = $holding['changeOrder'][$d] + $holding['openSafeCount'][$d] + $holding['dropAmount'][$d] - $pars['5.00'] - (50*$bags);
                    $val = round($val,2);
                    if ($val < 0) $val = 0;
                    $ret .= "<td id=depositAmount$d>".$val."</td>";
    fannie/modules/plugins2.0/OverShortTools/OverShortSafecountPage.php on lines 299..347

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

    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

        private function getTransactions()
        {
            $dbc = Database::tDataConnect();
            $query = "
                SELECT register_no, 
    Severity: Major
    Found in pos/is4c-nf/gui-modules/rplist.php and 1 other location - About 2 hrs to fix
    pos/is4c-nf/gui-modules/giftReceiptList.php on lines 82..111

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

    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 ($d == '10.00'){
                    $val = $holding['changeOrder'][$d] + $holding['openSafeCount'][$d] + $holding['dropAmount'][$d] - $pars['10.00'] - (50*$bags);
                    $val = round($val,2);
                    if ($val < 0) $val = 0;
                    $ret .= "<td id=depositAmount$d>".$val."</td>";
    fannie/modules/plugins2.0/OverShortTools/OverShortSafecountPage.php on lines 307..347

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

    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

        private function getTransactions()
        {
            $dbc = Database::tDataConnect();
            $query = "
                SELECT register_no, 
    Severity: Major
    Found in pos/is4c-nf/gui-modules/giftReceiptList.php and 1 other location - About 2 hrs to fix
    pos/is4c-nf/gui-modules/rplist.php on lines 117..145

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

    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

            case STATE_GET_SIGNATURE:
                if (msg.Length == 4 && msg[0] == 0x7a){
                    //SendReport(BuildCommand(DoBeep()));
                    if (msg[1] == BUTTON_SIG_RESET){
                        SendReport(BuildCommand(LcdClearSignature()));
    pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 240..255

    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

            case STATE_GET_SIGNATURE:
                if (msg.Length == 4 && msg[0] == 0x7a){
                    //SendReport(BuildCommand(DoBeep()));
                    if (msg[1] == BUTTON_SIG_RESET){
                        SendReport(BuildCommand(LcdClearSignature()));
    pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 639..654

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

    <?php
    /*******************************************************************************
    
        Copyright 2013 Whole Foods Co-op
    
    
    Severity: Minor
    Found in fannie/modules/plugins2.0/WfcHoursTracking/WfcHtListPage.php - About 2 hrs to fix

      File WfcGazetteBillingPage.php has 259 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      include(dirname(__FILE__).'/../../../config.php');
      if (!class_exists('FannieAPI')) {
          include_once(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
      }
      Severity: Minor
      Found in fannie/modules/plugins2.0/WfcGazetteBilling/WfcGazetteBillingPage.php - About 2 hrs to fix

        Function memNumEntered has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            mod.memNumEntered = function(){
                var oid = $('#orderID').val();
                var cardno = $('#memNum').val();    
                $.ajax({
                    type: 'get',
        Severity: Major
        Found in fannie/ordering/orderview.js - About 2 hrs to fix

          Method head_content has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function head_content(){
                  ?>
                  <script type="text/javascript">
                  var formSubmitted = false;
                  function submitWrapper(){
          Severity: Major
          Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvSuccess.php - About 2 hrs to fix

            Method head_content has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function head_content()
                {
                    ?>
                    <script type="text/javascript">
                    var formSubmitted = false;
            Severity: Major
            Found in pos/is4c-nf/plugins/Paycards/gui/paycardSuccess.php - About 2 hrs to fix

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

                  private function sendVoid($skipReversal=False,$domain="w1.mercurypay.com")
                  {
                      // initialize
                      $dbTrans = PaycardLib::paycard_db();
                      if (!$dbTrans){
              Severity: Major
              Found in pos/is4c-nf/plugins/Paycards/MercuryE2E.php - About 2 hrs to fix

                Method getInventory has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function getInventory($upc, $description)
                    {
                        $dbc = Database::mDataConnect();
                        if ($dbc === false || !$dbc->isConnected()) {
                            return DisplayLib::boxMsg(
                Severity: Major
                Found in pos/is4c-nf/plugins/Inventory/InventoryCheck.php - About 2 hrs to fix

                  Method save has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function save($filename) {
                          // prepare the image
                          $rowBytes = (int)((($this->width * $this->bpp) + 7) / 8);
                          $rowDataSize = (int)((($this->width * $this->bpp) + 31) / 32) * 4;
                          if ($rowBytes > $rowDataSize) {
                  Severity: Major
                  Found in pos/is4c-nf/lib/Bitmap.php - About 2 hrs to fix

                    Method logActivity has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function logActivity($dbc, $depts)
                        {
                            $errors = array();
                            $dlist = "(";
                            $case_args = array();
                    Severity: Major
                    Found in fannie/cron/tasks/ArHistoryTask.php - About 2 hrs to fix

                      Method get_upc_view has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function get_upc_view()
                          {
                              global $FANNIE_OP_DB;
                              $dbc = FannieDB::get($FANNIE_OP_DB);
                              $upc = FormLib::get('upc');
                      Severity: Major
                      Found in fannie/batches/batchhistory/BatchHistoryPage.php - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language