phodal/diaonan

View on GitHub

Showing 191 of 191 total issues

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 app/assets/js/bootstrap/bootstrap-dropdown.js and 1 other location - About 3 hrs to fix
app/assets/js/bootstrap/bootstrap-alert.js on lines 71..78

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

Function exports has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (app) {
    var Data;
    Data = app.models.Data;
    return function (client) {
        var listeners, unsubscribeAll;
Severity: Major
Found in app/controllers/mqtt_api.js - About 3 hrs to fix

    Function setupTopic has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function setupTopic(topic) {
      var url = window.location.protocol + '//' + window.location.hostname;
      if (window.location.port) {
        url += ':' + window.location.port;
      }
    Severity: Major
    Found in app/assets/js/topics.js - About 3 hrs to fix

      Function trigger has 93 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          trigger: function( event, data, elem, onlyHandlers ) {
              // Don't do events on text and comment nodes
              if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
                  return;
              }
      Severity: Major
      Found in app/assets/js/jquery-1.8.2.js - About 3 hrs to fix

        Function send has 90 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        send: function( headers, complete ) {
        
                            // Get a new xhr
                            var handle, i,
                                xhr = s.xhr();
        Severity: Major
        Found in app/assets/js/jquery-1.8.2.js - About 3 hrs to fix

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

          function defaultPrefilter( elem, props, opts ) {
              var index, prop, value, length, dataShow, tween, hooks, oldfire,
                  anim = this,
                  style = elem.style,
                  orig = {},
          Severity: Major
          Found in app/assets/js/jquery-1.8.2.js - About 3 hrs to fix

            Function clean has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                clean: function( elems, context, fragment, scripts ) {
                    var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags,
                        safe = context === document && safeFragment,
                        ret = [];
            
            
            Severity: Major
            Found in app/assets/js/jquery-1.8.2.js - About 3 hrs to fix

              Function exports has 78 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function (app) {
                  var Data;
                  var _      = require("underscore");
              
                  Data = app.models.Data;
              Severity: Major
              Found in app/controllers/coap_api.js - About 3 hrs to fix

                Function Animation has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function Animation( elem, properties, options ) {
                    var result,
                        index = 0,
                        tweenerIndex = 0,
                        length = animationPrefilters.length,
                Severity: Major
                Found in app/assets/js/jquery-1.8.2.js - About 3 hrs to fix

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

                  table: [{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],
                  Severity: Major
                  Found in app/assets/js/jsonlint.js and 1 other location - About 2 hrs to fix
                  app/assets/js/jsonlint.js on lines 44..44

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

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

                      add: function( elem, types, handler, data, selector ) {
                  
                          var elemData, eventHandle, events,
                              t, tns, type, namespaces, handleObj,
                              handleObjIn, handlers, special;
                  Severity: Major
                  Found in app/assets/js/jquery-1.8.2.js - About 2 hrs to fix

                    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 app/assets/js/bootstrap/bootstrap-popover.js and 1 other location - About 2 hrs to fix
                    app/assets/js/bootstrap/bootstrap-tooltip.js on lines 203..212

                    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 app/assets/js/bootstrap/bootstrap-tooltip.js and 1 other location - About 2 hrs to fix
                    app/assets/js/bootstrap/bootstrap-popover.js on lines 56..65

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

                    function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                        var bySet = setMatchers.length > 0,
                            byElement = elementMatchers.length > 0,
                            superMatcher = function( seed, context, xml, results, expandContext ) {
                                var elem, j, matcher,
                    Severity: Major
                    Found in app/assets/js/jquery-1.8.2.js - About 2 hrs to fix

                      Function done has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function done( status, nativeStatusText, responses, headers ) {
                                  var isSuccess, success, error, response, modified,
                                      statusText = nativeStatusText;
                      
                                  // Called once
                      Severity: Major
                      Found in app/assets/js/jquery-1.8.2.js - About 2 hrs to fix

                        Function domManip has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            domManip: function( args, table, callback ) {
                        
                                // Flatten any nested arrays
                                args = [].concat.apply( [], args );
                        
                        
                        Severity: Major
                        Found in app/assets/js/jquery-1.8.2.js - About 2 hrs to fix

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

                              dispatch: function( event ) {
                          
                                  // Make a writable jQuery.Event from the native event object
                                  event = jQuery.event.fix( event || window.event );
                          
                          
                          Severity: Major
                          Found in app/assets/js/jquery-1.8.2.js - About 2 hrs to fix

                            Function superMatcher has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    superMatcher = function( seed, context, xml, results, expandContext ) {
                                        var elem, j, matcher,
                                            setMatched = [],
                                            matchedCount = 0,
                                            i = "0",
                            Severity: Major
                            Found in app/assets/js/jquery-1.8.2.js - About 2 hrs to fix

                              Function Deferred has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  Deferred: function( func ) {
                                      var tuples = [
                                              // action, add listener, listener list, final state
                                              [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
                                              [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
                              Severity: Major
                              Found in app/assets/js/jquery-1.8.2.js - About 2 hrs to fix

                                Function setMatcher has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                                    if ( postFilter && !postFilter[ expando ] ) {
                                        postFilter = setMatcher( postFilter );
                                    }
                                    if ( postFinder && !postFinder[ expando ] ) {
                                Severity: Major
                                Found in app/assets/js/jquery-1.8.2.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language