anthonymidili/Bullhorn

View on GitHub

Showing 37 of 62 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    addEventListener("direct-upload:start", event => {
      const { id } = event.detail
      const element = document.getElementById(`direct-upload-${id}`)
      element.classList.remove("direct-upload--pending")
    })
    Severity: Major
    Found in app/javascript/packs/direct_uploads.js and 1 other location - About 1 hr to fix
    app/javascript/packs/direct_uploads.js on lines 34..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 70.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    addEventListener("direct-upload:end", event => {
      const { id } = event.detail
      const element = document.getElementById(`direct-upload-${id}`)
      element.classList.add("direct-upload--complete")
    })
    Severity: Major
    Found in app/javascript/packs/direct_uploads.js and 1 other location - About 1 hr to fix
    app/javascript/packs/direct_uploads.js on lines 14..18

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 70.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            left: function() {
                $.ui.position.flip.left.apply( this, arguments );
                $.ui.position.fit.left.apply( this, arguments );
            },
    Severity: Major
    Found in app/javascript/packs/jquery-ui.js and 1 other location - About 1 hr to fix
    app/javascript/packs/jquery-ui.js on lines 1253..1256

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            top: function() {
                $.ui.position.flip.top.apply( this, arguments );
                $.ui.position.fit.top.apply( this, arguments );
            }
    Severity: Major
    Found in app/javascript/packs/jquery-ui.js and 1 other location - About 1 hr to fix
    app/javascript/packs/jquery-ui.js on lines 1249..1252

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    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

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

              if ( options.my[ 1 ] === "bottom" ) {
                  position.top -= elemHeight;
              } else if ( options.my[ 1 ] === "center" ) {
                  position.top -= elemHeight / 2;
              }
      Severity: Major
      Found in app/javascript/packs/jquery-ui.js and 3 other locations - About 1 hr to fix
      app/javascript/packs/jquery-ui.js on lines 969..973
      app/javascript/packs/jquery-ui.js on lines 975..979
      app/javascript/packs/jquery-ui.js on lines 999..1003

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 65.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

          if ( options.at[ 1 ] === "bottom" ) {
              basePosition.top += targetHeight;
          } else if ( options.at[ 1 ] === "center" ) {
              basePosition.top += targetHeight / 2;
          }
      Severity: Major
      Found in app/javascript/packs/jquery-ui.js and 3 other locations - About 1 hr to fix
      app/javascript/packs/jquery-ui.js on lines 969..973
      app/javascript/packs/jquery-ui.js on lines 999..1003
      app/javascript/packs/jquery-ui.js on lines 1005..1009

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 65.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

              if ( options.my[ 0 ] === "right" ) {
                  position.left -= elemWidth;
              } else if ( options.my[ 0 ] === "center" ) {
                  position.left -= elemWidth / 2;
              }
      Severity: Major
      Found in app/javascript/packs/jquery-ui.js and 3 other locations - About 1 hr to fix
      app/javascript/packs/jquery-ui.js on lines 969..973
      app/javascript/packs/jquery-ui.js on lines 975..979
      app/javascript/packs/jquery-ui.js on lines 1005..1009

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 65.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

          if ( options.at[ 0 ] === "right" ) {
              basePosition.left += targetWidth;
          } else if ( options.at[ 0 ] === "center" ) {
              basePosition.left += targetWidth / 2;
          }
      Severity: Major
      Found in app/javascript/packs/jquery-ui.js and 3 other locations - About 1 hr to fix
      app/javascript/packs/jquery-ui.js on lines 975..979
      app/javascript/packs/jquery-ui.js on lines 999..1003
      app/javascript/packs/jquery-ui.js on lines 1005..1009

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 65.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          respond_to do |format|
            format.turbo_stream do
              render turbo_stream: [
                turbo_stream.remove(@user),
                turbo_stream.prepend("other_users", 
      Severity: Major
      Found in app/controllers/users_controller.rb and 1 other location - About 1 hr to fix
      app/controllers/users_controller.rb on lines 94..109

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          respond_to do |format|
            format.turbo_stream do
              render turbo_stream: [
                turbo_stream.remove(@user),
                turbo_stream.prepend("admin_users", 
      Severity: Major
      Found in app/controllers/users_controller.rb and 1 other location - About 1 hr to fix
      app/controllers/users_controller.rb on lines 116..131

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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 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
                    Severity
                    Category
                    Status
                    Source
                    Language