Showing 75 of 182 total issues
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const diseases = this.props.data;
const filename = this.props.filename;
// the way the incoming data is grouped doesn't exactly align with the way
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
// let externalPrefix = 'http://bw.scottcain.net/jbrowse/?data=data%2F';
// let externalPrefix = 'http://ec2-34-208-22-23.us-west-2.compute.amazonaws.com/jbrowse/overview.html?data=data%2F';
// let externalPrefix = 'http://localhost/jbrowse/overview.html?data=data%2F';
let externalPrefix = 'http://jbrowse.alliancegenome.org/jbrowse/overview.html?data=data%2F';
Function renderRows
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderRows() {
let entries = this.props.entries;
let fields = this.getFields();
let rowNodes = entries.map( (d, i) => {
let nodes = fields.map( (field) => {
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { columns, data, filename } = this.props;
const options = {
exportCSVSeparator: '\t',
exportCSVText: 'Download',
Function makeFieldDisplayName
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function makeFieldDisplayName(unformattedName) {
unformattedName = unformattedName || '';
switch(unformattedName) {
case 'go':
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const options = {
onPageChange: this.handlePageChange,
onSortChange: this.handleSortChange,
onSizePerPageList: this.handleCountChange,
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let _getSuggestionValue = ( d => d.name );
let _inputProps = {
placeholder: 'search a gene or GO term',
value: this.state.value,
Function attach_annotations
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def attach_annotations(gene, annots, go_data):
go_blacklist = ("GO:0008150", "GO:0003674", "GO:0005575")
gene_id = gene['primaryId']
gene_symbol = gene['symbol']
species = gene['species']
- 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 getQueryParamWithValueChanged
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function getQueryParamWithValueChanged(key, val, queryParams, isClear=false) {
let qp = _.clone(queryParams || {});
let oldVal = _.clone(qp[key]);
let isSingleValField = (SINGLE_VAL_FIELDS.indexOf(key) > -1);
if (isSingleValField || oldVal === null || typeof oldVal === 'undefined') {
- 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 getQueryParamWithValueChanged
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getQueryParamWithValueChanged(key, val, queryParams, isClear=false) {
let qp = _.clone(queryParams || {});
let oldVal = _.clone(qp[key]);
let isSingleValField = (SINGLE_VAL_FIELDS.indexOf(key) > -1);
if (isSingleValField || oldVal === null || typeof oldVal === 'undefined') {
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const columns = [
{
field: 'do_name',
label: 'Disease Name',
Function renderFilterValues
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderFilterValues() {
let values = this.props.values.slice(0, this.state.numVisible);
let mode = this.props.queryParams.mode;
let isGraphMode = (this.props.name === 'species' && (mode === 'graph' || mode === 'chord'));
return values.map( d => {
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let container=[];
let post_title='News And Events';
/* keep trck of the number of published posts */
let posts_count=1;
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let logs = this.props.logs;
let label = this.props.label;
if (!logs) return null;
label = label || DEFAULT_LABEL;
Function renderRows
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
renderRows() {
let entries = this.props.entries;
let fields = this.getFields();
let rowNodes = entries.map( (d, i) => {
let nodes = fields.map( (field) => {
- 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 graph_visualization
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def graph_visualization(formatted_search_results):
nodes = {}
edges = []
for result in formatted_search_results:
- 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 renderBottomPanel
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderBottomPanel(props) {
return (
<div>
{
this.props.paginated &&
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className='row'>
<div className='col-sm-4 push-sm-8'>
<DataSourceCard reference={this.state.geneData.modCrossReference} species={this.state.geneData.species} />
Function rowNodes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
let rowNodes = entries.map( (d, i) => {
let nodes = fields.map( (field) => {
let isMakeLowercase = d.category === 'disease';
let _className = isMakeLowercase ? style.lowercase : null;
let _key = `srtc.${i}.${field}`;
Function format_autocomplete_results
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def format_autocomplete_results(es_response, field='name_key'):
formatted_results = []
if field != 'name_key':
results = es_response['aggregations'][field]['buckets']
- 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"