yannickwurm/sequenceserver

View on GitHub

Showing 119 of 7,605 total issues

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

        overviewJSX() {
            return (
                <div className="overview">
                    <p>
                        <strong>SequenceServer {this.state.seqserv_version}</strong> using{' '}
    Severity: Minor
    Found in public/js/report.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/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

      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() {
          const { formState } = this.state;
      
          let content;
          switch (formState) {
      Severity: Minor
      Found in public/js/cloud_share_modal.js - About 1 hr to fix

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

              warningJSX() {
                  return(
                      <div className="container">
                          <div className="row">
                              <div className="col-md-6 col-md-offset-3 text-center">
          Severity: Minor
          Found in public/js/report.js - About 1 hr to fix

            Function renderChords has 31 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').data(data).enter().append('path').attr('class', 'chord').attr('d', d3.svg.chord().source(function(d) {
                        return getSource(d, layout);
            Severity: Minor
            Found in public/packages/circosJS@1.7.0.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/packages/circosJS@1.7.0.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/packages/circosJS@1.7.0.js - About 1 hr to fix

                  Function componentDidMount has 29 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

                    Method defaults has 28 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 renderDatum has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

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

                        circosJS.Text = function() {
                            circosJS.Track.call(this);
                            this.parseData = circosJS.parsePositionTextData;
                            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 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.refs.query.isEmpty()) {
                          Severity: Minor
                          Found in public/js/form.js - About 1 hr to fix

                            Method normalize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def normalize(data)
                                  return {} unless data
                            
                                  # Symbolize keys.
                                  data = data.transform_keys(&:to_sym)
                            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

                            Function ratioCalculate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                ratioCalculate(value, min, max, scope, reverse, logScale) {
                                    var fraction, scaleLogBase, x;
                                    scaleLogBase = logScale ? 2.3 : 1;
                                    if (
                                        min === max ||
                            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 render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  constructor(props) {
                                      super(props);
                                      // Properties below are internal state used to render results in small
                                      // slices (see updateState).
                                      this.numUpdates = 0;
                              Severity: Minor
                              Found in public/js/report.js - About 1 hr to fix

                                Function selectHit has 26 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()) {
                                Severity: Minor
                                Found in public/js/report.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language