stevekaplan123/carpe_diem

View on GitHub

Showing 45 of 58 total issues

Method run has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def run
        run_count = 0

        loop do
            current_stat = self.get_stats

    Method filterByRecommendations has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      def filterByRecommendations(events, user_id)
          events_attended = []
          tags_list = []
          tag_count = [0,0,0,0,0,0,0,0,0]
          recommended_events = []
    Severity: Minor
    Found in app/services/filter.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 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def initialize(result, coders_by_name, format, arraycoder)
                coder_map = {}
    
                _ranges, nodes = result.partition { |row| row['typinput'] == 'range_in' }
                leaves, nodes = nodes.partition { |row| row['typelem'].to_i == 0 }

      Method ship_rsync_ssh has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def ship_rsync_ssh( dest )
                  if dest.host.nil?
                      self.log "Destination %p missing required 'host' key.  WAL is queued." % [ dest.host ]
                      return
                  end

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

                def ship_file( dest )
                    if dest.path.nil?
                        self.log "Destination %p missing required 'path' key.  WAL is queued." % [ dest ]
                        return
                    end

        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 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def migrate
                if @relations.empty?
                    $stderr.puts 'No tables were found for warehousing.'
                    return
                end

        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 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def run
                run_count = 0
        
                loop do
                    current_stat = self.get_stats

        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 filterByOther has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        def filterByOther(events, user_id, other)
            friend_events = []
            my_friends = []
            @users_friendships = Friendship.where(user_id: user_id)
            @users_friendships.each do |friendship|
        Severity: Minor
        Found in app/services/filter.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 ship_rsync_ssh has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

                def ship_rsync_ssh( dest )
                    if dest.host.nil?
                        self.log "Destination %p missing required 'host' key.  WAL is queued." % [ dest.host ]
                        return
                    end

        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 onkeydown has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          this.onkeydown = function(e) {
            if (!this.navigationActive) return;
            switch(e.keyCode) {
              case 37: //Event.KEY_LEFT:
                if (this.moveLeft()) e.preventDefault();
        Severity: Minor
        Found in doc/app/js/navigation.js - About 1 hr to fix

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

            def update
              @tags = Tag.all
              time_occurrence_datetime = EventsService.create_time(params)
              new_tags_array = params[:tag_ids]
              tag_string = EventsService.get_tag_string(new_tags_array)
          Severity: Minor
          Found in app/controllers/events_controller.rb - About 1 hr to fix

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

              def create
                @tags = Tag.all
                @event = Event.new(event_params)
                @event.time_occurrence = EventsService.create_time(params)
                tag_array = params[:tag_ids]
            Severity: Minor
            Found in app/controllers/events_controller.rb - About 1 hr to fix

              Method create_time has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                def self.create_time(params)
                  puts "called"
              
                  if (params[:event_day].nil?)
                    day_int = nil
              Severity: Minor
              Found in app/services/events_service.rb - 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

              Method relations has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def relations
                      return @relations if @relations
                      relations = {}
              
                      query =  %q{

              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 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def initialize(user_id, location, near_me, other, time, tag, recommend)
              Severity: Major
              Found in app/services/filter.rb - About 50 mins to fix

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

                        def initialize( wal, conf )
                            # Make the config keys instance variables.
                            conf.each_pair {|key, val| self.instance_variable_set( "@#{key}", val ) }
                
                            # Spool directory check.
                Severity: Minor
                Found in th-pg-config=/path/to/pg_config/gems/pg-0.18.1/sample/wal_shipper.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 validate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                        def validate
                            # Check for required destination keys
                            %w[ label kind ].each do |key|
                                if self.send( key.to_sym ).nil?
                                    self.log "Destination %p missing required '%s' key." % [ self, key ]
                Severity: Minor
                Found in th-pg-config=/path/to/pg_config/gems/pg-0.18.1/sample/wal_shipper.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

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

                  function performSearch(data, regexps, queries, highlighters, state) {
                Severity: Minor
                Found in doc/app/js/searcher.js - About 35 mins to fix

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

                  def self.search(searchValue)
                    #@events = Event.all;  for each event, check each of the three in turn and add it to 
                    #actual_events array to return
                    #select distinct * from events where 
                        @events = []
                  Severity: Minor
                  Found in app/services/filter.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 populate_encoder_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def populate_encoder_list
                          DEFAULT_TYPE_MAP.each do |klass, selector|
                              if Array === selector
                                  format, name, oid_name = selector
                                  coder = coder_by_name(format, :encoder, name).dup

                  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