media3-0/apki.org

View on GitHub

Showing 122 of 122 total issues

Function backdrop has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Modal.prototype.backdrop = function (callback) {
    var that = this
    var animate = this.$element.hasClass('fade') ? 'fade' : ''

    if (this.isShown && this.options.backdrop) {
Severity: Minor
Found in public/javascripts/bootstrap.js - About 1 hr to fix

    Function activate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      Tab.prototype.activate = function (element, container, callback) {
        var $active    = container.find('> .active')
        var transition = callback
          && $.support.transition
          && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
    Severity: Minor
    Found in public/javascripts/bootstrap.js - About 1 hr to fix

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

        config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
          b.use :html5
          b.use :placeholder
          b.optional :maxlength
          b.optional :pattern
      Severity: Major
      Found in config/initializers/simple_form_bootstrap.rb and 1 other location - About 1 hr to fix
      config/initializers/simple_form_bootstrap.rb on lines 111..123

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

      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

        config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
          b.use :html5
          b.use :placeholder
          b.optional :maxlength
          b.optional :pattern
      Severity: Major
      Found in config/initializers/simple_form_bootstrap.rb and 1 other location - About 1 hr to fix
      config/initializers/simple_form_bootstrap.rb on lines 7..19

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

      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

          if (!self) {
            self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
            $(obj.currentTarget).data('bs.' + this.type, self)
          }
      Severity: Major
      Found in public/javascripts/bootstrap.js and 2 other locations - About 1 hr to fix
      public/javascripts/bootstrap.js on lines 1362..1365
      public/javascripts/bootstrap.js on lines 1703..1706

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

      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

            if (!self) {
              self = new this.constructor(e.currentTarget, this.getDelegateOptions())
              $(e.currentTarget).data('bs.' + this.type, self)
            }
      Severity: Major
      Found in public/javascripts/bootstrap.js and 2 other locations - About 1 hr to fix
      public/javascripts/bootstrap.js on lines 1362..1365
      public/javascripts/bootstrap.js on lines 1399..1402

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

      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

          if (!self) {
            self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
            $(obj.currentTarget).data('bs.' + this.type, self)
          }
      Severity: Major
      Found in public/javascripts/bootstrap.js and 2 other locations - About 1 hr to fix
      public/javascripts/bootstrap.js on lines 1399..1402
      public/javascripts/bootstrap.js on lines 1703..1706

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

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

        Collapse.prototype.show = function () {
          if (this.transitioning || this.$element.hasClass('in')) return
      
          var activesData
          var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
      Severity: Minor
      Found in public/javascripts/bootstrap.js - About 1 hr to fix

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

          it 'User or teacher cannot create new quiz' do
            session[:user_id] = @user.id.to_s
        
            post :create, format: :json, lesson_id: @lesson.id.to_s
            expect(response.status).to eq 401
        Severity: Major
        Found in spec/controllers/course/quizzes_spec.rb and 2 other locations - About 1 hr to fix
        spec/controllers/course/exercises_spec.rb on lines 40..53
        spec/controllers/course/lessons_spec.rb on lines 49..62

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

          it 'User or teacher cannot create new lesson' do
            session[:user_id] = @user.id.to_s
        
            post :create, format: :json, course_id: @course.id.to_s
            expect(response.status).to eq 401
        Severity: Major
        Found in spec/controllers/course/lessons_spec.rb and 2 other locations - About 1 hr to fix
        spec/controllers/course/exercises_spec.rb on lines 40..53
        spec/controllers/course/quizzes_spec.rb on lines 40..53

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

          it 'User or teacher cannot create new exercise' do
            session[:user_id] = @user.id.to_s
        
            post :create, format: :json, lesson_id: @lesson.id.to_s
            expect(response.status).to eq 401
        Severity: Major
        Found in spec/controllers/course/exercises_spec.rb and 2 other locations - About 1 hr to fix
        spec/controllers/course/lessons_spec.rb on lines 49..62
        spec/controllers/course/quizzes_spec.rb on lines 40..53

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

          Tooltip.prototype.applyPlacement = function (offset, placement) {
            var $tip   = this.tip()
            var width  = $tip[0].offsetWidth
            var height = $tip[0].offsetHeight
        
        
        Severity: Minor
        Found in public/javascripts/bootstrap.js - About 1 hr to fix

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

            Tab.prototype.show = function () {
              var $this    = this.element
              var $ul      = $this.closest('ul:not(.dropdown-menu)')
              var selector = $this.data('target')
          
          
          Severity: Minor
          Found in public/javascripts/bootstrap.js - About 1 hr to fix

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

              Affix.prototype.checkPosition = function () {
                if (!this.$element.is(':visible')) return
            
                var height       = this.$element.height()
                var offset       = this.options.offset
            Severity: Minor
            Found in public/javascripts/bootstrap.js - About 1 hr to fix

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

                  def object_to_json(course, single = false)
                    course_hash = course.attributes
                    course_hash['id'] = course_hash['_id']
                    course_hash['parent_id'] = course.parent_id
                    lessons_passed = []
              Severity: Minor
              Found in app/controllers/course/course_data_controller.rb - About 1 hr to fix

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

                  it 'Everybody can show single quiz' do
                    quiz = Course::Quiz.create!(data: @data, course_lesson: @lesson)
                
                    get :show, format: :json, id: quiz.id.to_s
                    expect(response).to be_success
                Severity: Major
                Found in spec/controllers/course/quizzes_spec.rb and 1 other location - About 1 hr to fix
                spec/controllers/course/exercises_spec.rb on lines 210..217

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

                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

                  it 'Everybody can show single exercise' do
                    exercise = Course::Exercise.create!(data: @data, course_lesson: @lesson)
                
                    get :show, format: :json, id: exercise.id.to_s
                    expect(response).to be_success
                Severity: Major
                Found in spec/controllers/course/exercises_spec.rb and 1 other location - About 1 hr to fix
                spec/controllers/course/quizzes_spec.rb on lines 194..201

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

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

                  Collapse.prototype.hide = function () {
                    if (this.transitioning || !this.$element.hasClass('in')) return
                
                    var startEvent = $.Event('hide.bs.collapse')
                    this.$element.trigger(startEvent)
                Severity: Minor
                Found in public/javascripts/bootstrap.js - About 1 hr to fix

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

                    ScrollSpy.prototype.refresh = function () {
                      var that          = this
                      var offsetMethod  = 'offset'
                      var offsetBase    = 0
                  
                  
                  Severity: Minor
                  Found in public/javascripts/bootstrap.js - About 1 hr to fix

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

                        function next() {
                          $active
                            .removeClass('active')
                            .find('> .dropdown-menu > .active')
                              .removeClass('active')
                    Severity: Minor
                    Found in public/javascripts/bootstrap.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language