wurmlab/sequenceserver

View on GitHub

Showing 119 of 7,605 total issues

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

    initTooltip() {
        this.inputGroup().tooltip({
            trigger: 'manual',
            title: _.bind(function () {
                if (!this.state.hasQuery && !this.state.hasDatabases) {
Severity: Minor
Found in public/js/search_button.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

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 hspStats has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  hspStats() {
    // An array to hold text or span elements that make up the line.
    let line = [];

    // Bit score and total score.
Severity: Minor
Found in public/js/hsp.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

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 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 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

Avoid too many return statements within this function.
Open

            return v / conf.ticks.labelDenominator + conf.ticks.labelSuffix;
Severity: Major
Found in public/packages/circosJS@1.7.0.js - About 30 mins to fix

    Function renderDatabases has a Cognitive Complexity of 6 (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-md-12' :
    Severity: Minor
    Found in public/js/databases_tree.js - About 25 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 determineBlastMethods has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        determineBlastMethods() {
            var database_type = this.databaseType;
            var sequence_type = this.sequenceType;
    
            if (this.refs.query.isEmpty()) {
    Severity: Minor
    Found in public/js/form.js - About 25 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 validate_options has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def validate_options(options)
            return true if !options || (options.is_a?(String) &&
                                        options.strip.empty?)
    
            fail InputError, 'Invalid characters detected in options.' unless allowed_chars.match(options)
    Severity: Minor
    Found in lib/sequenceserver/blast/job.rb - About 25 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 check_num_threads has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_num_threads
          num_threads = Integer(config[:num_threads])
          fail NUM_THREADS_INCORRECT unless num_threads.positive?
          logger.debug "Will use #{num_threads} threads to run BLAST."
          if num_threads > 256
    Severity: Minor
    Found in lib/sequenceserver.rb - About 25 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 write_entries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def write_entries(entries, path, zipfile)
        entries.each do |e|
          zipfile_path = path == '' ? e : File.join(path, e)
          disk_file_path = File.join(@input_dir, zipfile_path)
    
    
    Severity: Minor
    Found in lib/sequenceserver/zip_file_generator.rb - About 25 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 update_searchdata_from_job has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def update_searchdata_from_job(searchdata)
          job = fetch_job(params[:job_id])
          return { error: 'Job not found' }.to_json if job.nil?
          return if job.imported_xml_file
    
    
    Severity: Minor
    Found in lib/sequenceserver/routes.rb - About 25 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 initiate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        initiate() {
        // this.width = 700;
            this.width = this.svgContainer.width();
            this.height = 600;
            this.innerRadius = 200;
    Severity: Minor
    Found in public/js/circos.js - About 25 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 selectHit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        selectHit(id) {
            var checkbox = $('#' + id);
            var num_checked = $('.hit-links :checkbox:checked').length;
    
            if (!checkbox || !checkbox.val()) {
    Severity: Minor
    Found in public/js/report.js - About 25 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 init_binaries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def init_binaries
          if config[:bin]
            config[:bin] = File.expand_path config[:bin]
            unless File.exist?(config[:bin]) && File.directory?(config[:bin])
              fail ENOENT.new('bin dir', config[:bin])
    Severity: Minor
    Found in lib/sequenceserver.rb - About 25 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 probably_fastas has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def probably_fastas
          return @probably_fastas if defined?(@probably_fastas)
    
          @probably_fastas = []
    
    
    Severity: Minor
    Found in lib/sequenceserver/makeblastdb.rb - About 25 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