Showing 36 of 73 total issues
File markdown.js
has 999 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Released under MIT license
// Copyright (c) 2009-2010 Dominic Baggott
// Copyright (c) 2009-2010 Ash Berlin
// Copyright (c) 2011 Christoph Dorn <christoph@christophdorn.com> (http://www.christophdorn.com)
Function exports
has 475 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
//Connect proxy to route requests to localhost:8181/api
//require('json-proxy').initialize({});
require('load-grunt-tasks')(grunt);
File Gruntfile.js
has 506 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* jshint camelcase:false */
'use strict';
var fs = require('fs'),
express = require('express'),
cmsRouter = require('./routes/cms-router.js'),
Function MD5
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var MD5 = function(string) {
function RotateLeft(lValue, iShiftBits) {
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
}
Function cmsPassport
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var cmsPassport = function(config, app) {
var user = new User();
if (!app) {
Function lists
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lists: (function( ) {
// Use a closure to hide a few variables.
var any_list = "[*+-]|\\d+\\.",
bullet_list = /[*+-]/,
number_list = /\d+\./,
Function exports
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config, app) {
console.log('cms-upload intialized');
Function convert_tree_to_html
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function convert_tree_to_html( tree, references, options ) {
var i;
options = options || {};
// shallow clone
Function init
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function (app) {
var self = this;
io = sio.listen( app );
io.sockets.on( 'connection', function (socket) {
Function MD5
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
var MD5 = function(string) {
function RotateLeft(lValue, iShiftBits) {
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
}
- 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 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config, app){
// define the schema for our user model
this.Schema = {
id: String,
provider: String,
Function cmsAuth
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var cmsAuth = function(config, app) {
console.warn('cms-auth initialized');
//### hashPassword
//Hash password using basic sha1 hash.
Function app
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var app = angular.module('angularCmsApp', ['ngCookies', 'ngResource', 'ngSanitize', 'ngRoute', 'ngAnimate', 'mgcrea.ngStrap', 'fg']).config(function ($routeProvider) {
var routeResolver;
routeResolver = {
delay: function ($q, $timeout) {
var delay;
Function upload
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var upload = function (req, res, next) {
var appid = 'public';
if (req.param( 'appid' )) {
appid = String( req.param( 'appid' ) );
Function exports
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config, app) {
'use strict';
events.EventEmitter.call(this);
console.warn('cms-socket initialized');
File config.js
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
window.Config = {
baseurl: document.location.origin,
sitetitle: 'angular-cms',
sitedesc: 'This is the description',
sitebrand: 'images/angular-cms-brand.png',
Function link
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"[": function link( text ) {
var orig = String(text);
// Inline content is possible inside `link text`
var res = Markdown.DialectHelpers.inline_until_char.call( this, text.substr(1), ']' );
Function registerUser
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var registerUser = function(req, res, next) {
var data = req.body;
//TODO: Need to make this externalized.
if (req.body.username) {
Function exports
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config, app) {
console.warn('cms-proxy', 'initialized', config.proxy);
/**
* @TODO - HTTPS Key and Cert
Function exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config) {
'use strict';
config.set({
// base path, that will be used to resolve files and exclude
basePath: '.',