alliance-genome/agr

View on GitHub

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
Severity: Minor
Found in webapp/src/components/disease/genePageDiseaseTable.js - About 1 hr to fix

    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';
    Severity: Minor
    Found in webapp/src/containers/genePage/transcriptInlineViewer.js - About 1 hr to fix

      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) => {
      Severity: Minor
      Found in webapp/src/containers/search/resultsTable.js - About 1 hr to fix

        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',
        Severity: Minor
        Found in webapp/src/components/dataTable/localDataTable.js - About 1 hr to fix

          Function makeFieldDisplayName has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function makeFieldDisplayName(unformattedName) {
            unformattedName = unformattedName || '';
          
            switch(unformattedName) {
            case 'go':
          Severity: Minor
          Found in webapp/src/lib/searchHelpers.js - About 1 hr to fix

            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,
            Severity: Minor
            Found in webapp/src/components/dataTable/remoteDataTable.js - About 1 hr to fix

              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,
              Severity: Minor
              Found in webapp/src/containers/layout/searchBar/index.js - About 1 hr to fix

                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']
                Severity: Minor
                Found in indexer/src/annotators/go_annotator.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 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') {
                Severity: Minor
                Found in webapp/src/lib/searchHelpers.js - 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 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') {
                Severity: Minor
                Found in webapp/src/lib/searchHelpers.js - About 1 hr to fix

                  Function render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      const columns = [
                        {
                          field: 'do_name',
                          label: 'Disease Name',
                  Severity: Minor
                  Found in webapp/src/components/disease/diseasePageAssociationsTable.js - About 1 hr to fix

                    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 => {
                    Severity: Minor
                    Found in webapp/src/containers/search/filterSelector/singleFilterSelector.js - About 1 hr to fix

                      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;
                      Severity: Minor
                      Found in webapp/src/containers/wordpress/wordpressFeeds/wordpressNews.js - About 1 hr to fix

                        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;
                        Severity: Minor
                        Found in webapp/src/containers/search/logList.js - About 1 hr to fix

                          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) => {
                          Severity: Minor
                          Found in webapp/src/containers/search/resultsTable.js - 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 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:
                          Severity: Minor
                          Found in api/src/services/helpers/search_helper.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 renderBottomPanel has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            renderBottomPanel(props) {
                              return (
                                <div>
                                  {
                                    this.props.paginated &&
                          Severity: Minor
                          Found in webapp/src/components/dataTable/localDataTable.js - About 1 hr to fix

                            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} />
                            Severity: Minor
                            Found in webapp/src/containers/genePage/basicGeneInfo.js - About 1 hr to fix

                              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}`;
                              Severity: Minor
                              Found in webapp/src/containers/search/resultsTable.js - About 1 hr to fix

                                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']
                                Severity: Minor
                                Found in api/src/services/helpers/search_helper.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

                                Severity
                                Category
                                Status
                                Source
                                Language