Shan1024/sID_system

View on GitHub

Showing 235 of 235 total issues

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

                if (entry) {
                    console.log(chalk.yellow('Entry found'));

                    Claim.findOne({
                        claimid: claimid,
Severity: Major
Found in app/routes/facebookRateRoutes.js and 1 other location - About 1 wk to fix
app/routes/linkedinRateRoutes.js on lines 173..619

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

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 (entry) {
                    console.log(chalk.yellow('Entry found'));

                    Claim.findOne({
                        claimid: claimid,
Severity: Major
Found in app/routes/linkedinRateRoutes.js and 1 other location - About 1 wk to fix
app/routes/facebookRateRoutes.js on lines 428..874

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

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

module.exports = function (app, express) {

    var rateRouter = express.Router();

    //// middleware to use for all requests
Severity: Major
Found in app/routes/facebookRateRoutes.js - About 1 wk to fix

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

    module.exports = function (app, express) {
    
        var rateRouter = express.Router();
    
        //// middleware to use for all requests
    Severity: Major
    Found in app/routes/linkedinRateRoutes.js - About 1 wk to fix

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

                                  if (linkedinRatedByMe) {
                                      console.log(chalk.yellow('LinkedInRatedByMe found'));
      
                                      newEntry.save(function (err) {
      
      
      Severity: Major
      Found in app/routes/linkedinRateRoutes.js and 1 other location - About 1 wk to fix
      app/routes/facebookRateRoutes.js on lines 604..871

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

      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 (facebookRatedByMe) {
                                      console.log(chalk.yellow('FacebookRatedByMe found'));
      
                                      newEntry.save(function (err) {
      
      
      Severity: Major
      Found in app/routes/facebookRateRoutes.js and 1 other location - About 1 wk to fix
      app/routes/linkedinRateRoutes.js on lines 349..616

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

      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 (err) {
                                                      console.log("Error 41518");
                                                      return res.json({success: false, message: "Error occurred"});
                                                  } else {
                                                      //console.log(chalk.blue("User: " + JSON.stringify(user, null, "\t")));
      Severity: Major
      Found in app/routes/linkedinRateRoutes.js and 1 other location - About 1 wk to fix
      app/routes/facebookRateRoutes.js on lines 618..728

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

      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 (err) {
                                                      console.log("User not found: " + err);
                                                      return res.json({success: false, message: "Error occurred"});
                                                  } else {
                                                      //console.log(chalk.blue("User: " + JSON.stringify(user, null, "\t")));
      Severity: Major
      Found in app/routes/facebookRateRoutes.js and 1 other location - About 1 wk to fix
      app/routes/linkedinRateRoutes.js on lines 363..473

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

      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 facebookRateRoutes.js has 2048 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var chalk = require('chalk');
      var mongoose = require('mongoose');
      var defaultValues = require("../../config/defaultValues");
      
      var facebookMisc = require('../../config/facebook.js');
      Severity: Major
      Found in app/routes/facebookRateRoutes.js - About 5 days to fix

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

            var addComment = function (req, res, me, target, myUser, targetUser) {
        
                var myid = req.body.myid;
                var targetid = req.body.targetid;
                var commentid = req.body.commentid;
        Severity: Major
        Found in app/routes/linkedinRateRoutes.js and 1 other location - About 5 days to fix
        app/routes/facebookRateRoutes.js on lines 1142..1272

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

        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 addComment = function (req, res, me, target, myUser, targetUser) {
        
                var myid = req.body.myid;
                var targetid = req.body.targetid;
                var commentid = req.body.commentid;
        Severity: Major
        Found in app/routes/facebookRateRoutes.js and 1 other location - About 5 days to fix
        app/routes/linkedinRateRoutes.js on lines 886..1016

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

        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 linkedinRateRoutes.js has 1897 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var chalk = require('chalk');
        var mongoose = require('mongoose');
        var defaultValues = require("../../config/defaultValues");
        
        var Entry = require("../models/entry");
        Severity: Major
        Found in app/routes/linkedinRateRoutes.js - About 5 days to fix

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

              rateRouter.route('/getRating')
                  .post(function (req, res) {
          
                      var targetid = req.body.targetid;
                      var claimid = req.body.claimid;
          Severity: Major
          Found in app/routes/linkedinRateRoutes.js and 1 other location - About 4 days to fix
          app/routes/facebookRateRoutes.js on lines 1017..1137

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

          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

              rateRouter.route('/getRating')
                  .post(function (req, res) {
          
                      var targetid = req.body.targetid;
                      var claimid = req.body.claimid;
          Severity: Major
          Found in app/routes/facebookRateRoutes.js and 1 other location - About 4 days to fix
          app/routes/linkedinRateRoutes.js on lines 762..882

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

          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

              rateRouter.route('/grantMembership')
                  .post(function (req, res) {
          
                      var userid = req.body.userid;
                      var orgid = req.body.orgid;
          Severity: Major
          Found in app/routes/linkedinRateRoutes.js and 1 other location - About 3 days to fix
          app/routes/facebookRateRoutes.js on lines 1514..1590

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

          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

              rateRouter.route('/grantMembership')
                  .post(function (req, res) {
          
                      var userid = req.body.userid;
                      var orgid = req.body.orgid;
          Severity: Major
          Found in app/routes/facebookRateRoutes.js and 1 other location - About 3 days to fix
          app/routes/linkedinRateRoutes.js on lines 1460..1536

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

          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

              rateRouter.route('/getOverallProfileRating')
                  .post(function (req, res) {
          
                      var targetid = req.body.targetid;
          
          
          Severity: Major
          Found in app/routes/facebookRateRoutes.js and 1 other location - About 3 days to fix
          app/routes/linkedinRateRoutes.js on lines 1715..1798

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

          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

              rateRouter.route('/getOverallProfileRating')
                  .post(function (req, res) {
          
                      var targetid = req.body.targetid;
          
          
          Severity: Major
          Found in app/routes/linkedinRateRoutes.js and 1 other location - About 3 days to fix
          app/routes/facebookRateRoutes.js on lines 2003..2086

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

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

          module.exports = function (app, passport) {
          
          // normal routes ===============================================================
          
              // show the home page (will also have our login links)
          Severity: Major
          Found in app/routes/webRoutes.js - About 3 days to fix

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

                rateRouter.route('/getLastRatedEntries')
                    .post(function (req, res) {
            
                        var targetid = req.body.targetid;
                        var limit = req.body.limit;
            Severity: Major
            Found in app/routes/linkedinRateRoutes.js and 1 other location - About 3 days to fix
            app/routes/facebookRateRoutes.js on lines 2286..2361

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

            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