Shan1024/sID_system

View on GitHub

Showing 99 of 235 total issues

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

      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

        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

          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

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

            module.exports = function (passport) {
            
                // =========================================================================
                // passport session setup ==================================================
                // =========================================================================
            Severity: Major
            Found in config/passport.js - About 2 days to fix

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

              module.exports = function (app, express) {
              
                  var testRouter = express.Router();
              
                  testRouter.route('/')
              Severity: Major
              Found in app/routes/testRoutes.js - About 2 days to fix

                Function addRating has 396 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var addRating = function (req, res, me, target, myUser, targetUser) {
                
                        var myid = req.body.myid;
                        var targetid = req.body.targetid;
                        var claimid = req.body.claimid;
                Severity: Major
                Found in app/routes/facebookRateRoutes.js - About 1 day to fix

                  Function addRating has 396 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var addRating = function (req, res, me, target, myUser, targetUser) {
                  
                          var myid = req.body.myid;
                          var targetid = req.body.targetid;
                          var claimid = req.body.claimid;
                  Severity: Major
                  Found in app/routes/linkedinRateRoutes.js - About 1 day to fix

                    File webRoutes.js has 772 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    var chalk = require('chalk');
                    var jwt = require('jsonwebtoken');
                    var mongoose = require('mongoose');
                    var rest = require('restler');
                    var http = require('http');
                    Severity: Major
                    Found in app/routes/webRoutes.js - About 1 day to fix

                      File passport.js has 566 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      // load all the things we need
                      var chalk = require('chalk');
                      var LocalStrategy = require('passport-local').Strategy;
                      var FacebookStrategy = require('passport-facebook').Strategy;
                      var LinkedInStrategy = require('passport-linkedin-oauth2').Strategy;
                      Severity: Major
                      Found in config/passport.js - About 1 day to fix

                        File testRoutes.js has 501 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        var chalk = require('chalk');
                        
                        var Entry = require("../models/entry");
                        var Entry = require('../models/claim');
                        var FacebookRatedByMe = require('../models/facebookRatedByMe');
                        Severity: Major
                        Found in app/routes/testRoutes.js - About 1 day to fix

                          Function exports has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                          Open

                          module.exports = function (app, passport) {
                          
                          // normal routes ===============================================================
                          
                              // show the home page (will also have our login links)
                          Severity: Minor
                          Found in app/routes/webRoutes.js - About 7 hrs 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 exports has 184 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function (app, express) {
                          
                              var otherRoutes = express.Router();
                          
                              /**
                          Severity: Major
                          Found in app/routes/otherRoutes.js - About 7 hrs to fix

                            Function sendSuggestions has 134 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                var sendSuggestions = function (req, res) {
                            
                                    var name = req.query.name || req.body.name;
                                    var id = req.query.id || req.body.id;
                            
                            
                            Severity: Major
                            Found in app/routes/webRoutes.js - About 5 hrs to fix

                              Function checkLinkedIn has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  var checkLinkedIn = function (req, res, user, name, facebook, facebookData, linkedinData) {
                              
                                      var facbookUID = null;
                              
                                      if (facebook.uid) {
                              Severity: Major
                              Found in app/routes/webRoutes.js - About 5 hrs to fix

                                Function addComment has 121 lines of code (exceeds 25 allowed). 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 - About 4 hrs to fix

                                  Function addComment has 121 lines of code (exceeds 25 allowed). 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 - About 4 hrs to fix

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

                                        var facebookConnect = function (req, token, refreshToken, profile, done) {
                                    
                                            console.log(chalk.blue("TOKEN: " + JSON.stringify(token, null, "\t")));
                                            //console.log(chalk.blue("TOKEN SECRET: " + JSON.stringify(tokenSecret, null, "\t")));
                                            console.log(chalk.blue("PROFILE: " + JSON.stringify(profile, null, "\t")));
                                    Severity: Major
                                    Found in config/passport.js - About 3 hrs to fix

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

                                      module.exports = function (app, express) {
                                          /*
                                           Here we are configuring our SMTP Server details.
                                           STMP is mail server which is responsible for sending and recieving email.
                                           */
                                      Severity: Major
                                      Found in app/routes/baseRoutes.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language