Jupiterrr/Vorlesungsverzeichnis

View on GitHub
app/assets/components/bootstrap-markdown/js/bootstrap-markdown.js

Summary

Maintainability
F
1 wk
Test Coverage

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

/* ===================================================
 * bootstrap-markdown.js v1.1.4
 * http://github.com/toopay/bootstrap-markdown
 * ===================================================
 * Copyright 2013 Taufan Aditya
Severity: Major
Found in app/assets/components/bootstrap-markdown/js/bootstrap-markdown.js - About 1 day to fix

    Function showEditor has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      , showEditor: function() {
          var instance = this,
              textarea,
              ns = this.$ns,
              container = this.$element,
    Severity: Major
    Found in app/assets/components/bootstrap-markdown/js/bootstrap-markdown.js - About 3 hrs to fix

      Function __buildButtons has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        , __buildButtons: function(buttonsArray, container) {
            var i,
                ns = this.$ns,
                handler = this.$handler,
                callback = this.$callback
      Severity: Minor
      Found in app/assets/components/bootstrap-markdown/js/bootstrap-markdown.js - About 1 hr to fix

        Function keyup has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          , keyup: function (e) {
              var blocked = false
              switch(e.keyCode) {
                case 40: // down arrow
                case 38: // up arrow
        Severity: Minor
        Found in app/assets/components/bootstrap-markdown/js/bootstrap-markdown.js - About 1 hr to fix

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

            var analyzeMarkdown = function(e) {
              var blurred = false,
                  el,
                  $docEditor = $(e.currentTarget)
          
          
          Severity: Minor
          Found in app/assets/components/bootstrap-markdown/js/bootstrap-markdown.js - About 1 hr to fix

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

                    },{
                      name: 'cmdItalic',
                      title: 'Italic',
                      icon: 'icon icon-italic',
                      callback: function(e){
            app/assets/components/bootstrap-markdown/js/bootstrap-markdown.js on lines 675..704

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

            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

                    data: [{
                      name: 'cmdBold',
                      title: 'Bold',
                      icon: 'icon icon-bold',
                      callback: function(e){
            app/assets/components/bootstrap-markdown/js/bootstrap-markdown.js on lines 704..733

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

            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 ($(this).attr('id') != editor.attr('id')) {
                      var attachedMarkdown
            
                      if (attachedMarkdown = $(this).find('textarea').data('markdown'),
                          attachedMarkdown == null) {
            app/assets/components/bootstrap-markdown/js/bootstrap-markdown.js on lines 957..968

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

            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 ($(this).attr('id') != parentMd.attr('id')) {
                        var attachedMarkdown
            
                        if (attachedMarkdown = $(this).find('textarea').data('markdown'),
                            attachedMarkdown == null) {
            app/assets/components/bootstrap-markdown/js/bootstrap-markdown.js on lines 591..602

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

            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

              , eventSupported: function(eventName) {
                  var isSupported = eventName in this.$element
                  if (!isSupported) {
                    this.$element.setAttribute(eventName, 'return;')
                    isSupported = typeof this.$element[eventName] === 'function'
            app/assets/components/bootstrap-css/js/bootstrap.js on lines 2014..2021

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

            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.$textarea
                    .on('focus',    $.proxy(this.focus, this))
                    .on('keypress', $.proxy(this.keypress, this))
                    .on('keyup',    $.proxy(this.keyup, this))
            app/assets/javascripts/twitter/bootstrap-typeahead.js on lines 191..194

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

            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

              , keydown: function (e) {
                  this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
                  this.keyup(e)
                }
            app/assets/components/bootstrap-css/js/bootstrap.js on lines 2047..2050

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

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

              $.fn.markdown.noConflict = function () {
                $.fn.markdown = old
                return this
              }
            app/assets/components/bootstrap-css/js/bootstrap.js on lines 147..150
            app/assets/components/bootstrap-css/js/bootstrap.js on lines 247..250
            app/assets/components/bootstrap-css/js/bootstrap.js on lines 445..448
            app/assets/components/bootstrap-css/js/bootstrap.js on lines 615..618
            app/assets/components/bootstrap-css/js/bootstrap.js on lines 782..785
            app/assets/components/bootstrap-css/js/bootstrap.js on lines 1021..1024
            app/assets/components/bootstrap-css/js/bootstrap.js on lines 1811..1814
            app/assets/components/bootstrap-css/js/bootstrap.js on lines 2144..2147
            app/assets/javascripts/twitter/bootstrap-dropdown.js on lines 144..147

            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

            There are no issues that match your filters.

            Category
            Status