KarrLab/bpforms

View on GitHub

Showing 397 of 397 total issues

Avoid deeply nested control flow statements.
Open

                    for i_monomer in range(monomer2.start_position, monomer2.end_position + 1):
                        if form.seq[i_monomer - 1] == monomers[seq[i_monomer - 1]]:
                            monomer2.base_monomers = [bpforms.protein_alphabet.monomers.get(seq[i_monomer - 1])]
                            form.seq[i_monomer - 1] = monomer2
                            set_monomer = True
Severity: Major
Found in examples/pro.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    if can_code not in can_monomer_freq:
                        can_monomer_freq[can_code] = 0
                    can_monomer_freq[can_code] += copies
    Severity: Major
    Found in examples/modomics_analysis.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if record_type == 'HET   ':
                              het = line[7:10].strip()
                              if het in pdb_monomers:
                                  het_set.add(het)
      
      
      Severity: Major
      Found in examples/pdb_analysis.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if len(entry.exp_org_taxid) == 1:
                                taxid = list(entry.exp_org_taxid)[0]
                                if taxid in query_ids:
                                    entries_engineered_in_query.append(entry)
                                    engineered_in_query_i += 1
        Severity: Major
        Found in examples/pdb_analysis.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if monomer['mod']:
                                  codes.add(monomer['mod'].get_canonical_code(monomer_codes))
                              msg = 'Modified monomeric form {} potentially inconsistent with residue {} != {}'.format(
          Severity: Major
          Found in examples/pro.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for p in protein['processing']:
                                    seq_features[0]['positions'].append([last + 1, p['start'] - 1])
                                    last = p['end']
                                seq_features[0]['positions'].append([
            Severity: Major
            Found in examples/pro.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if key not in protein:
                                      protein[key] = []
                                  protein[key].append(value)
              Severity: Major
              Found in examples/pro.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                if monomer not in monomer_freq:
                                    monomer_freq[monomer] = 0
                                monomer_freq[monomer] += copies
                Severity: Major
                Found in examples/modomics_analysis.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if record_type == 'HEADER':
                                          entry.id = line[62:66]
                  
                                      # get only non-engineered protein
                                      elif record_type == 'COMPND' and line[11:26] == 'ENGINEERED: YES':
                  Severity: Major
                  Found in examples/pdb_analysis.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if not set_monomer:
                                            protein['modified_errors'].append('Unable to set monomeric form')
                    
                        # crosslinks
                        if protein['processing']:
                    Severity: Major
                    Found in examples/pro.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              for domain, cell in zip(domains, row.find_all('td')):
                                                  if cell.text:
                                                      domain_dist.append(domain + ' ' + rna_type)
                      
                      
                      Severity: Major
                      Found in bpforms/alphabet/rna.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if taxid in query_ids:
                                                entries_engineered_in_query.append(entry)
                                                engineered_in_query_i += 1
                        
                        
                        Severity: Major
                        Found in examples/pdb_analysis.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              while line != '':
                                                  record_type = line[:6]
                          
                                                  # get id
                                                  if record_type == 'HEADER':
                          Severity: Major
                          Found in examples/pdb_analysis.py - About 45 mins to fix

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

                            def gen_bpform(protein, pro_ids_to_bpform_monomers, monomer_codes,
                            Severity: Minor
                            Found in examples/pro.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if protein['processing'][0]['start'] == 1:
                                                      seq_features[0]['positions'].pop(0)
                                                  if protein['processing'][-1]['end'] == len(form.seq):
                              Severity: Major
                              Found in examples/pro.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if form.seq[i_monomer - 1] == monomers[seq[i_monomer - 1]]:
                                                        set_monomer = True
                                                        form.seq[i_monomer - 1] = monomer2
                                                        break
                                                if not set_monomer:
                                Severity: Major
                                Found in examples/pro.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      while line != '':
                                                          record_type = line[:6]
                                  
                                                          if record_type == 'HET   ':
                                                              het = line[7:10].strip()
                                  Severity: Major
                                  Found in examples/pdb_analysis.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if taxid != 32630 and taxid != 32644:
                                    
                                                            entries_native.append(entry)
                                                            # print(entry.id, entry.org_taxid, entry.het)
                                                            non_engineered_i += 1
                                    Severity: Major
                                    Found in examples/pdb_analysis.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if line.startswith('[Term]'):
                                                              if max_num_proteins is not None and len(proteins) >= max_num_proteins:
                                                                  break
                                                              protein = {}
                                                          else:
                                      Severity: Major
                                      Found in examples/pro.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if form.seq[position - 1] == monomers[seq[position - 1]]:
                                                                if monomer not in bpforms.protein_alphabet.monomers.values():
                                                                    monomer.base_monomers = [form.seq[position - 1]]
                                                                form.seq[position - 1] = monomer
                                                            else:
                                        Severity: Major
                                        Found in examples/pro.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language