wurmlab/sequenceserver

View on GitHub

Showing 16,957 of 16,957 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            var item1 = {
                len: len,
                color: '#8dd3c7',
                label: label,
                id: 'Query_' + this.clean_id(query.id),
Severity: Minor
Found in public/js/circos.js and 1 other location - About 40 mins to fix
public/js/circos.js on lines 132..138

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                var item2 = {
                    len: len,
                    color: '#80b1d3',
                    label: label,
                    id: 'Hit_' + this.clean_id(hit.id),
Severity: Minor
Found in public/js/circos.js and 1 other location - About 40 mins to fix
public/js/circos.js on lines 112..118

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Consider simplifying this complex logical expression.
Open

    if ('source_id' in sample && 'source_start' in sample && 'source_end' && 'target_id' in sample && 'target_start' in sample && 'target_end' in sample) {
        data = data.map(function(datum) {
            var elts;
            elts = [datum.source_id, datum.source_start, datum.source_end, datum.target_id, datum.target_start, datum.target_end];
            if (datum.value != null) {
Severity: Major
Found in public/js/circosjs.js - About 40 mins to fix

    Function asMailtoHref has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export default function asMailtoHref(querydb, program, numQueries, url, isOpenAccess) {
    Severity: Minor
    Found in public/js/mailto.js - About 35 mins to fix

      Function composeEmail has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function composeEmail(dbsArr, program, numQueries, url, isOpenAccess) {
      Severity: Minor
      Found in public/js/mailto.js - About 35 mins to fix

        Method make_blast_database has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def make_blast_database(action, file, title, type, non_parse_seqids = false)
        Severity: Minor
        Found in lib/sequenceserver/makeblastdb.rb - About 35 mins to fix

          Function processConf has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              this.processConf = function(conf, defaultConf, meta, instance, utils) {
          Severity: Minor
          Found in public/js/circosjs.js - About 35 mins to fix

            Function graphIt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                graphIt($queryDiv, $graphDiv, index, howMany, opts, inhits) {
                /* barHeight: Height of each hit track.
                 * legend: Height reserved for the overview legend.
                 * margin: Margin around the svg element.
                 */
            Severity: Minor
            Found in public/js/hits_overview.js - About 35 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 graphControls has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                graphControls($queryDiv, $graphDiv, isInit, opts, hits) {
                    var MIN_HITS_TO_SHOW = 20;
            
                    var totalHits, shownHits, lessButton, moreButton;
            
            
            Severity: Minor
            Found in public/js/hits_overview.js - About 35 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 draw_axes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                draw_axes() {
                    var space, len;
                    len = this._scale_y.ticks().length;
                    if (len >= 5) {
                        space = 5;
            Severity: Minor
            Found in public/js/length_distribution.js - About 35 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

            Method raise! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def raise!
                    return true if exitstatus.zero? && !File.zero?(stdout)
            
                    case exitstatus
                    when 1..2
            Severity: Minor
            Found in lib/sequenceserver/blast/error.rb - About 35 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 renderDatabases has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                renderDatabases(category) {
                    // Panel name and column width.
                    var panelTitle = category[0].toUpperCase() +
                        category.substring(1).toLowerCase() + ' databases';
                    var columnClass = this.categories().length === 1 ? 'col-span-2' : '';
            Severity: Minor
            Found in public/js/databases_tree.js - About 35 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 type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                type() {
                    let sequence = this.value().trim();
                    // FASTQ detected, but we don't know if conversion has succeeded yet
                    // will notify separately if it does
                    if (sequence.startsWith('@') ) { return undefined; }
            Severity: Minor
            Found in public/js/query.js - About 35 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 componentDidUpdate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                componentDidUpdate(_prevProps, prevState) {
                    // If there's only one database, select it.
                    if (this.databases() && this.databases().length === 1 && this.state.currentlySelectedDatabases.length === 0) {
                        this.setState({currentlySelectedDatabases: this.databases()});
                    }
            Severity: Minor
            Found in public/js/databases.js - About 35 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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    block = parentElement.selectAll('.block').data(data).enter().append('g').attr('class', 'block').attr('transform', function(d) {
                        return 'rotate(' + layout.blocks[d.key].start * 360 / (2 * Math.PI) + ')';
                    });
            Severity: Minor
            Found in public/js/circosjs.js and 1 other location - About 35 mins to fix
            public/js/circosjs.js on lines 477..490

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 46.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    this.blocks[v.id].end = (v.offset + v.len) / size * (2 * Math.PI - block_nb * gap) + k * gap;
            Severity: Minor
            Found in public/js/circosjs.js and 1 other location - About 35 mins to fix
            public/js/circosjs.js on lines 374..374

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 46.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    link = track
                        .selectAll('.chord')
                        .data(data)
                        .enter()
                        .append('path')
            Severity: Minor
            Found in public/js/circosjs.js and 1 other location - About 35 mins to fix
            public/js/circosjs.js on lines 641..643

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 46.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    v.end = (v.offset + v.len) / size * (2 * Math.PI - block_nb * gap) + k * gap;
            Severity: Minor
            Found in public/js/circosjs.js and 1 other location - About 35 mins to fix
            public/js/circosjs.js on lines 372..372

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 46.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                def uniprot
                  return nil unless id.match(UNIPROT_ID_PATTERN) or title.match(UNIPROT_ID_PATTERN)
                  uniprot_id = Regexp.last_match[1]
                  uniprot_id = encode uniprot_id
                  url = "https://www.uniprot.org/uniprot/#{uniprot_id}"
            Severity: Minor
            Found in lib/sequenceserver/links.rb and 2 other locations - About 30 mins to fix
            lib/sequenceserver/links.rb on lines 94..104
            lib/sequenceserver/links.rb on lines 107..117

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                def pfam
                  return nil unless id.match(PFAM_ID_PATTERN) or title.match(PFAM_ID_PATTERN)
                  pfam_id = Regexp.last_match[1]
                  pfam_id = encode pfam_id
                  url = "https://pfam.xfam.org/family/#{pfam_id}"
            Severity: Minor
            Found in lib/sequenceserver/links.rb and 2 other locations - About 30 mins to fix
            lib/sequenceserver/links.rb on lines 81..91
            lib/sequenceserver/links.rb on lines 107..117

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language