anthonymidili/Bullhorn

View on GitHub

Showing 17 of 60 total issues

Function exports has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(api) {
  var validEnv = ['development', 'test', 'production']
  var currentEnv = api.env()
  var isDevelopmentEnv = api.env('development')
  var isProductionEnv = api.env('production')
Severity: Major
Found in babel.config.js - About 2 hrs to fix

    Method action_statement has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

      def action_statement(notifiable)
        case notifiable.class.name
        when 'Post'
          if notifiable.reposting
            "Reposted 
    Severity: Minor
    Found in app/models/concerns/create_notifications.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 _on has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _on: function( suppressDisabledCheck, element, handlers ) {
            var delegateElement;
            var instance = this;
    
            // No suppressDisabledCheck flag, shuffle arguments
    Severity: Minor
    Found in app/javascript/packs/jquery-ui.js - About 1 hr to fix

      Function top has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              top: function( position, data ) {
                  var within = data.within,
                      withinOffset = within.offset.top + within.scrollTop,
                      outerHeight = within.height,
                      offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
      Severity: Minor
      Found in app/javascript/packs/jquery-ui.js - About 1 hr to fix

        Function left has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                left: function( position, data ) {
                    var within = data.within,
                        withinOffset = within.offset.left + within.scrollLeft,
                        outerWidth = within.width,
                        offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
        Severity: Minor
        Found in app/javascript/packs/jquery-ui.js - About 1 hr to fix

          Function _createWidget has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _createWidget: function( options, element ) {
                  element = $( element || this.defaultElement || this )[ 0 ];
                  this.element = $( element );
                  this.uuid = widgetUuid++;
                  this.eventNamespace = "." + this.widgetName + this.uuid;
          Severity: Minor
          Found in app/javascript/packs/jquery-ui.js - About 1 hr to fix

            Function option has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                option: function( key, value ) {
                    var options = key;
                    var parts;
                    var curOption;
                    var i;
            Severity: Minor
            Found in app/javascript/packs/jquery-ui.js - About 1 hr to fix

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

                def create
                  @post = current_user.posts.build
                  @repost = @post.build_repost(user: current_user, reposted: @reposting)
                  respond_to do |format|
                    if @post.save
              Severity: Minor
              Found in app/controllers/reposts_controller.rb - About 1 hr to fix

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

                  def create
                    @comment = @commentable.comments.build(comment_params)
                    @comment.created_by = current_user
                
                    respond_to do |format|
                Severity: Minor
                Found in app/controllers/comments_controller.rb - About 1 hr to fix

                  Function _initSource has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _initSource: function() {
                          var array, url,
                              that = this;
                          if ( Array.isArray( this.options.source ) ) {
                              array = this.options.source;
                  Severity: Minor
                  Found in app/javascript/packs/jquery-ui.js - About 1 hr to fix

                    Function connect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      connect() {
                        function debounce(func, wait = 10, immediate = true) {
                          let timeout
                          return function() {
                            let context = this, args = arguments
                    Severity: Minor
                    Found in app/javascript/controllers/hide_on_scroll_controller.js - About 1 hr to fix

                      Function left has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              left: function( position, data ) {
                                  var within = data.within,
                                      withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
                                      outerWidth = within.width,
                                      collisionPosLeft = position.left - data.collisionPosition.marginLeft,
                      Severity: Minor
                      Found in app/javascript/packs/jquery-ui.js - About 1 hr to fix

                        Function top has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                top: function( position, data ) {
                                    var within = data.within,
                                        withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
                                        outerHeight = data.within.height,
                                        collisionPosTop = position.top - data.collisionPosition.marginTop,
                        Severity: Minor
                        Found in app/javascript/packs/jquery-ui.js - About 1 hr to fix

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

                            def create
                              user = User.search_by(params[:search]).first unless params[:search].blank?
                              @direct = 
                                if user
                                  current_user.find_or_init_direct_message(user, direct_params)
                          Severity: Minor
                          Found in app/controllers/directs_controller.rb - About 1 hr to fix

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

                              def create
                                user = User.search_by(params[:search]).first unless params[:search].blank?
                                @direct = 
                                  if user
                                    current_user.find_or_init_direct_message(user, direct_params)
                            Severity: Minor
                            Found in app/controllers/directs_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 set_objects has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def set_objects
                                if user_signed_in? && @from_controller == "sites" && @from_action == "index"
                                  sites_objects
                                elsif @from_controller == "users" && @from_action == "show"
                                  users_objects
                            Severity: Minor
                            Found in app/controllers/concerns/InfiniteScroll.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 read_user_notifications has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def read_user_notifications(current_user)
                                if self.class.name == "Direct"
                                  read_message_notifications(current_user)
                                else
                                  self.notifications.by_unread.where(recipient: current_user).
                            Severity: Minor
                            Found in app/models/concerns/read_notifications.rb - 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