justaddcoffee/kg-emerging-viruses

View on GitHub

Showing 217 of 237 total issues

Avoid deeply nested control flow statements.
Open

                        if ( attrs[ i ] ) {
                            name = attrs[ i ].name;
                            if ( name.indexOf( "data-" ) === 0 ) {
                                name = camelCase( name.slice( 5 ) );
                                dataAttr( elem, name, data[ name ] );
Severity: Major
Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if ( conv && s.throws ) {
                            response = conv( response );
                        } else {
                            try {
                                response = conv( response );
    Severity: Major
    Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

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

      function on( elem, types, selector, data, fn, one ) {
      Severity: Minor
      Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if ( copyIsArray && !Array.isArray( src ) ) {
                                clone = [];
                            } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
                                clone = {};
                            } else {
        Severity: Major
        Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for ( type in data.events ) {
                                      if ( special[ type ] ) {
                                          jQuery.event.remove( elem, type );
          
                                      // This is a shortcut to avoid jQuery.event.remove's overhead
          Severity: Major
          Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if ( hasScripts ) {
            
                                    // Support: Android <=4.0 only, PhantomJS 1 only
                                    // push.apply(_, arraylike) throws on ancient WebKit
                                    jQuery.merge( scripts, getAll( node, "script" ) );
            Severity: Major
            Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if ( newContext !== context || !support.scope ) {
              
                                      // Capture the context ID, setting it first if necessary
                                      if ( ( nid = context.getAttribute( "id" ) ) ) {
                                          nid = nid.replace( rcssescape, fcssescape );
              Severity: Major
              Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if ( !selector ) {
                                        push.apply( results, seed );
                                        return results;
                                    }
                Severity: Major
                Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if ( restoreDisplay == null ) {
                                          display = style.display;
                                          restoreDisplay = display === "none" ? "" : display;
                                      }
                  Severity: Major
                  Found in docs/_static/jquery-3.5.1.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if entity_type == "Gene":
                                                self.make_pharmgkb_gene_node(
                                                    fh=node,
                                                    this_id=entity_id,
                                                    name=entity_name,
                    Severity: Major
                    Found in kg_covid_19/transform_utils/pharmgkb/pharmgkb.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if protein in string_to_uniprot_id_map:
                                                  uniprot_curie = (
                                                      f"UniProtKB:{string_to_uniprot_id_map[protein]}"
                                                  )
                                                  uniprot_curie = collapse_uniprot_curie(uniprot_curie)
                      Severity: Major
                      Found in kg_covid_19/transform_utils/string_ppi/string_ppi.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        if cur_gene_name in linec_split:
                                            #print("found")
                                            found = 1
                                            countORFs = countORFs + 1
                        
                        
                        Severity: Major
                        Found in curated/ORFs/merge_KGCOVID_COVIDscholar_syns.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if not item:
                                                      continue  # not xrefs, skip
                                                  item = item.strip('"')  # remove quotes around each item
                          Severity: Major
                          Found in kg_covid_19/transform_utils/pharmgkb/pharmgkb.py - About 45 mins to fix

                            Function result_dict_to_tsv has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def result_dict_to_tsv(result_dict: dict, outfile: str) -> None:
                                """Convert a result_dict to a TSV for output."""
                                with open(outfile, "wt") as f:
                                    # header
                                    f.write("\t".join(result_dict["head"]["vars"]) + "\n")
                            Severity: Minor
                            Found in kg_covid_19/query.py - About 45 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 transform has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def transform(
                                input_dir: str, output_dir: str, sources: Optional[List[str]] = None
                            ) -> None:
                                """Call scripts in kg_covid_19/transform/[source name]/ to transform data.
                            
                            
                            Severity: Minor
                            Found in kg_covid_19/transform.py - About 45 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

                            Avoid deeply nested control flow statements.
                            Open

                                                    if self.key_parsed_ids not in dat:
                                                        dat[self.key_parsed_ids] = dict()
                                                    dat[self.key_parsed_ids][key] = value
                            Severity: Major
                            Found in kg_covid_19/transform_utils/pharmgkb/pharmgkb.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      for x in v:
                                                          r = self.parse_doc_fields(x, allowed_properties, remap)
                                                          for k2, v2 in r.items():
                                                              update_properties(k2, v2)
                                          else:
                              Severity: Major
                              Found in kg_covid_19/transform_utils/chembl/chembl_transform.py - About 45 mins to fix

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

                                    def make_id_mapping_file(
                                Severity: Minor
                                Found in kg_covid_19/transform_utils/pharmgkb/pharmgkb.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if gene not in seen_genes:
                                                              seen_genes.add(gene)
                                                              ensemble_gene = f"ENSEMBL:{gene}"
                                                              gene_informations = self.gene_info_map[
                                                                  self.ensembl2ncbi_map[gene]
                                  Severity: Major
                                  Found in kg_covid_19/transform_utils/string_ppi/string_ppi.py - About 45 mins to fix

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

                                    def elastic_search_query(
                                    Severity: Minor
                                    Found in kg_covid_19/utils/download_utils.py - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language