Showing 316 of 336 total issues

Method get has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def get(attr_name, expand = false)
      # Reading an attribute, we may get back a nil model.
      attr_name = attr_name.to_sym

      check_valid_field_name(attr_name)
Severity: Minor
Found in lib/volt/models/model.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 validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def self.validate(model, field_name, args)
      if RUBY_PLATFORM != 'opal'
        if args
          value  = model.get(field_name)

Severity: Minor
Found in lib/volt/models/validators/unique_validator.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 initialize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def initialize(builder, app_url, app_path, component_paths)
      Opal::Processor.source_map_enabled = Volt.source_maps?
      Opal::Processor.const_missing_enabled = true

      # Setup Opal paths
Severity: Minor
Found in lib/volt/server/rack/opal_files.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 components has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def components
      return @components if @components

      @components = {}
      app_folders do |app_folder|
Severity: Minor
Found in lib/volt/server/rack/component_paths.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 initialize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def initialize
        # rbnacl is not supported on windows.
        windows = Gem.win_platform?

        if windows
Severity: Minor
Found in lib/volt/server/message_bus/message_encoder.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 duration_in_words has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def duration_in_words(places=2, min_unit=:minutes, recent_message='just now')
      parts = []
      secs = to_i
      UNIT_MAP.each_pair do |unit, count|
        val = (secs / count).floor
Severity: Minor
Found in lib/volt/helpers/time/distance.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 filtered_attributes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def filtered_attributes
        # Run the read permission check
        allow_and_deny_fields(:read).then do |allow, deny|

          result = nil
Severity: Minor
Found in lib/volt/models/permissions.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 start_message_bus has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def start_message_bus
        return if ENV['NO_MESSAGE_BUS']

        unless RUBY_PLATFORM == 'opal'

Severity: Minor
Found in lib/volt/volt/server_setup/app.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 fix has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    fix: function( event ) {
        if ( event[ jQuery.expando ] ) {
            return event;
        }

Severity: Minor
Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

    Method rezero_bindings has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def rezero_bindings(html, bindings)
          @@base_binding_id ||= 20_000
          # rezero
          parts  = html.split(/(\<\!\-\- \$\/?[0-9]+ \-\-\>)/).reject { |v| v == '' }
    
    
    Severity: Minor
    Found in lib/volt/page/targets/attribute_section.rb - About 1 hr to fix

      Method connect! has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def connect!
            # The websocket url can be overridden by config.public.websocket_url
            socket_url = Volt.config.try(:public).try(:websocket_url) || begin
              "#{`document.location.host`}/socket"
            end
      Severity: Minor
      Found in lib/volt/page/channel.rb - About 1 hr to fix

        Function propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function propFilter( props, specialEasing ) {
            var index, name, easing, value, hooks;
        
            // camelCase, specialEasing and expand cssHook pass
            for ( index in props ) {
        Severity: Minor
        Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

          Method filtered_attributes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def filtered_attributes
                  # Run the read permission check
                  allow_and_deny_fields(:read).then do |allow, deny|
          
                    result = nil
          Severity: Minor
          Found in lib/volt/models/permissions.rb - About 1 hr to fix

            Method initialize has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def initialize(thor, name, options)
                @thor = thor
                @component_name = name.chomp('/')
                @name = 'volt-' + @component_name # remove trailing slash if present
                @shell = Thor::Base.shell.new
            Severity: Minor
            Found in lib/volt/cli/new_gem.rb - About 1 hr to fix

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

                      "*": [function( prop, value ) {
                          var tween = this.createTween( prop, value ),
                              target = tween.cur(),
                              parts = rfxnum.exec( value ),
                              unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
              Severity: Minor
              Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

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

                    clone: function( elem, dataAndEvents, deepDataAndEvents ) {
                        var i, l, srcElements, destElements,
                            clone = elem.cloneNode( true ),
                            inPage = jQuery.contains( elem.ownerDocument, elem );
                
                
                Severity: Minor
                Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

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

                      off: function( types, selector, fn ) {
                          var handleObj, type;
                          if ( types && types.preventDefault && types.handleObj ) {
                              // ( event )  dispatched jQuery.Event
                              handleObj = types.handleObj;
                  Severity: Minor
                  Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

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

                    jQuery.fn.offset = function( options ) {
                        if ( arguments.length ) {
                            return options === undefined ?
                                this :
                                this.each(function( i ) {
                    Severity: Minor
                    Found in app/volt/assets/js/jquery-2.0.3.js - About 1 hr to fix

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

                          def start_tag(tag, tag_name, rest, unary)
                            section_tag = tag_name[0] == ':' && tag_name[1] =~ /[A-Z]/
                      
                            if section_tag
                              tag_name = tag_name.underscore
                      Severity: Minor
                      Found in lib/volt/server/html_parser/sandlebars_parser.rb - About 1 hr to fix

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

                            def compile
                              say "Starting Precompile...", :red
                              require 'fileutils'
                              ENV['SERVER'] = 'true'
                              ENV['MAPS'] = 'false'
                        Severity: Minor
                        Found in lib/volt/cli/asset_compile.rb - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language