justaddcoffee/kg-emerging-viruses

View on GitHub

Showing 217 of 237 total issues

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

    def parse_ttd_file(self, file: str) -> dict:
        """Parse entire TTD download file.

        (a few megs, not very mem efficient, but
        should be okay), and return a dict of dicts of lists
Severity: Minor
Found in kg_covid_19/transform_utils/ttd/ttd.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

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

    def interactor_to_node(self, interactor: minidom.Element) -> List[Union[int, list]]:
        """Parse an interactor as a list of nodes."""
        interactor_id = interactor.attributes["id"].value

        this_id = ""
Severity: Minor
Found in kg_covid_19/transform_utils/intact/intact.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

Function when has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    when: function( singleValue ) {
        var

            // count of uncompleted subordinates
            remaining = arguments.length,
Severity: Minor
Found in docs/_static/jquery-3.5.1.js - About 1 hr to fix

    Function addClass has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        addClass: function( value ) {
            var classes, elem, cur, curValue, clazz, j, finalValue,
                i = 0;
    
            if ( isFunction( value ) ) {
    Severity: Minor
    Found in docs/_static/jquery-3.5.1.js - About 1 hr to fix

      Function position has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          position: function() {
              if ( !this[ 0 ] ) {
                  return;
              }
      
      
      Severity: Minor
      Found in docs/_static/jquery-3.5.1.js - About 1 hr to fix

        Function clone has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            clone: function( elem, dataAndEvents, deepDataAndEvents ) {
                var i, l, srcElements, destElements,
                    clone = elem.cloneNode( true ),
                    inPage = isAttached( elem );
        
        
        Severity: Minor
        Found in docs/_static/jquery-3.5.1.js - About 1 hr to fix

          Function propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function propFilter( props, specialEasing ) {
              var index, name, easing, value, hooks;
          
              // camelCase, specialEasing and expand cssHook pass
              for ( index in props ) {
          Severity: Minor
          Found in docs/_static/jquery-3.5.1.js - About 1 hr to fix

            Function make_holdouts has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def make_holdouts(
                nodes: str,
                edges: str,
                output_dir: str,
                train_fraction: float,
            Severity: Minor
            Found in kg_covid_19/make_holdouts.py - About 1 hr to fix

              Function remove has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  remove: function( owner, key ) {
                      var i,
                          cache = owner[ this.expando ];
              
                      if ( cache === undefined ) {
              Severity: Minor
              Found in docs/_static/jquery-3.5.1.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                    if ( support.matchesSelector && documentIsHTML &&
                        !nonnativeSelectorCache[ expr + " " ] &&
                        ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
                        ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
                
                
                Severity: Major
                Found in docs/_static/jquery-3.5.1.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                        if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
                            && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {
                          switch (event.keyCode) {
                            case 37: // left
                              var prevHref = $('link[rel="prev"]').prop('href');
                  Severity: Major
                  Found in docs/_static/doctools.js - About 1 hr to fix

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

                    def _gpi12iterator(handle: TextIO) -> Generator:
                        # Partly cribbed from Biopython GPI 1.1 parser
                        # There is no GPI 1.2 parser yet, so I made this
                        """Read GPI 1.2 format files (PRIVATE).
                    
                    

                    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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def run(self, data_file: Optional[str] = None):
                            """Run transform to ingest data from IntAct for viral/human PPIs."""
                            data_files = list()
                            if not data_file:
                                data_files.append(
                    Severity: Minor
                    Found in kg_covid_19/transform_utils/intact/intact.py - 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 parse_chembl_activity has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def parse_chembl_activity(self, data: List):
                            """Parse ChEMBL Activity records.
                    
                            An activity document links 4 entities,
                                - assay
                    Severity: Minor
                    Found in kg_covid_19/transform_utils/chembl/chembl_transform.py - 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 access has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
                    Severity: Major
                    Found in docs/_static/jquery-3.5.1.js - About 50 mins to fix

                      Function boxModelAdjustment has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
                      Severity: Minor
                      Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        } else if ( match[ 2 ] ) {
                                            push.apply( results, context.getElementsByTagName( selector ) );
                                            return results;
                        
                                        // Class selector
                        Severity: Major
                        Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                              if ( ( ofType ?
                                                                  node.nodeName.toLowerCase() === name :
                                                                  node.nodeType === 1 ) &&
                                                                  ++diff ) {
                          
                          
                          Severity: Major
                          Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        for (i = 0; i < otherterms.length; i++) {
                                          if (haystack.indexOf(otherterms[i]) == -1) {
                                            allfound = false;
                                            break;
                                          }
                            Severity: Major
                            Found in docs/_static/searchtools.js - About 45 mins to fix

                              Function init has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  init: function( elem, options, prop, end, easing, unit ) {
                              Severity: Minor
                              Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language