SpontaneousCMS/spontaneous

View on GitHub

Showing 261 of 342 total issues

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

      def initialize(owner, user, created_at, old_value, new_value)
Severity: Minor
Found in lib/spontaneous/model/core/modifications.rb - About 35 mins to fix

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

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

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

          def store(revision, partition, _path, template, transaction)
      Severity: Minor
      Found in lib/spontaneous/output/store/fog.rb - 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 store has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def store(revision, partition, path, template, transaction)
          Severity: Minor
          Found in lib/spontaneous/output/store/moneta.rb - About 35 mins to fix

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

                def self.set(site, field, value, user, asynchronous = false)
            Severity: Minor
            Found in lib/spontaneous/field.rb - About 35 mins to fix

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

                  def self.update(site, content, params, user, asynchronous = false)
              Severity: Minor
              Found in lib/spontaneous/field.rb - About 35 mins to fix

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

                    def initialize(site, revision, pages, progress = Spontaneous::Publishing::Progress::Silent.new, user = nil)
                Severity: Minor
                Found in lib/spontaneous/publishing/transaction.rb - About 35 mins to fix

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

                      def store(revision, partition, key, template, transaction)
                  Severity: Minor
                  Found in lib/spontaneous/output/store/file.rb - About 35 mins to fix

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

                        def redirect(location, redirect_code=:temporary)
                          if String === location
                            destination = @site[location]
                            location = destination.path if destination and destination.respond_to?(:path)
                          else
                    Severity: Minor
                    Found in lib/spontaneous/rack/page_controller.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 content_type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def content_type(type, params={})
                            default   = params.delete :default
                            mime_type = mime_type(type) || default
                            fail "Unknown media type: %p" % type if mime_type.nil?
                            mime_type = mime_type.dup
                    Severity: Minor
                    Found in lib/spontaneous/rack/public.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 PagePieceView has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Spontaneous.Views.PagePieceView = (function($, S) {
                        'use strict';
                        var dom = S.Dom;
                    
                        var PagePieceView = new JS.Class(Spontaneous.Views.PieceView, {
                    Severity: Minor
                    Found in application/js/views/page_piece_view.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 call has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def call(env)
                            return @app.call(env) unless ALLOWED_METHODS.include?(env[S::REQUEST_METHOD])
                            orig_path = env['PATH_INFO']
                            found = nil
                            @try.each do |path|
                    Severity: Minor
                    Found in lib/spontaneous/rack/static.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 update_serialized_fields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def update_serialized_fields(fields = nil)
                          if fields.nil?
                            @field_set.serialize_db
                          else
                            field_store = (self.field_store || []).dup
                    Severity: Minor
                    Found in lib/spontaneous/model/core/fields.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 geolocate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def geolocate(address)
                          return {} if address.blank?
                          url = "http://maps.google.com/maps/api/geocode/json?address=#{URI.escape(address)}&sensor=false"
                    
                          response = open(url).read rescue "{}"
                    Severity: Minor
                    Found in lib/spontaneous/field/location.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 safe_stat has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def safe_stat(file)
                            return unless file
                            stat = ::File.stat(file)
                            return file, stat if stat.file?
                          rescue Errno::ENOENT, Errno::ENOTDIR
                    Severity: Minor
                    Found in lib/spontaneous/loader.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 load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def load(id, reference)
                          @instance_lock.synchronize do
                            unless instance = @instances[id]
                              instance = UID.new(self, id, reference)
                              # check to make sure that the uid is valid first
                    Severity: Minor
                    Found in lib/spontaneous/schema/uid_map.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 create_visibility_modifications has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def create_visibility_modifications
                          # We only want to record visibility changes that originate from user action, not ones propagated
                          # from higher up the tree, hence the check against the hidden_origin.
                          return false unless changed_columns.include?(:hidden) && hidden_origin.nil?
                          if (previous_modification = local_modifications.detect { |mod| mod.type == :visibility })
                    Severity: Minor
                    Found in lib/spontaneous/model/core/modifications.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 create_slug_modifications has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def create_slug_modifications
                          change = changes_to_cascade[:slug]
                          return false if change.nil?
                          old_slug, new_slug = change.old_value, self[:slug]
                          return false if old_slug.nil? # ignore first change of slug from nil to provided or generated
                    Severity: Minor
                    Found in lib/spontaneous/model/core/modifications.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 named has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def named(name)
                          key = name.to_sym
                          return @store[key] if @store.key?(key)
                          value = (superset? ? superset.named(name) : nil)
                          return value unless value.nil?
                    Severity: Minor
                    Found in lib/spontaneous/collections/prototype_set.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

                    Severity
                    Category
                    Status
                    Source
                    Language