SpontaneousCMS/spontaneous

View on GitHub

Showing 261 of 342 total issues

Function _draw_square has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

            _draw_square: function(ctx, c, r1, r2, a, p) {
Severity: Minor
Found in application/js/progress.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            for (i = startPosition - 1; i > position; i--) {
                                targets.push(allTargets[i]);
                            }
    Severity: Major
    Found in application/js/add_alias_dialogue.js - About 45 mins to fix

      Function ConflictedFieldDialogue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      Spontaneous.ConflictedFieldDialogue = (function($, S) {
          var dom = S.Dom, Dialogue = Spontaneous.Dialogue;
      
          var ConflictedFieldDialogue = new JS.Class(Dialogue, {
              initialize: function(parent_view, conflicted_fields) {
      Severity: Minor
      Found in application/js/conflicted_field_dialogue.js - 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

      Function Page has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      Spontaneous.Page = (function($, S) {
          var dom = S.Dom, user = S.User;
      
          var Page = new JS.Class(Spontaneous.Content, {
              initialize: function(content) {
      Severity: Minor
      Found in application/js/page.js - 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

      Function _draw_rounded has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                  _draw_rounded: function(ctx, c, r1, r2, a, p) {
      Severity: Minor
      Found in application/js/progress.js - About 45 mins to fix

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

              def fix_schema(error)
                modification = error.modification
                actions = modification.actions
                say(actions.description, :red)
                say("Please choose one of the solutions below", :yellow)
        Severity: Minor
        Found in lib/spontaneous/cli.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

                      elsif t == '"'
                        # Special case: single-character " token
                        if prev_token_last_char =~ /\S/
                          t = CLOSE_DBL_QUOTE
                        else
        Severity: Major
        Found in lib/spontaneous/utils/smart_quotes.rb - About 45 mins to fix

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

                def reload!
                  changed_files = []
                  rotation do |file, mtime|
                    # Retrive the last modified time
                    new_file = mtimes[file].nil?
          Severity: Minor
          Found in lib/spontaneous/loader.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 reload! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

                def reload!
                  rotation do |file, mtime|
                    # Retrive the last modified time
                    new_file = mtimes[file].nil?
                    previous_mtime = mtimes[file] ||= mtime
          Severity: Minor
          Found in lib/spontaneous/loader.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 field has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

                def field(name, type=nil, options={}, &block)
                  if type.is_a?(Hash)
                    options = type
                    type = nil
                  end
          Severity: Minor
          Found in lib/spontaneous/model/core/fields.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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def initialize(owner, user, created_at, old_visibility_path, new_owner_id, new_box_sid)
          Severity: Minor
          Found in lib/spontaneous/model/core/modifications.rb - About 45 mins to fix

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

                def combine_shards(hashes, &block)
                  hashes = hashes.split(',') unless hashes.is_a?(Array)
                  shards = hashes.map { |hash| Spontaneous.shard_path(hash) }
                  Tempfile.open('shard') do |combined|
                    combined.binmode
            Severity: Minor
            Found in lib/spontaneous/media.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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def initialize(owner, name, type, options={}, blocks = [], &block)
            Severity: Minor
            Found in lib/spontaneous/prototypes/field_prototype.rb - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                              if prev_token_last_char =~ /\S/
                                t = CLOSE_SGL_QUOTE
                              else
                                t = OPEN_SGL_QUOTE
                              end
              Severity: Major
              Found in lib/spontaneous/utils/smart_quotes.rb - About 45 mins to fix

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

                    def create_ownership_modifications
                      change = changes_to_cascade[:visibility_path]
                      return false if change.nil?
                      old_value, new_value = change.old_value, change.new_value
                      return false if old_value.nil?
                Severity: Minor
                Found in lib/spontaneous/model/core/modifications.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 content_for_request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                      def content_for_request(lock = false)
                        content_model.db.transaction do
                          dataset = lock ? content_model.for_update : content_model
                          content = dataset.get(params[:id])
                          halt 404 if content.nil?
                Severity: Minor
                Found in lib/spontaneous/rack/back/base.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 define_proxy_association has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        def define_proxy_association(association, proxy_methods, name, opts = {}, &block)
                Severity: Minor
                Found in lib/spontaneous/data_mapper/content_model/associations.rb - About 35 mins to fix

                  Function makeRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          makeRequest: function(method, url, data, callback, options) {
                  Severity: Minor
                  Found in application/js/ajax.js - About 35 mins to fix

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

                        def initialize(site, owner, filename, digest, headers = {})
                    Severity: Minor
                    Found in lib/spontaneous/media/file.rb - About 35 mins to fix

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

                            def register(task_name, task, options = {}, params = {}, env = {})
                      Severity: Minor
                      Found in lib/spontaneous/simultaneous.rb - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language