Showing 99 of 235 total issues
Function exports
has 2035 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (app, express) {
var rateRouter = express.Router();
//// middleware to use for all requests
Function exports
has 1886 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (app, express) {
var rateRouter = express.Router();
//// middleware to use for all requests
File facebookRateRoutes.js
has 2048 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var chalk = require('chalk');
var mongoose = require('mongoose');
var defaultValues = require("../../config/defaultValues");
var facebookMisc = require('../../config/facebook.js');
File linkedinRateRoutes.js
has 1897 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var chalk = require('chalk');
var mongoose = require('mongoose');
var defaultValues = require("../../config/defaultValues");
var Entry = require("../models/entry");
Function exports
has 748 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (app, passport) {
// normal routes ===============================================================
// show the home page (will also have our login links)
Function exports
has 552 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (passport) {
// =========================================================================
// passport session setup ==================================================
// =========================================================================
Function exports
has 492 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (app, express) {
var testRouter = express.Router();
testRouter.route('/')
Function addRating
has 396 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function addRating
has 396 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
File webRoutes.js
has 772 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var chalk = require('chalk');
var jwt = require('jsonwebtoken');
var mongoose = require('mongoose');
var rest = require('restler');
var http = require('http');
File passport.js
has 566 lines of code (exceeds 250 allowed). Consider refactoring. Open
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;
File testRoutes.js
has 501 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var chalk = require('chalk');
var Entry = require("../models/entry");
var Entry = require('../models/claim');
var FacebookRatedByMe = require('../models/facebookRatedByMe');
Function exports
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (app, passport) {
// normal routes ===============================================================
// show the home page (will also have our login links)
- Read upRead up
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
Open
module.exports = function (app, express) {
var otherRoutes = express.Router();
/**
Function sendSuggestions
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var sendSuggestions = function (req, res) {
var name = req.query.name || req.body.name;
var id = req.query.id || req.body.id;
Function checkLinkedIn
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var checkLinkedIn = function (req, res, user, name, facebook, facebookData, linkedinData) {
var facbookUID = null;
if (facebook.uid) {
Function addComment
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function addComment
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function facebookConnect
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
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")));
Function exports
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
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.
*/