Showing 30 of 30 total issues

File bootstrap.js has 1412 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ===================================================
 * bootstrap-transition.js v2.1.1
 * http://twitter.github.com/bootstrap/javascript.html#transitions
 * ===================================================
 * Copyright 2012 Twitter, Inc.
Severity: Major
Found in public/bootstrap/js/bootstrap.js - About 3 days to fix

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

      $.fn.affix = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('affix')
            , options = typeof option == 'object' && option
    Severity: Major
    Found in public/bootstrap/js/bootstrap.js and 1 other location - About 4 hrs to fix
    public/bootstrap/js/bootstrap.js on lines 1321..1329

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

    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

      $.fn.popover = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('popover')
            , options = typeof option == 'object' && option
    Severity: Major
    Found in public/bootstrap/js/bootstrap.js and 1 other location - About 4 hrs to fix
    public/bootstrap/js/bootstrap.js on lines 1992..2000

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

    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

      $.fn.collapse = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('collapse')
            , options = typeof option == 'object' && option
    Severity: Major
    Found in public/bootstrap/js/bootstrap.js and 3 other locations - About 4 hrs to fix
    public/bootstrap/js/bootstrap.js on lines 1214..1222
    public/bootstrap/js/bootstrap.js on lines 1463..1471
    public/bootstrap/js/bootstrap.js on lines 1890..1898

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

    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

      $.fn.scrollspy = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('scrollspy')
            , options = typeof option == 'object' && option
    Severity: Major
    Found in public/bootstrap/js/bootstrap.js and 3 other locations - About 4 hrs to fix
    public/bootstrap/js/bootstrap.js on lines 544..552
    public/bootstrap/js/bootstrap.js on lines 1214..1222
    public/bootstrap/js/bootstrap.js on lines 1890..1898

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

    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

      $.fn.tooltip = function ( option ) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('tooltip')
            , options = typeof option == 'object' && option
    Severity: Major
    Found in public/bootstrap/js/bootstrap.js and 3 other locations - About 4 hrs to fix
    public/bootstrap/js/bootstrap.js on lines 544..552
    public/bootstrap/js/bootstrap.js on lines 1463..1471
    public/bootstrap/js/bootstrap.js on lines 1890..1898

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

    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

      $.fn.typeahead = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('typeahead')
            , options = typeof option == 'object' && option
    Severity: Major
    Found in public/bootstrap/js/bootstrap.js and 3 other locations - About 4 hrs to fix
    public/bootstrap/js/bootstrap.js on lines 544..552
    public/bootstrap/js/bootstrap.js on lines 1214..1222
    public/bootstrap/js/bootstrap.js on lines 1463..1471

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

    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

      $.fn.alert = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('alert')
          if (!data) $this.data('alert', (data = new Alert(this)))
    Severity: Major
    Found in public/bootstrap/js/bootstrap.js and 1 other location - About 3 hrs to fix
    public/bootstrap/js/bootstrap.js on lines 701..708

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

    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

      $.fn.dropdown = function (option) {
        return this.each(function () {
          var $this = $(this)
            , data = $this.data('dropdown')
          if (!data) $this.data('dropdown', (data = new Dropdown(this)))
    Severity: Major
    Found in public/bootstrap/js/bootstrap.js and 1 other location - About 3 hrs to fix
    public/bootstrap/js/bootstrap.js on lines 130..137

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

    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

      , getContent: function () {
          var content
            , $e = this.$element
            , o = this.options
    
    
    Severity: Major
    Found in public/bootstrap/js/bootstrap.js and 1 other location - About 2 hrs to fix
    public/bootstrap/js/bootstrap.js on lines 1165..1174

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

    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

      , getTitle: function () {
          var title
            , $e = this.$element
            , o = this.options
    
    
    Severity: Major
    Found in public/bootstrap/js/bootstrap.js and 1 other location - About 2 hrs to fix
    public/bootstrap/js/bootstrap.js on lines 1293..1302

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

    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

    Class User has 22 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class User < ActiveRecord::Base
    
      devise :database_authenticatable, :registerable,
             :recoverable, :rememberable, :trackable, :validatable
    
    
    Severity: Minor
    Found in app/models/user.rb - About 2 hrs to fix

      Function show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        , show: function () {
            var $tip
              , inside
              , pos
              , actualWidth
      Severity: Minor
      Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

        Method query has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def query
            message = parse_xml_to_hash(params[:xml])
            case message.content
              when '1'
                books = Book.order("RANDOM()").limit(5)
        Severity: Minor
        Found in app/controllers/wei_xin_controller.rb - About 1 hr to fix

          Function slide has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            , slide: function (type, next) {
                var $active = this.$element.find('.item.active')
                  , $next = next || $active[type]()
                  , isCycling = this.interval
                  , direction = type == 'next' ? 'left' : 'right'
          Severity: Minor
          Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

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

                var showBooks = function (json) {
                    $('.books').empty().append('<p>共<b>' + json.count + '</b>条结果</p>');
                    var books = json.books;
                    books = $.isArray(books) ? books : books.toArray()
                    for (var i = 0; i < books.length; i++) {
            Severity: Minor
            Found in app/assets/javascripts/add-book.js - About 1 hr to fix

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

                  , show: function () {
                      var that = this
                        , e = $.Event('show')
              
                      this.$element.trigger(e)
              Severity: Minor
              Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

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

                      this.timeout = setTimeout(function() {
                        if (self.hoverState == 'out') self.hide()
                      }, self.options.delay.hide)
                Severity: Major
                Found in public/bootstrap/js/bootstrap.js and 1 other location - About 1 hr to fix
                public/bootstrap/js/bootstrap.js on lines 1043..1045

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

                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

                      this.timeout = setTimeout(function() {
                        if (self.hoverState == 'in') self.show()
                      }, self.options.delay.show)
                Severity: Major
                Found in public/bootstrap/js/bootstrap.js and 1 other location - About 1 hr to fix
                public/bootstrap/js/bootstrap.js on lines 1055..1057

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

                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

                            if (books[i].isbn13) {
                                var isbn = $('<p>ISBN:' + books[i].isbn13 + '</p>');
                                info.append(isbn);
                            }
                Severity: Minor
                Found in app/assets/javascripts/add-book.js and 1 other location - About 55 mins to fix
                app/assets/javascripts/add-book.js on lines 39..42

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

                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