privly/privly-web

View on GitHub

Showing 98 of 98 total issues

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

  $.fn.tab.noConflict = function () {
    $.fn.tab = old
    return this
  }
Severity: Major
Found in app/assets/javascripts/bootstrap.js and 7 other locations - About 35 mins to fix
app/assets/javascripts/bootstrap.js on lines 147..150
app/assets/javascripts/bootstrap.js on lines 247..250
app/assets/javascripts/bootstrap.js on lines 445..448
app/assets/javascripts/bootstrap.js on lines 615..618
app/assets/javascripts/bootstrap.js on lines 787..790
app/assets/javascripts/bootstrap.js on lines 1025..1028
app/assets/javascripts/bootstrap.js on lines 2148..2151

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 46.

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

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

      if (!selector) {
        selector = $this.attr('href')
        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
      }
Severity: Minor
Found in app/assets/javascripts/bootstrap.js and 1 other location - About 35 mins to fix
app/assets/javascripts/bootstrap.js on lines 98..101

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 46.

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 8 locations. Consider refactoring.
Open

  $.fn.alert.noConflict = function () {
    $.fn.alert = old
    return this
  }
Severity: Major
Found in app/assets/javascripts/bootstrap.js and 7 other locations - About 35 mins to fix
app/assets/javascripts/bootstrap.js on lines 247..250
app/assets/javascripts/bootstrap.js on lines 445..448
app/assets/javascripts/bootstrap.js on lines 615..618
app/assets/javascripts/bootstrap.js on lines 787..790
app/assets/javascripts/bootstrap.js on lines 1025..1028
app/assets/javascripts/bootstrap.js on lines 1815..1818
app/assets/javascripts/bootstrap.js on lines 2148..2151

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 46.

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 8 locations. Consider refactoring.
Open

  $.fn.button.noConflict = function () {
    $.fn.button = old
    return this
  }
Severity: Major
Found in app/assets/javascripts/bootstrap.js and 7 other locations - About 35 mins to fix
app/assets/javascripts/bootstrap.js on lines 147..150
app/assets/javascripts/bootstrap.js on lines 445..448
app/assets/javascripts/bootstrap.js on lines 615..618
app/assets/javascripts/bootstrap.js on lines 787..790
app/assets/javascripts/bootstrap.js on lines 1025..1028
app/assets/javascripts/bootstrap.js on lines 1815..1818
app/assets/javascripts/bootstrap.js on lines 2148..2151

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 46.

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 8 locations. Consider refactoring.
Open

  $.fn.collapse.noConflict = function () {
    $.fn.collapse = old
    return this
  }
Severity: Major
Found in app/assets/javascripts/bootstrap.js and 7 other locations - About 35 mins to fix
app/assets/javascripts/bootstrap.js on lines 147..150
app/assets/javascripts/bootstrap.js on lines 247..250
app/assets/javascripts/bootstrap.js on lines 445..448
app/assets/javascripts/bootstrap.js on lines 787..790
app/assets/javascripts/bootstrap.js on lines 1025..1028
app/assets/javascripts/bootstrap.js on lines 1815..1818
app/assets/javascripts/bootstrap.js on lines 2148..2151

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 46.

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 8 locations. Consider refactoring.
Open

  $.fn.modal.noConflict = function () {
    $.fn.modal = old
    return this
  }
Severity: Major
Found in app/assets/javascripts/bootstrap.js and 7 other locations - About 35 mins to fix
app/assets/javascripts/bootstrap.js on lines 147..150
app/assets/javascripts/bootstrap.js on lines 247..250
app/assets/javascripts/bootstrap.js on lines 445..448
app/assets/javascripts/bootstrap.js on lines 615..618
app/assets/javascripts/bootstrap.js on lines 787..790
app/assets/javascripts/bootstrap.js on lines 1815..1818
app/assets/javascripts/bootstrap.js on lines 2148..2151

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 46.

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 8 locations. Consider refactoring.
Open

  $.fn.carousel.noConflict = function () {
    $.fn.carousel = old
    return this
  }
