KarrLab/nose2unitth

View on GitHub

Showing 23 of 23 total issues

Function TableSort has a Cognitive Complexity of 182 (exceeds 5 allowed). Consider refactoring.
Open

function TableSort() {
    
    var table = new Object; // The table to be sorted
    var columnNames = new Array;
    var tableRows = new Array;
Severity: Minor
Found in examples/html/js/tablesort.js - About 3 days 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 TableSort has 184 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function TableSort() {
    
    var table = new Object; // The table to be sorted
    var columnNames = new Array;
    var tableRows = new Array;
Severity: Major
Found in examples/html/js/tablesort.js - About 7 hrs to fix

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

                    if 'failure' in case:
                        failure_xml = doc_xml.createElement('failure')
                        failure_xml.setAttribute('type', case['failure']['type'])
                        failure_xml.setAttribute('message', case['failure']['message'])
                        case_xml.appendChild(failure_xml)
    Severity: Major
    Found in nose2unitth/core.py and 2 other locations - About 6 hrs to fix
    nose2unitth/core.py on lines 119..126
    nose2unitth/core.py on lines 137..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 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 3 locations. Consider refactoring.
    Open

                    if 'skipped' in case:
                        skipped_xml = doc_xml.createElement('skipped')
                        skipped_xml.setAttribute('type', case['skipped']['type'])
                        skipped_xml.setAttribute('message', case['skipped']['message'])
                        case_xml.appendChild(skipped_xml)
    Severity: Major
    Found in nose2unitth/core.py and 2 other locations - About 6 hrs to fix
    nose2unitth/core.py on lines 128..135
    nose2unitth/core.py on lines 137..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 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 3 locations. Consider refactoring.
    Open

                    if 'error' in case:
                        error_xml = doc_xml.createElement('error')
                        error_xml.setAttribute('type', case['error']['type'])
                        error_xml.setAttribute('message', case['error']['message'])
                        case_xml.appendChild(error_xml)
    Severity: Major
    Found in nose2unitth/core.py and 2 other locations - About 6 hrs to fix
    nose2unitth/core.py on lines 119..126
    nose2unitth/core.py on lines 128..135

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

                if error_xml:
                    if error_xml[0].hasAttribute('type'):
                        type = error_xml[0].getAttribute('type')
                    else:
                        type = ''
    Severity: Major
    Found in nose2unitth/core.py and 2 other locations - About 6 hrs to fix
    nose2unitth/core.py on lines 50..58
    nose2unitth/core.py on lines 62..70

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

    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

                if skipped_xml:
                    if skipped_xml[0].hasAttribute('type'):
                        type = skipped_xml[0].getAttribute('type')
                    else:
                        type = ''
    Severity: Major
    Found in nose2unitth/core.py and 2 other locations - About 6 hrs to fix
    nose2unitth/core.py on lines 62..70
    nose2unitth/core.py on lines 74..82

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

    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

                if failure_xml:
                    if failure_xml[0].hasAttribute('type'):
                        type = failure_xml[0].getAttribute('type')
                    else:
                        type = ''
    Severity: Major
    Found in nose2unitth/core.py and 2 other locations - About 6 hrs to fix
    nose2unitth/core.py on lines 50..58
    nose2unitth/core.py on lines 74..82

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

    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

    Function isort has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function isort(desc, start, step) {
            
            for(var j=start+step; j<N; j+=step) { 
                
                if (desc==true) {
    Severity: Major
    Found in examples/html/js/tablesort.js - About 3 hrs to fix

      Function read_nose has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def read_nose(in_file):
              """ Parse nose-style test reports into a `dict`
      
              Args:
                  in_file (:obj:`str`): path to nose-style test report
      Severity: Minor
      Found in nose2unitth/core.py - About 2 hrs 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 sortOnColumn has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function sortOnColumn(column) {
              
              columnIdx = column.cellIndex;
              columnTypeAbbr = column.abbr; // In case there is some special comparison needed.
              
      Severity: Minor
      Found in examples/html/js/tablesort.js - About 1 hr to fix

        Function write_unitth has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def write_unitth(suites, out_dir):
                """ Write UnitTH-style test reports 
        
                Args:
                    suites (:obj:`dict`): dictionary of test suites
        Severity: Minor
        Found in nose2unitth/core.py - 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

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

                                if (fIdx1<0) {
                                    fStripped = first;
                                } else {
                                    var fIdx2 = first.lastIndexOf('<');
                                    fStripped = first.substring((fIdx1+1),(fIdx2-1));
        Severity: Major
        Found in examples/html/js/tablesort.js and 1 other location - About 1 hr to fix
        examples/html/js/tablesort.js on lines 141..146

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

        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 (sIdx1<0) {
                                    sStripped = second;
                                } else {
                                    var sIdx2 = second.lastIndexOf('<');
                                    sStripped = second.substring((sIdx1+1),(sIdx2-1));
        Severity: Major
        Found in examples/html/js/tablesort.js and 1 other location - About 1 hr to fix
        examples/html/js/tablesort.js on lines 133..138

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

        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 ((k = Math.floor(N/7)) > 7) {
                        for (var m=0; m<k; m++) {
                            isort(true, m, k);
                        }
                    }
        Severity: Major
        Found in examples/html/js/tablesort.js and 1 other location - About 1 hr to fix
        examples/html/js/tablesort.js on lines 94..98

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

        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 ((k = Math.floor(N/5)) > 7) {
                        for (var m=0; m<k; m++) {
                            isort(true, m, k);
                        }
                    }
        Severity: Major
        Found in examples/html/js/tablesort.js and 1 other location - About 1 hr to fix
        examples/html/js/tablesort.js on lines 99..103

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

        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

        Avoid deeply nested control flow statements.
        Open

                                if (sIdx1<0) {
                                    sStripped = second;
                                } else {
                                    var sIdx2 = second.lastIndexOf('<');
                                    sStripped = second.substring((sIdx1+1),(sIdx2-1));
        Severity: Major
        Found in examples/html/js/tablesort.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (fIdx1<0) {
                                      fStripped = first;
                                  } else {
                                      var fIdx2 = first.lastIndexOf('<');
                                      fStripped = first.substring((fIdx1+1),(fIdx2-1));
          Severity: Major
          Found in examples/html/js/tablesort.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                } else if ('number'==columnTypeAbbr) {
                                    var fa = parseFloat(first);
                                    var sa = parseFloat(second);
                                    if (isNaN(fa) ) {
                                        fa = 0;
            Severity: Major
            Found in examples/html/js/tablesort.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (fStripped>sStripped) {
                                          exchange(i, (i-step));
                                      }
              Severity: Major
              Found in examples/html/js/tablesort.js - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language