CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/OverShortTools/js/count.js

Summary

Maintainability
F
1 wk
Test Coverage

File count.js has 365 lines of code (exceeds 250 allowed). Consider refactoring.
Open

function loader(){
    $('#display').html('');
    var date1 = $('#startDate').val();
    var date2 = $('#endDate').val();
    var store = $('select[name=store]').val();
Severity: Minor
Found in fannie/modules/plugins2.0/OverShortTools/js/count.js - About 4 hrs to fix

    Function updateBuyAmount has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function updateBuyAmount(d){
        if (d === 'Checks' || d === '100.00' || d === '50.00' || d === '20.00' || d === 'Junk')
            return;
    
        $('.denom').each(function(){
    Severity: Major
    Found in fannie/modules/plugins2.0/OverShortTools/js/count.js - About 2 hrs to fix

      Function updateDepositAmount has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function updateDepositAmount(d){
          var val = 0;
          var count = 0;
          switch(d){
          case '10.00':
      Severity: Major
      Found in fannie/modules/plugins2.0/OverShortTools/js/count.js - About 2 hrs to fix

        Function updateBuyAmount has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function updateBuyAmount(d){
            if (d === 'Checks' || d === '100.00' || d === '50.00' || d === '20.00' || d === 'Junk')
                return;
        
            $('.denom').each(function(){
        Severity: Minor
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function updateCloseAmount has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        function updateCloseAmount(d) {
            var fields = ['changeOrder', 'safeCount1', 'dropAmount']; 
            var sum = 0;
            for (var i = 0; i < fields.length; i++) {
                var id = fields[i] + "" + d;
        Severity: Minor
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js - About 55 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function saveAtmAmount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function saveAtmAmount(){
            var ret = '';
            if ($('#atmFill').length !== 0) {
                ret += 'fill:'+$('#atmFill').val();
            } else {
        Severity: Minor
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js - About 25 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

        function loader(){
            $('#display').html('');
            var date1 = $('#startDate').val();
            var date2 = $('#endDate').val();
            var store = $('select[name=store]').val();
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 1 other location - About 5 hrs to fix
        fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 1..14

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

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

        function resumInputs(rowname){
            var sum = 0;
        
            $('.denom').each(function(){
                denom = $(this).val();
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 4 other locations - About 4 hrs to fix
        fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 157..169
        fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 171..181
        fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 160..172
        fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 174..184

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

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

            case '0.25':
                count = Math.floor(Number(document.getElementById('dropAmount'+d).value) / 10);
                val = Number(document.getElementById('dropAmount'+d).value) - (10*count);
                document.getElementById('depositAmount'+d).innerHTML = Math.round(val*100)/100;
                updateBuyAmount(d);
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 4 hrs to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 288..293
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 294..299
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 300..305

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

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

            case '0.01':
                count = Math.floor(Number(document.getElementById('dropAmount'+d).value) / 0.50);
                val = Number(document.getElementById('dropAmount'+d).value) - (0.50*count);
                document.getElementById('depositAmount'+d).innerHTML = Math.round(val*100)/100;
                updateBuyAmount(d);
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 4 hrs to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 282..287
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 288..293
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 294..299

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

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

            case '0.10':
                count = Math.floor(Number(document.getElementById('dropAmount'+d).value) / 5);
                val = Number(document.getElementById('dropAmount'+d).value) - (5*count);
                document.getElementById('depositAmount'+d).innerHTML = Math.round(val*100)/100;
                updateBuyAmount(d);
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 4 hrs to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 282..287
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 294..299
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 300..305

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

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

            case '0.05':
                count = Math.floor(Number(document.getElementById('dropAmount'+d).value) / 2);
                val = Number(document.getElementById('dropAmount'+d).value) - (2*count);
                document.getElementById('depositAmount'+d).innerHTML = Math.round(val*100)/100;
                updateBuyAmount(d);
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 4 hrs to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 282..287
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 288..293
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 300..305

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

        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

        function saveChangeOrder(){
            var ret = '';
            $('.denom').each(function(){
                var denom = $(this).val();
                var elem = document.getElementById('changeOrder'+denom);
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 2 other locations - About 3 hrs to fix
        fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 84..94
        fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 87..97

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

        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

        function saveOpenSafeCount(){
            var ret = '';
            $('.denom').each(function(){
                var denom = $(this).val();
                var elem = document.getElementById('safeCount1'+denom);
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 2 other locations - About 3 hrs to fix
        fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 96..105
        fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 99..108

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

        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

        function saveRow(rowName){
            var ret = '';
            $('.denom').each(function(){
                var denom = $(this).val();
                var elem = document.getElementById(rowName+denom);
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 2 other locations - About 3 hrs to fix
        fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 40..50
        fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 43..53

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

        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

            var args = 'action=save&date1='+date1+'&date2='+date2+'&changeOrder='+changeOrder+'&openSafeCount='+openSafeCount+'&closeSafeCount='+closeSafeCount+'&buyAmount='+buyAmount+'&dropAmount='+dropAmount+"&depositAmount="+depositAmount+'&atmAmount='+atmAmount+'&store='+store;
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 1 other location - About 2 hrs to fix
        fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 31..31

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

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

            if (overs[3] != 0){
                v = Number(document.getElementById('buyAmount0.01').innerHTML);
                document.getElementById('buyAmount0.01').innerHTML = v + overs[3];
            }
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 1 hr to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 367..370
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 371..374
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 375..378

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

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

            if (overs[1] != 0){
                v = Number(document.getElementById('buyAmount0.10').innerHTML);
                document.getElementById('#buyAmount0.10').innerHTML = v + overs[1];
            }
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 1 hr to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 367..370
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 375..378
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 379..382

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

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

            if (overs[0] != 0){
                v = Number(document.getElementById('buyAmount0.25').innerHTML);
                document.getElementById('buyAmount0.25').innerHTML = v + overs[0];
            }
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 1 hr to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 371..374
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 375..378
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 379..382

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

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

            if (overs[2] != 0){
                v = Number(document.getElementById('buyAmount0.05').innerHTML);
                document.getElementById('buyAmount0.05').innerHTML = v + overs[2];
            }
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 1 hr to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 367..370
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 371..374
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 379..382

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

        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

            while (v % 50 != 0 && i < 50){
                v = v - 1;
                overage = overage + 1;
                i = i+1;
            }
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 2 other locations - About 1 hr to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 341..345
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 350..354

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

        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

            while (v % 50 != 0 && i < 5){
                v = v - 10;
                overage = overage + 10;
                i = i+1;
            }
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 2 other locations - About 1 hr to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 350..354
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 359..363

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

        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

            while (v % 50 != 0 && i < 10){
                v = v - 5;
                overage = overage + 5;
                i = i+1;
            }
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 2 other locations - About 1 hr to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 341..345
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 359..363

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

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

            if ($('#atmFill').length !== 0) {
                ret += 'fill:'+$('#atmFill').val();
            } else {
                ret += 'fill:0';
            }
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 50 mins to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 60..64
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 65..69
        fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 76..80

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

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

            if ($('#atmCount').length !== 0) {
                ret += '|count:'+$('#atmCount').val();
            } else {
                ret += '|count:0';
            }
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 50 mins to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 55..59
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 60..64
        fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 76..80

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

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

            if ($('#atmReject').length !== 0) {
                ret += '|reject:'+$('#atmReject').val();
            } else {
                ret += '|reject:0';
            }
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 50 mins to fix
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 55..59
        fannie/modules/plugins2.0/OverShortTools/js/count.js on lines 65..69
        fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 76..80

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

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

            $.ajax({
                url: 'OverShortSafecountPage.php',
                type: 'post',
                data: args,
                success: function(data){
        Severity: Major
        Found in fannie/modules/plugins2.0/OverShortTools/js/count.js and 3 other locations - About 30 mins to fix
        fannie/modules/plugins2.0/OverShortTools/js/cashier.js on lines 73..80
        fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 30..37
        fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 33..40

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

        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

        There are no issues that match your filters.

        Category
        Status