Stankec/Rocket_Docs

View on GitHub

Showing 9 of 21 total issues

Function animatedModal has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.animatedModal = function(action, options) {
        var modal = $(this);

        if (action && typeof(action) === 'object') {
          options = action;
Severity: Major
Found in app/assets/javascripts/rocket_docs/animated-modal.js - About 3 hrs to fix

    Function triggerAnimatedModal has 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.fn.triggerAnimatedModal = function(options) {
            var modal = $(this);
    
            //Defaults
            var settings = $.extend({
    Severity: Major
    Found in app/assets/javascripts/rocket_docs/animated-modal.js - About 3 hrs to fix

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

        HttpHeaders.prototype.attachHeaderListener = function($headersTable, $addHeaderBtn) {
          var storeName = this.prefix + 'saved';
      
          $headersTable.on('keyup', '[contenteditable]', function() {
            var $this = $(this);
      Severity: Minor
      Found in app/assets/javascripts/rocket_docs/http-headers.js - About 1 hr to fix

        Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def initialize(name, comments, methods, params, controller)
        Severity: Minor
        Found in lib/rocket_docs/documentation/action.rb - About 35 mins to fix

          Method build_parser_leaf_node has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def build_parser_leaf_node(parent, source)
                  case parent
                  when String
                    parent << "\n" if parent.length != 0
                    parent << source.try(:strip) || ''
          Severity: Minor
          Found in lib/rocket_docs/parser.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 deflated_url_params has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def deflated_url_params(params, wrapper = nil)
                  new_params = {}
          
                  params.each do |attribute, type|
                    new_attribute = wrapper ? "#{wrapper}[#{attribute}]" : attribute
          Severity: Minor
          Found in lib/rocket_docs/documentation/action.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

          Function storage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            storage: function() {
              if (!this.storageAdapter) {
                if (this.localStorageAvailable()) {
                  this.storageAdapter = localStorage;
                } else {
          Severity: Minor
          Found in app/assets/javascripts/rocket_docs/storage.js - 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 build_parser_default_node has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def build_parser_default_node(parent, words)
                  key = words.first
                  keyword = key.upcase
          
                  return unless words.count == 1
          Severity: Minor
          Found in lib/rocket_docs/parser.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

          Function set has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            set: function(key, value) {
              if (!key || !value) return;
          
              var store = this.storage();
          
          
          Severity: Minor
          Found in app/assets/javascripts/rocket_docs/storage.js - About 25 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