phodal/diaonan

View on GitHub

Showing 191 of 191 total issues

File jquery-1.8.2.js has 6505 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v1.8.2
 * http://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in app/assets/js/jquery-1.8.2.js - About 2 wks to fix

    Function jsonlint has a Cognitive Complexity of 162 (exceeds 5 allowed). Consider refactoring.
    Open

    var jsonlint = (function(){
    var parser = {trace: function trace() { },
    yy: {},
    symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
    terminals_: {2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},
    Severity: Minor
    Found in app/assets/js/jsonlint.js - About 3 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function jsonlint has 328 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var jsonlint = (function(){
    var parser = {trace: function trace() { },
    yy: {},
    symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
    terminals_: {2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},
    Severity: Major
    Found in app/assets/js/jsonlint.js - About 1 day to fix

      Function ajax has 237 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ajax: function( url, options ) {
      
              // If url is an object, simulate pre-1.5 signature
              if ( typeof url === "object" ) {
                  options = url;
      Severity: Major
      Found in app/assets/js/jquery-1.8.2.js - About 1 day to fix

        Function lexer has 144 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var lexer = (function(){var lexer = ({EOF:1,
        parseError:function parseError(str, hash) {
                if (this.yy.parseError) {
                    this.yy.parseError(str, hash);
                } else {
        Severity: Major
        Found in app/assets/js/jsonlint.js - About 5 hrs to fix

          Function support has 143 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jQuery.support = (function() {
          
              var support,
                  all,
                  a,
          Severity: Major
          Found in app/assets/js/jquery-1.8.2.js - About 5 hrs to fix

            Function parse has 136 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            parse: function parse(input) {
                var self = this,
                    stack = [0],
                    vstack = [null], // semantic value stack
                    lstack = [], // location stack
            Severity: Major
            Found in app/assets/js/jsonlint.js - About 5 hrs to fix

              Function Callbacks has 125 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              jQuery.Callbacks = function( options ) {
              
                  // Convert options from String-formatted to Object-formatted if needed
                  // (we check in cache first)
                  options = typeof options === "string" ?
              Severity: Major
              Found in app/assets/js/jquery-1.8.2.js - About 5 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                            if ( event.pageX == null && original.clientX != null ) {
                                eventDoc = event.target.ownerDocument || document;
                                doc = eventDoc.documentElement;
                                body = eventDoc.body;
                
                
                Severity: Critical
                Found in app/assets/js/jquery-1.8.2.js - About 5 hrs to fix

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

                  module.exports = function (app) {
                      var Data, buildKey;
                      buildKey = function (key) {
                          return "topic:" + key;
                      };
                  Severity: Major
                  Found in app/models/data.js - About 4 hrs to fix

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

                        return hbs.registerHelper('css', function (logicalPath) {
                            var paths, result;
                            paths = find_asset_paths(logicalPath, ".css");
                            if (!paths) {
                                return new hbs.SafeString('<script type="application/javascript">alert(CSS file ' + JSON.stringify(logicalPath).replace(/"/g, '\\"') + ' not found.")</script>');
                    Severity: Major
                    Found in app/helpers/asset_pipeline.js and 1 other location - About 4 hrs to fix
                    app/helpers/asset_pipeline.js on lines 40..50

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

                    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

                        hbs.registerHelper('js', function (logicalPath) {
                            var paths, result;
                            paths = find_asset_paths(logicalPath, ".js");
                            if (!paths) {
                                return new hbs.SafeString('<script type="application/javascript">alert(Javascript file ' + JSON.stringify(logicalPath).replace(/"/g, '\\"') + ' not found.")</script>');
                    Severity: Major
                    Found in app/helpers/asset_pipeline.js and 1 other location - About 4 hrs to fix
                    app/helpers/asset_pipeline.js on lines 51..61

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

                    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 app/assets/js/bootstrap/bootstrap-popover.js and 1 other location - About 4 hrs to fix
                    app/assets/js/bootstrap/bootstrap-affix.js on lines 69..77

                    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.affix = function (option) {
                        return this.each(function () {
                          var $this = $(this)
                            , data = $this.data('affix')
                            , options = typeof option == 'object' && option
                    Severity: Major
                    Found in app/assets/js/bootstrap/bootstrap-affix.js and 1 other location - About 4 hrs to fix
                    app/assets/js/bootstrap/bootstrap-popover.js on lines 84..92

                    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 app/assets/js/bootstrap/bootstrap-collapse.js and 3 other locations - About 4 hrs to fix
                    app/assets/js/bootstrap/bootstrap-scrollspy.js on lines 124..132
                    app/assets/js/bootstrap/bootstrap-tooltip.js on lines 252..260
                    app/assets/js/bootstrap/bootstrap-typeahead.js on lines 267..275

                    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 app/assets/js/bootstrap/bootstrap-scrollspy.js and 3 other locations - About 4 hrs to fix
                    app/assets/js/bootstrap/bootstrap-collapse.js on lines 126..134
                    app/assets/js/bootstrap/bootstrap-tooltip.js on lines 252..260
                    app/assets/js/bootstrap/bootstrap-typeahead.js on lines 267..275

                    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 app/assets/js/bootstrap/bootstrap-tooltip.js and 3 other locations - About 4 hrs to fix
                    app/assets/js/bootstrap/bootstrap-collapse.js on lines 126..134
                    app/assets/js/bootstrap/bootstrap-scrollspy.js on lines 124..132
                    app/assets/js/bootstrap/bootstrap-typeahead.js on lines 267..275

                    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 app/assets/js/bootstrap/bootstrap-typeahead.js and 3 other locations - About 4 hrs to fix
                    app/assets/js/bootstrap/bootstrap-collapse.js on lines 126..134
                    app/assets/js/bootstrap/bootstrap-scrollspy.js on lines 124..132
                    app/assets/js/bootstrap/bootstrap-tooltip.js on lines 252..260

                    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

                    File jsonlint.js has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* Jison generated parser */
                    var jsonlint = (function(){
                    var parser = {trace: function trace() { },
                    yy: {},
                    symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
                    Severity: Minor
                    Found in app/assets/js/jsonlint.js - About 4 hrs to fix

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

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language