Showing 316 of 340 total issues
Function SearchBar
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
var SearchBar = function ()
{
var input
var results_div
var current_query
Function Orbits
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Orbits = function ()
{
var nodes = null
var central_node = null
File cms.py
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import pickle
from contextlib import suppress
from datetime import datetime
from datetime import timedelta
Function AsyncFiltersHandler
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
var AsyncFiltersHandler = function()
{
var config;
var form;
var current_state_checksum;
- Read upRead up
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 initTable
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initTable($table, query, additional_columns)
{
var initial_query = query
function detailFormatter(index, row, $element)
Function MutationTable
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
var MutationTable = function ()
{
var element
var mutations
var impact_importances = {}
Function mutations
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def mutations(self):
"""Render search form and results (if any) for proteins or mutations"""
task_id = request.args.get('task_id', None)
use_celery = current_app.config.get('USE_CELERY', False)
filter_manager = SearchViewFilters()
- Read upRead up
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
File protein.py
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import List, TYPE_CHECKING
from sqlalchemy import select, case, exists, and_, func, distinct
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.hybrid import hybrid_property
Function extract_drugs
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def extract_drugs(path: str):
root = ElementTree.iterparse(path, events=['start', 'end'])
namespace = '{http://www.drugbank.ca}'
state = State(
- Read upRead up
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 from_query
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def from_query(
query, count_query=None,
results_mapper=json_results_mapper, filters_class=None,
search_filter=None, search_sort=None,
prepare_for_sorting=None, **kwargs
- Read upRead up
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 add_references_by_uniprot
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def add_references_by_uniprot(self, data):
full_uniprot, ref_type, value = data
if '-' in full_uniprot:
- Read upRead up
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
ContentManagementSystem
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class ContentManagementSystem(FlaskView):
route_base = '/'
@staticmethod
File network.py
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
from collections import namedtuple
from flask import jsonify
from flask import redirect
from flask import render_template as template
Function InlineEditManager
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
var InlineEditManager = function()
{
// values in the default config are dummy - just to illustrate the concept
var config = {
endpoint_save: '/save_message/',
File sites.py
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
import re
from functools import lru_cache
from pathlib import Path
from sys import float_info
File gene.py
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
import flask
from flask import render_template as template
from flask import jsonify
from flask import request
from flask_classful import FlaskView
File filters.py
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
from sqlalchemy import exists
from models import MC3Mutation, Disease, source_manager, SiteType, PCAWGMutation
from models.bio.drug import DrugGroup, Drug
from models import Cancer
File table.py
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
from collections import defaultdict
from typing import Iterable, Dict, Callable
from sqlalchemy import distinct, and_
from tqdm import tqdm
Protein
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Protein(BioModel):
"""Protein represents a single isoform of a product of given gene."""
gene_id = db.Column(db.Integer, db.ForeignKey('gene.id', use_alter=True))
gene_name = association_proxy('gene', 'name')
Function Export
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Export = function ()
{
var svg_element
var file_name
var style_url