wurmlab/sequenceserver

View on GitHub

Showing 119 of 7,605 total issues

Method spawn_cleanup has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def spawn_cleanup
      Thread.new do
        loop do
          now = Time.now
          finished_jobs = Job.all.select(&:done?)
Severity: Minor
Found in lib/sequenceserver/job_remover.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 calculate_multipliers has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    calculate_multipliers() {
        var sum_query_length = 0;
        var sum_hit_length = 0;
        _.each(
            this.query_arr,
Severity: Minor
Found in public/js/circos.js - About 1 hr to fix

    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

      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

      Function Grapher has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function Grapher(Graph) {
          return class extends React.Component {
              constructor(props) {
                  super(props);
                  this.name = Graph.name();
      Severity: Minor
      Found in public/js/grapher.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 renderForm has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        renderForm() {
          const { email, agreeToTos } = this.state;
          const isSubmitDisabled = !agreeToTos;
      
          return(
      Severity: Minor
      Found in public/js/cloud_share_modal.js - About 1 hr to fix

        Function initiate has 39 lines of code (exceeds 25 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 1 hr to fix

          Function buildLayers has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.buildLayers = function(data, margin) {
                  var block, datum, i, idx, l, lastDatumInLayer, layer, layers, len, len1, m, placed, ref;
                  for (idx in data) {
                      block = data[idx];
                      block.values = block.values.sort(function(a, b) {
          Severity: Minor
          Found in public/packages/circosJS@1.7.0.js - About 1 hr to fix

            Function render has 37 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

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

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

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

                circosJS.Scatter = function() {
                    circosJS.Track.call(this);
                    this.parseData = circosJS.parsePositionValueData;
                    this.renderDatumContainer = (function(_this) {
                        return function(instance, parentElement, name, data, conf) {
                Severity: Minor
                Found in public/packages/circosJS@1.7.0.js - About 1 hr to fix

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

                  circosJS.Line = function() {
                      circosJS.Track.call(this);
                      this.parseData = circosJS.parsePositionValueData;
                      this.renderDatumContainer = (function(_this) {
                          return function(instance, parentElement, name, data, conf) {
                  Severity: Minor
                  Found in public/packages/circosJS@1.7.0.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/packages/circosJS@1.7.0.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 construct_layout has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                        construct_layout() {
                            var hsp_count = 0;
                            var query_count = 0;
                            var num_karyotype = 32;
                            var num_queries = this.queries.length;
                    Severity: Minor
                    Found in public/js/circos.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 parsePositionValueData has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    circosJS.parsePositionValueData = function(data, layoutSummary) {
                        var groups, sample;
                        sample = data[0];
                        if ('parent_id' in sample && 'position' in sample) {
                            data = data.map(function(datum) {
                    Severity: Minor
                    Found in public/packages/circosJS@1.7.0.js - About 1 hr to fix

                      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

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

                            this.renderDatum = function(parentElement, conf, layout, utils) {
                                var bin;
                                bin = parentElement.selectAll('.bin').data(function(d) {
                                    return d.values;
                                }).enter().append('path').attr('class', 'bin').attr('opacity', function(d) {
                        Severity: Minor
                        Found in public/packages/circosJS@1.7.0.js - About 1 hr to fix

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

                          circosJS.parsePositionTextData = function(data, layoutSummary) {
                              var groups, sample;
                              sample = data[0];
                              if ('parent_id' in sample && 'position' in sample) {
                                  data = data.map(function(datum) {
                          Severity: Minor
                          Found in public/packages/circosJS@1.7.0.js - About 1 hr to fix

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

                                                    _.bind(function (hit) {
                                                        if (hit.number < num_hits) {
                                                            var hsp_details = _.map(
                                                                hit.hsps,
                                                                _.bind(function (hsp) {
                            Severity: Minor
                            Found in public/js/circos.js - About 1 hr to fix

                              Function renderAxes has 33 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/packages/circosJS@1.7.0.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language