dice-cyfronet/plgapp

View on GitHub

Showing 43 of 89 total issues

File bootstrap.js has 1548 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Bootstrap v3.3.4 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
Severity: Major
Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 4 days to fix

    Function DataNetChainFactory has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
    Open

    var DataNetChainFactory = function(repositoryName, controller) {
        this.repositoryName = repositoryName;
        this.controller = controller;
        this.urlBase = '/datanet/{repoName}/';
        this.fieldValues = {};
    Severity: Minor
    Found in public/plgapp/datanet.js - About 1 day 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 Rimrock has 230 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Rimrock = function () {
        var rimrockProxy = '/rimrock';
    
        var monitoredJobs = {};
    
    
    Severity: Major
    Found in public/plgapp/rimrock.js - About 1 day to fix

      Function PlgApp has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

      var PlgApp = function () {
          var baseLocation = '/';
          var rimrockJs = 'plgapp/rimrock.js';
          var plgdataJs = 'plgapp/plgdata.js';
          var datanetJs = 'plgapp/datanet.js';
      Severity: Minor
      Found in public/plgapp/plgapp.js - About 6 hrs 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 Rimrock has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

      var Rimrock = function () {
          var rimrockProxy = '/rimrock';
      
          var monitoredJobs = {};
      
      
      Severity: Minor
      Found in public/plgapp/rimrock.js - About 6 hrs 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 DataNetChainFactory has 152 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var DataNetChainFactory = function(repositoryName, controller) {
          this.repositoryName = repositoryName;
          this.controller = controller;
          this.urlBase = '/datanet/{repoName}/';
          this.fieldValues = {};
      Severity: Major
      Found in public/plgapp/datanet.js - About 6 hrs to fix

        Function PlgApp has 112 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var PlgApp = function () {
            var baseLocation = '/';
            var rimrockJs = 'plgapp/rimrock.js';
            var plgdataJs = 'plgapp/plgdata.js';
            var datanetJs = 'plgapp/datanet.js';
        Severity: Major
        Found in public/plgapp/plgapp.js - About 4 hrs to fix

          Function DataNet has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          var DataNet = function() {
              var factory = null;
              
              this.repository = function(name) {
                  factory = new DataNetChainFactory(name, this);
          Severity: Minor
          Found in public/plgapp/datanet.js - About 4 hrs 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 PLGData has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          var PLGData = function () {
              var plgdataProxy = '/plgdata';
              var downloadPrefix = plgdataProxy + '/download';
              var uploadPrefix = plgdataProxy + '/upload';
          
          
          Severity: Minor
          Found in public/plgapp/plgdata.js - About 3 hrs 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 DataNet has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var DataNet = function() {
              var factory = null;
              
              this.repository = function(name) {
                  factory = new DataNetChainFactory(name, this);
          Severity: Major
          Found in public/plgapp/datanet.js - About 3 hrs to fix

            Function PLGData has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var PLGData = function () {
                var plgdataProxy = '/plgdata';
                var downloadPrefix = plgdataProxy + '/download';
                var uploadPrefix = plgdataProxy + '/upload';
            
            
            Severity: Major
            Found in public/plgapp/plgdata.js - About 2 hrs to fix

              Function then has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  this.then = function(successCallback, errorCallback) {
                      switch(this.action) {
                          case undefined:
                          case null:
                              errorCallback('None of the action methods were called (action methods: create(), get(), delete(), update(), search())');
              Severity: Major
              Found in public/plgapp/datanet.js - About 2 hrs to fix

                Method nav_link has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                  def nav_link(options = {}, &block)
                    if path = options.delete(:path)
                      if path.respond_to?(:each)
                        c = path.map { |p| p.split('#').first }
                        a = path.map { |p| p.split('#').last }
                Severity: Minor
                Found in app/helpers/tab_helper.rb - About 2 hrs 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 validate_each has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                  def validate_each(record, attribute, value)
                    raise(ArgumentError, 'A CarrierWave::Uploader::Base object was expected') unless value.kind_of? CarrierWave::Uploader::Base
                
                    value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String)
                
                
                Severity: Minor
                Found in lib/file_size_validator.rb - About 2 hrs 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 show has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  Tooltip.prototype.show = function () {
                    var e = $.Event('show.bs.' + this.type)
                
                    if (this.hasContent() && this.enabled) {
                      this.$element.trigger(e)
                Severity: Major
                Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 2 hrs to fix

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

                    Carousel.prototype.slide = function (type, next) {
                      var $active   = this.$element.find('.item.active')
                      var $next     = next || this.getItemForDirection(type, $active)
                      var isCycling = this.interval
                      var direction = type == 'next' ? 'left' : 'right'
                  Severity: Minor
                  Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix

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

                      Modal.prototype.show = function (_relatedTarget) {
                        var that = this
                        var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
                    
                        this.$element.trigger(e)
                    Severity: Minor
                    Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix

                      Function monitorJobs has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var monitorJobs = function () {
                              var delayCheck = function () {
                                  if (Object.keys(monitoredJobs).length > 0) {
                                      setTimeout(monitorJobs, 5000);
                                  }
                      Severity: Minor
                      Found in public/plgapp/rimrock.js - About 1 hr to fix

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

                          Modal.prototype.backdrop = function (callback) {
                            var that = this
                            var animate = this.$element.hasClass('fade') ? 'fade' : ''
                        
                            if (this.isShown && this.options.backdrop) {
                        Severity: Minor
                        Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix

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

                            Tab.prototype.activate = function (element, container, callback) {
                              var $active    = container.find('> .active')
                              var transition = callback
                                && $.support.transition
                                && (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
                          Severity: Minor
                          Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language