wurmlab/sequenceserver

View on GitHub

Showing 16,957 of 16,957 total issues

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

    render() {
        return (
            <div
                className="dnd-overlay absolute left-0 top-0 w-full h-full bg-gray-200 bg-opacity-75 z-40"
                style={{ display: 'none' }}>
Severity: Minor
Found in public/js/dnd.js - About 1 hr to fix

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

        render() {
            return (
                <div>
                    <div id="overlay" style={{ position: 'absolute', top: 0, left: 0, width: '100vw', height: '100vw', background: 'rgba(0, 0, 0, 0.2)', display: 'none', zIndex: 99 }} />
    
    
    Severity: Minor
    Found in public/js/form.js - About 1 hr to fix

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

                              <button
                                  type="button"
                                  className={toggleClass}
                                  disabled={toggleDisabled}
                                  onClick={function () {
      Severity: Major
      Found in public/js/databases_tree.js and 1 other location - About 1 hr to fix
      public/js/databases.js on lines 100..109

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

      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

                  target: {
                      id: datum[3],
                      start: Math.max(0, parseFloat(datum[4])),
                      end: Math.min(layoutSummary[datum[3]], parseFloat(datum[5]))
                  },
      Severity: Major
      Found in public/js/circosjs.js and 1 other location - About 1 hr to fix
      public/js/circosjs.js on lines 315..319

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

      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

                  source: {
                      id: datum[0],
                      start: Math.max(0, parseFloat(datum[1])),
                      end: Math.min(layoutSummary[datum[0]], parseFloat(datum[2]))
                  },
      Severity: Major
      Found in public/js/circosjs.js and 1 other location - About 1 hr to fix
      public/js/circosjs.js on lines 320..324

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

      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

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

                              <button
                                  type="button"
                                  className={toggleClass}
                                  disabled={toggleDisabled}
                                  onClick={function () {
      Severity: Major
      Found in public/js/databases.js and 1 other location - About 1 hr to fix
      public/js/databases_tree.js on lines 100..109

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

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

      var ribbonV3 = function() {
          var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
          function chord(d, i) {
              var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i);
              result = "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.p0) : curve(t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(s.p0)) + "Z";
      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

      Method convert_deprecated_options has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def convert_deprecated_options(options)
            options.each do |blast_algo, algo_config|
              if algo_config.is_a?(Array)
                # Very old config files may have a single array with CLI args.
                # e.g. { blastn: ['-task blastn', '-evalue 1e-5'] }
      Severity: Minor
      Found in lib/sequenceserver/config.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

      Method sys has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.sys(command, options = {})
          # Available output channels
          channels = %i[stdout stderr]
      
          # Make temporary files to store output from stdout and stderr.
      Severity: Minor
      Found in lib/sequenceserver/sys.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

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

          beforeEach(() => {
              csrfMetaTag = document.createElement('meta');
              csrfMetaTag.setAttribute('name', '_csrf');
              csrfMetaTag.setAttribute('content', 'test-token');
              document.head.appendChild(csrfMetaTag);
      Severity: Major
      Found in public/js/tests/form.spec.js and 1 other location - About 1 hr to fix
      public/js/tests/form.spec.js on lines 56..61

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

      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

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

          beforeEach(() => {
              csrfMetaTag = document.createElement('meta');
              csrfMetaTag.setAttribute('name', '_csrf');
              csrfMetaTag.setAttribute('content', 'test-token');
              document.head.appendChild(csrfMetaTag);
      Severity: Major
      Found in public/js/tests/form.spec.js and 1 other location - About 1 hr to fix
      public/js/tests/form.spec.js on lines 18..23

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

      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

                  }).attr('d', d3.arc().innerRadius(function(background) {
                      if (conf.direction === 'in') {
                          return conf.outerRadius - scope * background.start;
                      } else {
                          return conf.innerRadius + scope * background.start;
      Severity: Major
      Found in public/js/circosjs.js and 1 other location - About 1 hr to fix
      public/js/circosjs.js on lines 649..661

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

      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 render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const { formState, isModalVisible } = this.state;
      
          let content;
          switch (formState) {
      Severity: Minor
      Found in public/js/cloud_share_modal.js - About 1 hr to fix

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

        circosJS.Core.prototype.render = function(ids, removeTracks) {
            var name, ref, ref1, renderAll, svg, track, trackStore, trackType, tracks, translated;
            if (typeof ids === 'undefined') {
                renderAll = true;
                ids = [];
        Severity: Minor
        Found in public/js/circosjs.js - About 1 hr to fix

          Function advancedParamsJSX has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              advancedParamsJSX() {
                  let classNames = 'flex-grow block px-4 py-1 text-gray-900 border border-gray-300 rounded-lg bg-gray-50 text-base font-mono';
          
                  if (this.state.textValue) {
                      classNames += ' bg-yellow-100';
          Severity: Minor
          Found in public/js/options.js - About 1 hr to fix

            Function Chord has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            circosJS.Chord = function() {
                circosJS.Track.call(this);
                this.parseData = circosJS.parseChordData;
                this.applyRules = function(rules, data) {
                    var datum, l, len, results, rule;
            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

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

                resultsJSX() {
                    return (
                        <div className="grid grid-cols-1 md:grid-cols-4 gap-4 print:grid-cols-1" id="results">
                            <div className="hidden md:col-span-1 md:block print:hidden">
                                <Sidebar
            Severity: Minor
            Found in public/js/report.js - About 1 hr to fix

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

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

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

                    componentDidMount() {
                        /**
                        * Fetch data to initialise the search interface from the server. These
                        * include list of databases to search against, advanced options to
                        * apply when an algorithm is selected, and a query sequence that
                Severity: Minor
                Found in public/js/form.js - About 1 hr to fix

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

                      this.renderAxes = function(parentElement, conf, layout, data) {
                          var axes, axis, x;
                          if (conf.axes.minor.spacingType === 'pixel') {
                              axes = (function() {
                                  var l, ref, ref1, ref2, results;
                  Severity: Minor
                  Found in public/js/circosjs.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language