wurmlab/sequenceserver

View on GitHub

Showing 16,957 of 16,957 total issues

Function drawLegend has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    drawLegend(svg, options, width, height, hits) {
        var svg_legend = svg.append('g')
            .attr('transform',
                'translate(0,' + (height - 1.75 * options.margin) + ')');

Severity: Minor
Found in public/js/hits_overview.js - About 1 hr to fix

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

            for (l = 0, len = ref2.length; l < len; l++) {
                d = ref2[l];
                layoutSummary[d.id] = d.len;
            }
    Severity: Major
    Found in public/js/circosjs.js and 1 other location - About 1 hr to fix
    public/js/circosjs.js on lines 546..549

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

    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

            for (l = 0, len = ref.length; l < len; l++) {
                d = ref[l];
                layoutSummary[d.id] = d.len;
            }
    Severity: Major
    Found in public/js/circosjs.js and 1 other location - About 1 hr to fix
    public/js/circosjs.js on lines 391..394

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

    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

    Function hitLinks has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        hitLinks() {
            var btns = [];
            if (!(this.props.imported_xml || this.props.non_parse_seqids)) {
                btns = btns.concat([
                    this.viewSequenceButton(),
    Severity: Minor
    Found in public/js/hit.js - About 1 hr to fix

      Function selectHit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          selectHit(id) {
              var checkbox = $('#' + id);
              var num_checked = $('.hit-links :checkbox:checked').length;
      
              if (!checkbox || !checkbox.val()) return;
      Severity: Minor
      Found in public/js/hits.js - About 1 hr to fix

        Function renderContent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            const renderContent = () => {
                return (
                    <div className="overview mr-0 mb-0">
                        <p className="m-0 text-sm">
                            <strong>SequenceServer {props.seqserv_version}</strong> using{' '}
        Severity: Minor
        Found in public/js/report/run_summary.js - About 1 hr to fix

          Function smartBorders has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          circosJS.Core.prototype.smartBorders = function() {
              var border, borders, currentBorder, l, layout, len, ref, store, track, trackId, trackType, width;
              width = this.conf.defaultTrackWidth;
              layout = {
                  'in': this._layout.conf.innerRadius,
          Severity: Minor
          Found in public/js/circosjs.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

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

                      <LengthDistribution key={'LD_' + this.props.query.id} query={this.props.query} algorithm={this.props.program} />
          Severity: Major
          Found in public/js/query.js and 1 other location - About 1 hr to fix
          public/js/query.js on lines 66..66

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

          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

          Function parsedOptions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              parsedOptions(textValue) {
                  const words = textValue.split(" ");
                  let parsedOptions = this.defaultObjectValue();
                  // Iterate through the words in steps of 2, treating each pair as an option and its potential value
                  for (let i = 0; i < words.length; i += 2) {
          Severity: Minor
          Found in public/js/options.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

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

                          if (type == 'Hit') {
                              if (obj[3] == id) {
                                  this.chordsHide.push(index);
                                  this.layoutHide.push(obj[0]);
                              }
          Severity: Major
          Found in public/js/circos.js and 1 other location - About 1 hr to fix
          public/js/circos.js on lines 433..438

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

          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

                          if (type == 'Que') {
                              if (obj[0] == id) {
                                  this.chordsHide.push(index);
                                  this.layoutHide.push(obj[3]);
                              }
          Severity: Major
          Found in public/js/circos.js and 1 other location - About 1 hr to fix
          public/js/circos.js on lines 439..444

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

          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

                      <HitsTable key={'HT_' + this.props.query.number} query={this.props.query} imported_xml={this.props.imported_xml} />
          Severity: Major
          Found in public/js/query.js and 1 other location - About 1 hr to fix
          public/js/query.js on lines 65..65

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

          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

          Method tree has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

                def tree
                  all.each_with_object({}) do |db, data|
                    data[db.type] ||= []
                    use_parent = '#'
                    db.categories.each_with_index do |entry, index|
          Severity: Minor
          Found in lib/sequenceserver/database.rb - 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 render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render() {
                  return (
                      <div className="relative">
                          <div
                              className="sequence">
          Severity: Minor
          Found in public/js/query.js - About 1 hr to fix

            Function renderBlock has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                this.renderBlock = function(parentElement, data, layout, conf) {
                    var block, scope;
                    scope = conf.outerRadius - conf.innerRadius;
                    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 - About 1 hr to fix

              Function applyRules has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  this.applyRules = function(rules, data) {
                      var datum, i, k, results, rule, v;
                      rules = rules || [];
                      results = [];
                      for (k in data) {
              Severity: Minor
              Found in public/js/circosjs.js - About 1 hr to fix

                Function warningJSX has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    warningJSX() {
                        return(
                            <div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
                                <div className="grid grid-cols-6 gap-4">
                                    <div className="col-start-1 col-end-7 text-center">
                Severity: Minor
                Found in public/js/report.js - About 1 hr to fix

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

                      render() {
                          var methods = this.state.methods;
                          var method = methods[0];
                          var multi = methods.length > 1;
                  
                  
                  Severity: Minor
                  Found in public/js/search_button.js - About 1 hr to fix

                    Function determineBlastMethods has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        determineBlastMethods() {
                            var database_type = this.databaseType;
                            var sequence_type = this.sequenceType;
                    
                            if (this.query.current.isEmpty()) {
                    Severity: Minor
                    Found in public/js/form.js - About 1 hr to fix

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

                            line.push(
                              `Positives: ${Utils.inFraction(
                                hsp.positives,
                                hsp.length
                              )} (${Utils.inPercentage(hsp.positives, hsp.length)}), `
                      Severity: Major
                      Found in public/js/hsp.js and 1 other location - About 1 hr to fix
                      public/js/hsp.js on lines 94..99

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

                      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