wurmlab/sequenceserver

View on GitHub

Showing 100 of 16,909 total issues

Function smartBorders has 51 lines of code (exceeds 25 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: Major
Found in public/js/circosjs.js - About 2 hrs to fix

    Function exports has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = (env, argv)  => {
        const pluginsPath = env.pluginsPath || './public/js/null_plugins';
    
        return {
            entry: {
    Severity: Major
    Found in webpack.config.js - About 2 hrs to fix

      Function ribbonV3 has 51 lines of code (exceeds 25 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: Major
      Found in public/js/circosjs.js - About 2 hrs to fix

        Function parseChordData has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        circosJS.parseChordData = function(data, layoutSummary) {
            var sample;
            sample = data[0];
            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) {
        Severity: Major
        Found in public/js/circosjs.js - About 2 hrs to fix

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

            Function hspLines has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              hspLines() {
                // Space reserved for showing coordinates
                var width = this.width();
            
                // Number of residues we can draw per line is the total number of
            Severity: Minor
            Found in public/js/hsp.js - About 1 hr to fix

              Function _render_polygons has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _render_polygons() {
                      var self = this;
              
                      // Remove all existing child elements.
                      this._svg.d3.selectAll('*').remove();
              Severity: Minor
              Found in public/js/kablammo.js - About 1 hr to fix

                Function renderDatabases has 48 lines of code (exceeds 25 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.js - About 1 hr to fix

                  Function renderButton has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      renderButton(method, multi, methods) {
                          return (
                              <div className="flex">
                                  <button
                                      type="submit"
                  Severity: Minor
                  Found in public/js/search_button.js - About 1 hr to fix

                    Function renderForm has 46 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 tableJSX has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          tableJSX() {
                              var hasName = _.every(this.props.query.hits, function (hit) {
                                  return hit.sciname !== '';
                              });
                      
                      
                      Severity: Minor
                      Found in public/js/query.js - About 1 hr to fix

                        Function poll has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function poll() {
                                    fetch(path)
                                        .then(response => {
                                            // Handle HTTP status codes
                                            if (!response.ok) throw response;
                        Severity: Minor
                        Found in public/js/report.js - About 1 hr to fix

                          Function renderChords has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              this.renderChords = function(parentElement, name, conf, data, layout, ratio, getSource, getTarget) {
                                  var link, track;
                                  track = parentElement.append('g').attr('class', conf.colorPalette);
                                  link = track
                                      .selectAll('.chord')
                          Severity: Minor
                          Found in public/js/circosjs.js - About 1 hr to fix

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

                            circosJS.mixConf = function(conf, defaultConf) {
                                var key, newConf, value;
                                newConf = {};
                                for (key in defaultConf) {
                                    value = defaultConf[key];
                            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 retrieve has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def retrieve(accession, coords = nil)
                                  fail(
                                    InvalidSequenceIdError,
                                    "Invalid sequence id: #{accession}"
                                  ) unless accession =~ SequenceServer::BLAST::VALID_SEQUENCE_ID
                            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

                            Method defaults has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def defaults
                                  @defaults ||= {
                                    host: '0.0.0.0',
                                    port: 4567,
                                    databases_widget: 'classic',
                            Severity: Minor
                            Found in lib/sequenceserver/config.rb - About 1 hr to fix

                              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

                                  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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language