thiagopradi/octopus

View on GitHub

Showing 170 of 237 total issues

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

  updateDrag: function(event, pointer) {
    if(!this.dragging) this.startDrag(event);

    if(!this.options.quiet){
      Position.prepare();
Severity: Minor
Found in sample_app/public/javascripts/dragdrop.js - About 1 hr to fix

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

      scroll: function() {
        var current = new Date();
        var delta = current - this.lastScrolled;
        this.lastScrolled = current;
        if(this.options.scroll == window) {
    Severity: Minor
    Found in sample_app/public/javascripts/dragdrop.js - About 1 hr to fix

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

          nth: function(nodes, formula, root, reverse, ofType) {
            if (nodes.length == 0) return [];
            if (formula == 'even') formula = '2n+0';
            if (formula == 'odd')  formula = '2n+1';
            var h = Selector.handlers, results = [], indexed = [], m;
      Severity: Minor
      Found in sample_app/public/javascripts/prototype.js - About 1 hr to fix

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

          readAttribute: function(element, name) {
            element = $(element);
            if (Prototype.Browser.IE) {
              var t = Element._attributeTranslations.read;
              if (t.values[name]) return t.values[name](element, name);
        Severity: Minor
        Found in sample_app/public/javascripts/prototype.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 replace has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          Element.Methods.replace = function(element, content) {
            element = $(element);
        
            if (content && content.toElement) content = content.toElement();
            if (Object.isElement(content)) {
        Severity: Minor
        Found in sample_app/public/javascripts/prototype.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 startDrag has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          startDrag: function(event) {
            this.dragging = true;
            if(!this.delta)
              this.delta = this.currentDelta();
        
        
        Severity: Minor
        Found in sample_app/public/javascripts/dragdrop.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 nth has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

              nth: function(fragment, m) {
                var mm, formula = m[6], predicate;
                if (formula == 'even') formula = '2n+0';
                if (formula == 'odd')  formula = '2n+1';
                if (mm = formula.match(/^(\d+)$/)) // digit only
        Severity: Minor
        Found in sample_app/public/javascripts/prototype.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 cumulativeOffset has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          Element.Methods.cumulativeOffset = function(element) {
            var valueT = 0, valueL = 0;
            do {
              valueT += element.offsetTop  || 0;
              valueL += element.offsetLeft || 0;
        Severity: Minor
        Found in sample_app/public/javascripts/prototype.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 scroll has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          scroll: function() {
            var current = new Date();
            var delta = current - this.lastScrolled;
            this.lastScrolled = current;
            if(this.options.scroll == window) {
        Severity: Minor
        Found in sample_app/public/javascripts/dragdrop.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 updateElement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          updateElement: function(selectedElement) {
            if (this.options.updateElement) {
              this.options.updateElement(selectedElement);
              return;
            }
        Severity: Minor
        Found in sample_app/public/javascripts/controls.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 run_with_octopus has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

              def run_with_octopus(&block)
                return run_without_octopus(&block) unless connection.is_a?(Octopus::Proxy)
                shards = migrations.map(&:shards).flatten.map(&:to_s)
                connection.send_queries_to_multiple_shards(shards) do
                  run_without_octopus(&block)
        Severity: Minor
        Found in lib/octopus/migration.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 migrate_with_octopus has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

              def migrate_with_octopus(&block)
                return migrate_without_octopus(&block) unless connection.is_a?(Octopus::Proxy)
                shards = migrations.map(&:shards).flatten.map(&:to_s)
                connection.send_queries_to_multiple_shards(shards) do
                  migrate_without_octopus(&block)
        Severity: Minor
        Found in lib/octopus/migration.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 initialize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          initialize: function(element) {
            this.element = $(element);
            if (!this.element) throw(Effect._elementDoesNotExistError);
            var options = Object.extend({
              style: { }
        Severity: Minor
        Found in sample_app/public/javascripts/effects.js - About 1 hr to fix

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

            clonePosition: function(element, source) {
              var options = Object.extend({
                setLeft:    true,
                setTop:     true,
                setWidth:   true,
          Severity: Minor
          Found in sample_app/public/javascripts/prototype.js - About 1 hr to fix

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

            if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
              function iter(name) {
                return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
              }
            
            
            Severity: Minor
            Found in sample_app/public/javascripts/prototype.js - About 1 hr to fix

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

                match: function(element) {
                  this.tokens = [];
              
                  var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
                  var le, p, m, len = ps.length, name;
              Severity: Minor
              Found in sample_app/public/javascripts/prototype.js - About 1 hr to fix

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

                  startDrag: function(event) {
                    this.dragging = true;
                    if(!this.delta)
                      this.delta = this.currentDelta();
                
                
                Severity: Minor
                Found in sample_app/public/javascripts/dragdrop.js - About 1 hr to fix

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

                  Effect.SlideUp = function(element) {
                    element = $(element).cleanWhitespace();
                    var oldInnerBottom = element.down().getStyle('bottom');
                    var elementDimensions = element.getDimensions();
                    return new Effect.Scale(element, window.opera ? 0 : 1,
                  Severity: Minor
                  Found in sample_app/public/javascripts/effects.js - About 1 hr to fix

                    Method current_shard= has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def current_shard=(shard_symbol)
                          if shard_symbol.is_a?(Array)
                            self.current_slave_group = nil
                            shard_symbol.each { |symbol| fail "Nonexistent Shard Name: #{symbol}" if shards[symbol].nil? }
                          elsif shard_symbol.is_a?(Hash)
                    Severity: Minor
                    Found in lib/octopus/proxy_config.rb - About 1 hr to fix

                      Function Hash has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      var Hash = Class.create(Enumerable, (function() {
                        function initialize(object) {
                          this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
                        }
                      
                      
                      Severity: Minor
                      Found in sample_app/public/javascripts/prototype.js - 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

                      Severity
                      Category
                      Status
                      Source
                      Language