mose/rails-i18nterface

View on GitHub

Showing 52 of 52 total issues

File ender.js has 2318 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
  * =============================================================
  * Ender: open module JavaScript framework (https://ender.no.de)
  * Build: ender build jeesh reqwest --output app/assets/javascripts/rails_i18nterface/ender
  * =============================================================
Severity: Major
Found in app/assets/javascripts/rails_i18nterface/ender.js - About 6 days to fix

    Function Event has 119 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          , Event = (function () {
                  // a whitelist of properties (for different event types) tells us what to check for and copy
              var commonProps  = str2arr('altKey attrChange attrName bubbles cancelable ctrlKey currentTarget ' +
                    'detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey '  +
                    'srcElement target timeStamp type view which propertyName')
    Severity: Major
    Found in app/assets/javascripts/rails_i18nterface/ender.js - About 4 hrs to fix

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

                var isAncestor = 'compareDocumentPosition' in root
                      ? function (element, container) {
                          return container.compareDocumentPosition && (container.compareDocumentPosition(element) & 16) === 16
                        }
                      : 'contains' in root
      Severity: Major
      Found in app/assets/javascripts/rails_i18nterface/ender.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/rails_i18nterface/ender.js on lines 1830..1841

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

      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

          var isAncestor = 'compareDocumentPosition' in html ?
            function (element, container) {
              return (container.compareDocumentPosition(element) & 16) == 16
            } : 'contains' in html ?
            function (element, container) {
      Severity: Major
      Found in app/assets/javascripts/rails_i18nterface/ender.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/rails_i18nterface/ender.js on lines 719..731

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

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

          function init(o, fn) {
        
            this.url = typeof o == 'string' ? o : o.url
            this.timeout = null
        
      Severity: Major
      Found in app/assets/javascripts/rails_i18nterface/ender.js - About 3 hrs to fix

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

          (function (name, context, definition) {
            if (typeof module != 'undefined' && module.exports) module.exports = definition()
            else if (typeof context['define'] == 'function' && context['define']['amd']) define(definition)
            else context[name] = definition()
          })('bonzo', this, function() {
        Severity: Major
        Found in app/assets/javascripts/rails_i18nterface/ender.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/rails_i18nterface/ender.js on lines 1547..1908

        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

          (function (name, context, definition) {
            if (typeof module != 'undefined' && module.exports) module.exports = definition()
            else if (typeof context['define'] == 'function' && context['define']['amd']) define(definition)
            else context[name] = definition()
          })('qwery', this, function () {
        Severity: Major
        Found in app/assets/javascripts/rails_i18nterface/ender.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/rails_i18nterface/ender.js on lines 1988..3120

        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

        Function RegEntry has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              , RegEntry = (function () {
                  // each handler is wrapped so we can handle delegation and custom events
                  var wrappedHandler = function (element, fn, condition, args) {
                      var call = function (event, eargs) {
                            return fn.apply(element, args ? slice.call(eargs, event ? 0 : 1).concat(args) : eargs)
        Severity: Major
        Found in app/assets/javascripts/rails_i18nterface/ender.js - About 2 hrs to fix

          Function registry has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                , registry = (function () {
                    // our map stores arrays by event type, just because it's better than storing
                    // everything in a single array.
                    // uses '$' as a prefix for the keys for safety and 'r' as a special prefix for
                    // rootListeners so we can look them up fast
          Severity: Major
          Found in app/assets/javascripts/rails_i18nterface/ender.js - About 2 hrs to fix

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

              $("#namespaces ul li .display").on("click", function(e) {
                e.preventDefault();
                e.stopPropagation();
                filter = $(this).data("id");
                filterThat(filter,true);
            Severity: Major
            Found in app/assets/javascripts/rails_i18nterface/base.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/rails_i18nterface/base.js on lines 55..60

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

            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

              $("#namespaces ul li.item").on("click", function(e) {
                e.preventDefault();
                e.stopPropagation();
                filter = $(this).data("id");
                filterThat(filter,false);
            Severity: Major
            Found in app/assets/javascripts/rails_i18nterface/base.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/rails_i18nterface/base.js on lines 49..54

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

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

                function handleJsonp(o, fn, err, url) {
                  var reqId = uniqid++
                    , cbkey = o.jsonpCallback || 'callback' // the 'callback' key
                    , cbval = o.jsonpCallbackName || reqwest.getcallbackPrefix(reqId)
                    // , cbval = o.jsonpCallbackName || ('reqwest_' + reqId) // the 'callback' value
            Severity: Minor
            Found in app/assets/javascripts/rails_i18nterface/ender.js - About 1 hr to fix

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

                    , on = function(element, events, selector, fn) {
                        var originalFn, type, types, i, args, entry, first
                
                        //TODO: the undefined check means you can't pass an 'args' argument, fix this perhaps?
                        if (selector === undefined && typeof events == 'object') {
              Severity: Minor
              Found in app/assets/javascripts/rails_i18nterface/ender.js - About 1 hr to fix

                Function interpret has 11 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    function interpret(whole, tag, idsAndClasses, wholeAttribute, attribute, qualifier, value, wholePseudo, pseudo, wholePseudoVal, pseudoVal) {
                Severity: Major
                Found in app/assets/javascripts/rails_i18nterface/ender.js - About 1 hr to fix

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

                            Event.prototype.stopPropagation = function () {
                              if (this.originalEvent.stopPropagation) this.originalEvent.stopPropagation()
                              else this.originalEvent.cancelBubble = true
                            }
                  Severity: Major
                  Found in app/assets/javascripts/rails_i18nterface/ender.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/rails_i18nterface/ender.js on lines 855..858

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

                  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

                            Event.prototype.preventDefault = function () {
                              if (this.originalEvent.preventDefault) this.originalEvent.preventDefault()
                              else this.originalEvent.returnValue = false
                            }
                  Severity: Major
                  Found in app/assets/javascripts/rails_i18nterface/ender.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/rails_i18nterface/ender.js on lines 859..862

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

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

                        , css: function (o, opt_v) {
                            var p, iter = o
                            // is this a request for just getting a style?
                            if (opt_v === undefined && typeof o == 'string') {
                              // repurpose 'v'
                  Severity: Minor
                  Found in app/assets/javascripts/rails_i18nterface/ender.js - About 1 hr to fix

                    Function offset has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          , offset: function (opt_x, opt_y) {
                              if (opt_x && typeof opt_x == 'object' && (typeof opt_x.top == 'number' || typeof opt_x.left == 'number')) {
                                return this.each(function (el) {
                                  xy(el, opt_x.left, opt_x.top)
                                })
                    Severity: Minor
                    Found in app/assets/javascripts/rails_i18nterface/ender.js - About 1 hr to fix

                      Function serial has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function serial(el, cb) {
                            var n = el.name
                              , t = el.tagName.toLowerCase()
                              , optCb = function (o) {
                                  // IE gives value="" even where there is no value attribute
                      Severity: Minor
                      Found in app/assets/javascripts/rails_i18nterface/ender.js - About 1 hr to fix

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

                              , dim: function () {
                                  if (!this.length) return { height: 0, width: 0 }
                                  var el = this[0]
                                    , de = el.nodeType == 9 && el.documentElement // document
                                    , orig = !de && !!el.style && !el.offsetWidth && !el.offsetHeight ?
                        Severity: Minor
                        Found in app/assets/javascripts/rails_i18nterface/ender.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language