appsflare/ludicrum-api

View on GitHub

Showing 78 of 78 total issues

Function onPacket has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    SocketNamespace.prototype.onPacket = function (packet) {
      var self = this;

      function ack() {
        self.packet({
Severity: Major
Found in assets/js/socket.io.js - About 2 hrs to fix

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

            devJs: {
                options: {
                    startTag: '<!--SCRIPTS-->',
                    endTag: '<!--SCRIPTS END-->',
                    fileTmpl: '<script src="%s"></script>',
    Severity: Major
    Found in tasks/config/sails-linker.js and 1 other location - About 2 hrs to fix
    tasks/config/sails-linker.js on lines 75..88

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

    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

            devStyles: {
                options: {
                    startTag: '<!--STYLES-->',
                    endTag: '<!--STYLES END-->',
                    fileTmpl: '<link rel="stylesheet" href="%s">',
    Severity: Major
    Found in tasks/config/sails-linker.js and 1 other location - About 2 hrs to fix
    tasks/config/sails-linker.js on lines 17..29

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

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

        Socket.prototype.connect = function (fn) {
          if (this.connecting) {
            return this;
          }
    
    
    Severity: Minor
    Found in assets/js/socket.io.js - About 2 hrs to fix

      Function handshake has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Socket.prototype.handshake = function (fn) {
            var self = this
              , options = this.options;
      
            function complete(data) {
      Severity: Minor
      Found in assets/js/socket.io.js - About 1 hr to fix

        Function encodePacket has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            parser.encodePacket = function (packet) {
              var type = indexOf(packets, packet.type)
                , id = packet.id || ''
                , endpoint = packet.endpoint || ''
                , ack = packet.ack
        Severity: Minor
        Found in assets/js/socket.io.js - About 1 hr to fix

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

              if (like == 1) {
          
                // Creating edge between user and media
                Media.createEdge(req.user.id, targetContentId, {'@class': 'likes'}, function (err, result) {
          
          
          Severity: Major
          Found in api/controllers/EmotionController.js and 1 other location - About 1 hr to fix
          api/controllers/EmotionController.js on lines 26..36

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

          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

              } else {
                // Assume a model named "Post"
                Media.deleteEdges(req.user.id, targetContentId, {'@class': 'likes'}, function (err, result) {
                  if (err) {
                    res.badRequest(err);
          Severity: Major
          Found in api/controllers/EmotionController.js and 1 other location - About 1 hr to fix
          api/controllers/EmotionController.js on lines 13..26

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

          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

              Flag.prototype.emit = function () {
                this.namespace.flags[this.name] = true;
                this.namespace.emit.apply(this.namespace, arguments);
              };
          Severity: Major
          Found in assets/js/socket.io.js and 1 other location - About 1 hr to fix
          assets/js/socket.io.js on lines 2300..2303

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

          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

              Flag.prototype.send = function () {
                this.namespace.flags[this.name] = true;
                this.namespace.send.apply(this.namespace, arguments);
              };
          Severity: Major
          Found in assets/js/socket.io.js and 1 other location - About 1 hr to fix
          assets/js/socket.io.js on lines 2311..2314

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

          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

          module.exports = function(grunt) {
          
              grunt.config.set('cssmin', {
                  dist: {
                      src: ['.tmp/public/concat/production.css'],
          Severity: Major
          Found in tasks/config/cssmin.js and 1 other location - About 1 hr to fix
          tasks/config/uglify.js on lines 12..22

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

          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

          module.exports = function(grunt) {
          
              grunt.config.set('uglify', {
                  dist: {
                      src: ['.tmp/public/concat/production.js'],
          Severity: Major
          Found in tasks/config/uglify.js and 1 other location - About 1 hr to fix
          tasks/config/cssmin.js on lines 11..21

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

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

          module.exports = function(grunt) {
          
          
              // Load the include-all library in order to require all of our grunt
              // configurations and task registrations dynamically.
          Severity: Minor
          Found in Gruntfile.js - About 1 hr to fix

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

                    prodStylesRelative: {
                        options: {
                            startTag: '<!--STYLES-->',
                            endTag: '<!--STYLES END-->',
                            fileTmpl: '<link rel="stylesheet" href="%s">',
            Severity: Major
            Found in tasks/config/sails-linker.js and 1 other location - About 1 hr to fix
            tasks/config/sails-linker.js on lines 60..73

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

                    prodJsRelative: {
                        options: {
                            startTag: '<!--SCRIPTS-->',
                            endTag: '<!--SCRIPTS END-->',
                            fileTmpl: '<script src="%s"></script>',
            Severity: Major
            Found in tasks/config/sails-linker.js and 1 other location - About 1 hr to fix
            tasks/config/sails-linker.js on lines 120..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 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 get has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                XHRPolling.prototype.get = function () {
                  if (!this.isOpen) return;
            
                  var self = this;
            
            
            Severity: Minor
            Found in assets/js/socket.io.js - About 1 hr to fix

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

                  function Socket(options) {
                    this.options = {
                      port: 80
                      , secure: false
                      , document: 'document' in global ? document : false
              Severity: Minor
              Found in assets/js/socket.io.js - About 1 hr to fix

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

                    JSON.parse = function (text, reviver) {
                      // The parse method takes a text and an optional reviver function, and returns
                      // a JavaScript value if the text is a valid JSON text.
                
                      var j;
                Severity: Minor
                Found in assets/js/socket.io.js - About 1 hr to fix

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

                  module.exports = function (req, res, next) {
                  
                    var grantType = req.param('grant_type');
                    if (!grantType) {
                      return res.send(400, 'missing grant_type parameter');
                  Severity: Minor
                  Found in api/policies/isTrustedClient.js - About 1 hr to fix

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

                          function maybeReconnect() {
                            if (!self.reconnecting) {
                              return;
                            }
                    
                    
                    Severity: Minor
                    Found in assets/js/socket.io.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language