dice-cyfronet/plgapp

View on GitHub

Showing 43 of 89 total issues

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

  Collapse.prototype.show = function () {
    if (this.transitioning || this.$element.hasClass('in')) return

    var activesData
    var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
Severity: Minor
Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix

    Function mkdir has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        this.mkdir = function (cb, path) {
    
            var success = function (data, status) {
                if (cb !== undefined) {
                    cb(null);
    Severity: Minor
    Found in public/plgapp/plgdata.js - About 1 hr to fix

      Function submitJob has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.submitJob = function (cb, job) {
              var success = function (data, status) {
                  addMonitoredJob(data.job_id, data.status, job.onUpdate);
                  if (cb != undefined) {
                      cb(null, data);
      Severity: Minor
      Found in public/plgapp/rimrock.js - About 1 hr to fix

        Function applyPlacement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Tooltip.prototype.applyPlacement = function (offset, placement) {
            var $tip   = this.tip()
            var width  = $tip[0].offsetWidth
            var height = $tip[0].offsetHeight
        
        
        Severity: Minor
        Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix

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

            Tab.prototype.show = function () {
              var $this    = this.element
              var $ul      = $this.closest('ul:not(.dropdown-menu)')
              var selector = $this.data('target')
          
          
          Severity: Minor
          Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix

            Function run has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                this.run = function (cb, job) {
                    var success = function (data, status) {
                        if (cb != undefined) {
                            cb(null, data);
                        }
            Severity: Minor
            Found in public/plgapp/rimrock.js - About 1 hr to fix

              Function abortJob has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  this.abortJob = function (cb, jobId) {
                      var success = function (data, status) {
                          if (cb !== undefined) {
                              cb(null);
                          }
              Severity: Minor
              Found in public/plgapp/rimrock.js - About 1 hr to fix

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

                  Affix.prototype.checkPosition = function () {
                    if (!this.$element.is(':visible')) return
                
                    var height       = this.$element.height()
                    var offset       = this.options.offset
                Severity: Minor
                Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix

                  Function processFetchResult has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      this.processFetchResult = function(data, successCallback) {
                          if(this.fieldNames.length > 0) {
                              if(Array.isArray(data)) {
                                  var result = [];
                                  var object = {};
                  Severity: Minor
                  Found in public/plgapp/datanet.js - About 1 hr to fix

                    Function hide has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      Collapse.prototype.hide = function () {
                        if (this.transitioning || !this.$element.hasClass('in')) return
                    
                        var startEvent = $.Event('hide.bs.collapse')
                        this.$element.trigger(startEvent)
                    Severity: Minor
                    Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix

                      Function refresh has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        ScrollSpy.prototype.refresh = function () {
                          var that          = this
                          var offsetMethod  = 'offset'
                          var offsetBase    = 0
                      
                      
                      Severity: Minor
                      Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix

                        Function deleteJob has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            this.deleteJob = function (cb, jobId) {
                                var success = function (data, status) {
                                    if (cb !== undefined) {
                                        cb(null, data);
                                    }
                        Severity: Minor
                        Found in public/plgapp/rimrock.js - About 1 hr to fix

                          Function next has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function next() {
                                $active
                                  .removeClass('active')
                                  .find('> .dropdown-menu > .active')
                                    .removeClass('active')
                          Severity: Minor
                          Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 1 hr to fix

                            Method execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def execute
                                app.assign_attributes(@params)
                            
                                build_activity(:updated) if app.update?
                                content_changed = app.content_changed?
                            Severity: Minor
                            Found in app/services/update_app_service.rb - About 55 mins 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 store! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                  def store!(file)
                                    tmp_dir = Dir.mktmpdir('plgapp')
                                    Zip::File.open(file.file) do |zipfile|
                                      zipfile.each do |f|
                                        unless f.symlink?
                            Severity: Minor
                            Found in lib/carrierwave/storage/app.rb - About 45 mins 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

                            Avoid deeply nested control flow statements.
                            Open

                                                        if (job.status == 'FINISHED' ||
                                                            job.status == 'ERROR') {
                                                            removeMonitoredJob(mJobId);
                                                        }
                            Severity: Major
                            Found in public/plgapp/rimrock.js - About 45 mins to fix

                              Method calculate_changes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def calculate_changes
                                    { create_or_update: [], delete: [] }.tap do |changes|
                                      delta['entries'].each do |entry|
                                        path, entry_hsh = entry
                                        existing_entry = entry(remote_to_relative(path))
                              Severity: Minor
                              Found in app/services/dropbox/pull_service.rb - About 45 mins 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 calculate_changes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def calculate_changes
                                    { create: [], update: [] }.tap do |changes|
                                      changes[:create] << local_props('.') unless registered?
                              
                                      list_local.each do |p|
                              Severity: Minor
                              Found in app/services/dropbox/push_service.rb - About 35 mins 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 initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def initialize(options)
                                  if range = (options.delete(:in) || options.delete(:within))
                                    raise ArgumentError, ':in and :within must be a Range' unless range.is_a?(Range)
                                    options[:minimum], options[:maximum] = range.begin, range.end
                                    options[:maximum] -= 1 if range.exclude_end?
                              Severity: Minor
                              Found in lib/file_size_validator.rb - About 35 mins 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

                              Avoid too many return statements within this function.
                              Open

                                  return false
                              Severity: Major
                              Found in public/plgapp/bootstrap/3.3.4/js/bootstrap.js - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language