Severity: Major
Found in app/assets/javascripts/bootstrap.js and 7 other locations - About 35 mins to fix
app/assets/javascripts/bootstrap.js on lines 147..150
app/assets/javascripts/bootstrap.js on lines 247..250
app/assets/javascripts/bootstrap.js on lines 615..618
app/assets/javascripts/bootstrap.js on lines 787..790
app/assets/javascripts/bootstrap.js on lines 1025..1028
app/assets/javascripts/bootstrap.js on lines 1815..1818
app/assets/javascripts/bootstrap.js on lines 2148..2151

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 46.

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 8 locations. Consider refactoring.
Open

  $.fn.typeahead.noConflict = function () {
    $.fn.typeahead = old
    return this
  }
Severity: Major
Found in app/assets/javascripts/bootstrap.js and 7 other locations - About 35 mins to fix
app/assets/javascripts/bootstrap.js on lines 147..150
app/assets/javascripts/bootstrap.js on lines 247..250
app/assets/javascripts/bootstrap.js on lines 445..448
app/assets/javascripts/bootstrap.js on lines 615..618
app/assets/javascripts/bootstrap.js on lines 787..790
app/assets/javascripts/bootstrap.js on lines 1025..1028
app/assets/javascripts/bootstrap.js on lines 1815..1818

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 46.

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

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

    if (!selector) {
      selector = $this.attr('href')
      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
    }
Severity: Minor
Found in app/assets/javascripts/bootstrap.js and 1 other location - About 35 mins to fix
app/assets/javascripts/bootstrap.js on lines 1730..1733

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 46.

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

Avoid too many return statements within this function.
Open

     return false;
Severity: Major
Found in public/cdn/privly.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

         return false;
    Severity: Major
    Found in public/cdn/privly-0.1.2.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

           return false;
      Severity: Major
      Found in public/cdn/privly-0.1.3.js - About 30 mins to fix

        Function resizeIframePostedMessage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          resizeIframePostedMessage: function(message){
            
            "use strict";
            
            //check the format of the message
        Severity: Minor
        Found in public/cdn/privly-0.1.2.js - 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

        Function injectLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          injectLink: function(object)
          {
            "use strict";
            
            //Sets content URL.
        Severity: Minor
        Found in public/cdn/privly-0.1.3.js - 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

        Function injectLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          injectLink: function(object)
          {
            "use strict";
            
            //Sets content URL.
        Severity: Minor
        Found in public/cdn/privly.js - 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

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

              column do
                panel "Top Users By Successfull Requests" do
                  ul do
                    User.order("permissioned_requests_served DESC").first(10).map do |user|
                      li link_to(user.email, admin_user_path(user)) + " Permissioned Requests Served: #{user.permissioned_requests_served}"
        Severity: Minor
        Found in app/admin/dashboard.rb and 2 other locations - About 15 mins to fix
        app/admin/dashboard.rb on lines 25..29
        app/admin/dashboard.rb on lines 45..49

        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 26.

        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 3 locations. Consider refactoring.
        Open

              column do
                panel "Recently Loged In Users" do
                  ul do
                    User.order("current_sign_in_at DESC").first(10).each do |user|
                      li link_to(user.email, admin_user_path(user)) + " Last: #{user.current_sign_in_at}"
        Severity: Minor
        Found in app/admin/dashboard.rb and 2 other locations - About 15 mins to fix
        app/admin/dashboard.rb on lines 36..40
        app/admin/dashboard.rb on lines 45..49

        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 26.

        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 3 locations. Consider refactoring.
        Open

              column do
                panel "Top Users By Unsuccessfull Requests" do
                  ul do
                    User.order("nonpermissioned_requests_served DESC").first(10).map do |user|
                      li link_to(user.email, admin_user_path(user)) + " Non-Permissioned Requests Served: #{user.nonpermissioned_requests_served}"
        Severity: Minor
        Found in app/admin/dashboard.rb and 2 other locations - About 15 mins to fix
        app/admin/dashboard.rb on lines 25..29
        app/admin/dashboard.rb on lines 36..40

        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 26.

        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

        Severity
        Category
        Status
        Source
        Language