jonniespratley/angular-cms

View on GitHub

Showing 36 of 73 total issues

File markdown.js has 999 lines of code (exceeds 250 allowed). Consider refactoring.
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)

Severity: Major
Found in app/libs/markdown.js - About 2 days to fix

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

    module.exports = function(grunt) {
    
        //Connect proxy to route requests to localhost:8181/api
        //require('json-proxy').initialize({});
        require('load-grunt-tasks')(grunt);
    Severity: Major
    Found in Gruntfile.js - About 2 days to fix

      File Gruntfile.js has 506 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* jshint camelcase:false */
      'use strict';
      var fs = require('fs'),
          express = require('express'),
          cmsRouter = require('./routes/cms-router.js'),
      Severity: Major
      Found in Gruntfile.js - About 1 day to fix

        Function MD5 has 195 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var MD5 = function(string) {
        
            function RotateLeft(lValue, iShiftBits) {
                return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
            }
        Severity: Major
        Found in app/libs/md5.js - About 7 hrs to fix

          Function cmsPassport has 178 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var cmsPassport = function(config, app) {
          
              var user = new User();
          
              if (!app) {
          Severity: Major
          Found in routes/cms-passport.js - About 7 hrs to fix

            Function lists has 156 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                lists: (function( ) {
                  // Use a closure to hide a few variables.
                  var any_list = "[*+-]|\\d+\\.",
                      bullet_list = /[*+-]/,
                      number_list = /\d+\./,
            Severity: Major
            Found in app/libs/markdown.js - About 6 hrs to fix

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

              module.exports = function (config, app) {
              
                  console.log('cms-upload intialized');
              
              
              
              Severity: Major
              Found in routes/cms-upload.js - About 4 hrs to fix

                Function convert_tree_to_html has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function convert_tree_to_html( tree, references, options ) {
                  var i;
                  options = options || {};
                
                  // shallow clone
                Severity: Major
                Found in app/libs/markdown.js - About 4 hrs to fix

                  Function init has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      init: function (app) {
                          var self = this;
                  
                          io = sio.listen( app );
                          io.sockets.on( 'connection', function (socket) {
                  Severity: Major
                  Found in routes/socketserver.js - About 3 hrs to fix

                    Function MD5 has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var MD5 = function(string) {
                    
                        function RotateLeft(lValue, iShiftBits) {
                            return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
                        }
                    Severity: Minor
                    Found in app/libs/md5.js - About 3 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 76 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function(config, app){
                        // define the schema for our user model
                        this.Schema = {
                            id: String,
                            provider: String,
                    Severity: Major
                    Found in routes/models/user.js - About 3 hrs to fix

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

                      var cmsAuth = function(config, app) {
                          console.warn('cms-auth initialized');
                      
                          //### hashPassword
                          //Hash password using basic sha1 hash.
                      Severity: Major
                      Found in routes/cms-auth.js - About 2 hrs to fix

                        Function app has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        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;
                        Severity: Major
                        Found in app/scripts/app.js - About 2 hrs to fix

                          Function upload has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var upload = function (req, res, next) {
                                  var appid = 'public';
                          
                                  if (req.param( 'appid' )) {
                                      appid = String( req.param( 'appid' ) );
                          Severity: Major
                          Found in routes/cms-upload.js - About 2 hrs to fix

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

                            module.exports = function (config, app) {
                                'use strict';
                                events.EventEmitter.call(this);
                                console.warn('cms-socket initialized');
                            
                            
                            Severity: Major
                            Found in routes/cms-sockets.js - About 2 hrs to fix

                              File config.js has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              window.Config = {
                                baseurl: document.location.origin,
                                sitetitle: 'angular-cms',
                                sitedesc: 'This is the description',
                                sitebrand: 'images/angular-cms-brand.png',
                              Severity: Minor
                              Found in app/scripts/config.js - About 2 hrs to fix

                                Function link has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                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), ']' );
                                Severity: Minor
                                Found in app/libs/markdown.js - About 2 hrs to fix

                                  Function registerUser has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      var registerUser = function(req, res, next) {
                                          var data = req.body;
                                  
                                          //TODO: Need to make this externalized.
                                          if (req.body.username) {
                                  Severity: Minor
                                  Found in routes/cms-passport.js - About 1 hr to fix

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

                                    module.exports = function(config, app) {
                                        console.warn('cms-proxy', 'initialized', config.proxy);
                                    
                                        /**
                                         * @TODO - HTTPS Key and Cert
                                    Severity: Minor
                                    Found in routes/cms-proxy.js - About 1 hr to fix

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

                                      module.exports = function (config) {
                                          'use strict';
                                          config.set({
                                              // base path, that will be used to resolve files and exclude
                                              basePath: '.',
                                      Severity: Minor
                                      Found in karma.conf.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language