CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    public function body_content()
    {
        global $FANNIE_OP_DB;
        $dbc = FannieDB::get($FANNIE_OP_DB);
        $superQ = $dbc->prepare("SELECT d.dept_no,dept_name FROM departments as d
Severity: Major
Found in fannie/item/departments/SubDeptEditor.php - About 3 hrs to fix

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

        protected function post_u_view()
        {
            $model = new ProductsModel($this->connection);
            $columns = $model->getColumns();
            $opts = '<option value="">Select field...</option>';
    Severity: Major
    Found in fannie/item/EditFieldFromSearch.php - About 3 hrs to fix

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

      class ProdReviewPage extends FannieRESTfulPage
      {
          protected $must_authenticate = True;
          protected $auth_classes = array('admin');
      
      
      Severity: Minor
      Found in fannie/item/ProdReviewPage.php - About 3 hrs to fix

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

        class MysqlAdapter implements DialectAdapter
        {
            public function createNamedDB($name)
            {
                return 'CREATE DATABASE ' . $this->identifierEscape($name);
        Severity: Minor
        Found in common/sql/MysqlAdapter.php - About 3 hrs to fix

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

          class PgsqlAdapter implements DialectAdapter
          {
              public function createNamedDB($name)
              {
                  return 'CREATE SCHEMA ' . $this->identifierEscape($name);
          Severity: Minor
          Found in common/sql/PgsqlAdapter.php - About 3 hrs to fix

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

            class MssqlAdapter implements DialectAdapter
            {
                public function createNamedDB($name)
                {
                    return 'CREATE DATABASE ' . $this->identifierEscape($name);
            Severity: Minor
            Found in common/sql/MssqlAdapter.php - About 3 hrs to fix

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

              class SqliteAdapter implements DialectAdapter
              {
                  public function createNamedDB($name)
                  {
                      return 'SELECT 1';
              Severity: Minor
              Found in common/sql/SqliteAdapter.php - About 3 hrs to fix

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

                        private QueryExpression ParseExpression()
                        {
                            QueryExpression rootExpression = null;
                            CompositeExpression parentExpression = null;
                
                

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

                          internal static void MergeEnumerableContent(JContainer target, IEnumerable content, JsonMergeSettings settings)
                          {
                              switch (settings.MergeArrayHandling)
                              {
                                  case MergeArrayHandling.Concat:

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

                        function updateState() {
                            state['retention'] = $('#retention').val();
                            state['days'] = [];
                            $('.daycheck').each(function () {
                                state['days'].push($(this).prop('checked') ? true : false);
                    Severity: Major
                    Found in fannie/modules/plugins2.0/RP/rpFloral.js and 3 other locations - About 3 hrs to fix
                    fannie/modules/plugins2.0/RP/rpDirect.js on lines 67..73
                    fannie/modules/plugins2.0/RP/rpDual.js on lines 69..75
                    fannie/modules/plugins2.0/RP/rpOrder.js on lines 67..73

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

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

                        function updateState() {
                            state['retention'] = $('#retention').val();
                            state['days'] = [];
                            $('.daycheck').each(function () {
                                state['days'].push($(this).prop('checked') ? true : false);
                    Severity: Major
                    Found in fannie/modules/plugins2.0/RP/rpDual.js and 3 other locations - About 3 hrs to fix
                    fannie/modules/plugins2.0/RP/rpDirect.js on lines 67..73
                    fannie/modules/plugins2.0/RP/rpFloral.js on lines 18..24
                    fannie/modules/plugins2.0/RP/rpOrder.js on lines 67..73

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

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

                        function updateState() {
                            state['retention'] = $('#retention').val();
                            state['days'] = [];
                            $('.daycheck').each(function () {
                                state['days'].push($(this).prop('checked') ? true : false);
                    Severity: Major
                    Found in fannie/modules/plugins2.0/RP/rpDirect.js and 3 other locations - About 3 hrs to fix
                    fannie/modules/plugins2.0/RP/rpDual.js on lines 69..75
                    fannie/modules/plugins2.0/RP/rpFloral.js on lines 18..24
                    fannie/modules/plugins2.0/RP/rpOrder.js on lines 67..73

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

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

                        function updateState() {
                            state['retention'] = $('#retention').val();
                            state['days'] = [];
                            $('.daycheck').each(function () {
                                state['days'].push($(this).prop('checked') ? true : false);
                    Severity: Major
                    Found in fannie/modules/plugins2.0/RP/rpOrder.js and 3 other locations - About 3 hrs to fix
                    fannie/modules/plugins2.0/RP/rpDirect.js on lines 67..73
                    fannie/modules/plugins2.0/RP/rpDual.js on lines 69..75
                    fannie/modules/plugins2.0/RP/rpFloral.js on lines 18..24

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

                    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

                        private string ExpandUPCE(string upc){
                            string lead = upc.Substring(0,upc.Length-1);
                            string tail = upc.Substring(upc.Length-1);
                    
                            if (tail == "0" || tail == "1" || tail == "2")
                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Magellan_Locking.cs on lines 216..228

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

                    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

                        private string ExpandUPCE(string upc){
                            string lead = upc.Substring(0,upc.Length-1);
                            string tail = upc.Substring(upc.Length-1);
                    
                            if (tail == "0" || tail == "1" || tail == "2")
                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Magellan_Classic.cs on lines 207..219

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

                    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 (CoreLocal::get("runningTotal") <= 4.00 ) {
                            $totalBefore = CoreLocal::get("amtdue");
                            $ret = Database::changeLttTaxCode("HST","GST");
                            if ( $ret !== True ) {
                                TransRecord::addcomment("$ret");
                    Severity: Major
                    Found in pos/is4c-nf/lib/PrehLib.php and 1 other location - About 2 hrs to fix
                    pos/is4c-nf/lib/TotalActions/OntarioMealTaxRebateAction.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 141.

                    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

                            while ($row=$dbc->fetchRow($result)){
                                printf("<tr class=\"datarow\"><td class=\"x-data\">%d</td><td class=\"y-data text-right\">%.2f</td><td class='%s'>%.2f%%</td></tr>",
                                    $row[0],
                                    ($this->selected==-1)?$row[1]:$row[2],
                                    ($this->selected==-1)?'collapse':'text-right',  
                    Severity: Major
                    Found in fannie/reports/SalesToday/SalesTodayReport.php and 1 other location - About 2 hrs to fix
                    fannie/reports/Store-Specific/WFC/DenfeldTodayReport.php on lines 121..131

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

                    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

                            while ($row=$dbc->fetchRow($result)){
                                printf("<tr class=\"datarow\"><td class=\"x-data\">%d</td><td class=\"y-data text-right\">%.2f</td><td class='%s'>%.2f%%</td></tr>",
                                    $row[0],
                                    ($this->selected==-1)?$row[1]:$row[2],
                                    ($this->selected==-1)?'collapse':'text-right',  
                    Severity: Major
                    Found in fannie/reports/Store-Specific/WFC/DenfeldTodayReport.php and 1 other location - About 2 hrs to fix
                    fannie/reports/SalesToday/SalesTodayReport.php on lines 134..144

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

                    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 (CoreLocal::get("runningTotal") <= 4.00 ) {
                                $totalBefore = CoreLocal::get("amtdue");
                                $ret = Database::changeLttTaxCode("HST","GST");
                                if ( $ret !== true ) {
                                    TransRecord::addcomment("$ret");
                    Severity: Major
                    Found in pos/is4c-nf/lib/TotalActions/OntarioMealTaxRebateAction.php and 1 other location - About 2 hrs to fix
                    pos/is4c-nf/lib/PrehLib.php on lines 374..388

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

                    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 ($w['discounttype'] == 1 || $w['discounttype'] == 2) {
                                    $ret .= '<td id="discPercent'.$w['upc'].'">Sale</td>';
                                } else if ($w['regPrice'] != $w['total']) {
                                    $ret .= sprintf('<td id="discPercent%s">%d%%</td>',$w['upc'],
                                        round(100*(($w['regPrice']-$w['total'])/$w['regPrice'])));
                    Severity: Major
                    Found in fannie/ordering/ajax-calls.php and 1 other location - About 2 hrs to fix
                    fannie/ordering/ajax-calls.php on lines 1361..1368

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language