Asymmetrik/mean2-starter

View on GitHub

Showing 101 of 230 total issues

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

module.exports = function() {

    let teamRolesMap = {
        member: { priority: 1 },
        editor: { priority: 5 },
Severity: Major
Found in src/server/app/teams/services/teams.server.service.js - About 1 day to fix

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

    module.exports = function() {
    
        function populateOwnerInfo(search) {
            if (null == search.owner) {
                return q(search);
    Severity: Major
    Found in src/server/app/resources/services/resources.server.service.js - About 5 hrs to fix

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

      module.exports = function() {
      
          let teamRolesMap = {
              member: { priority: 1 },
              editor: { priority: 5 },
      Severity: Minor
      Found in src/server/app/teams/services/teams.server.service.js - About 4 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 a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function() {
      
          function populateOwnerInfo(search) {
              if (null == search.owner) {
                  return q(search);
      Severity: Minor
      Found in src/server/app/resources/services/resources.server.service.js - About 4 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 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function() {
      
          /**
           * Copies the mutable fields from src to dest
           *
      Severity: Major
      Found in src/server/app/teams/services/tags.server.service.js - About 3 hrs to fix

        Function getConsumer has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        KafkaConsumer.prototype.getConsumer = function() {
            let self = this;
        
            // Initialize the deferred promise, if we don't already have one.
            self.deferred = self.deferred || q.defer();
        Severity: Major
        Found in src/server/lib/kafka-consumer.js - About 3 hrs to fix

          Function adminGetCSV has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.adminGetCSV = (req, res) => {
              let exportId = req.params.exportId;
          
              exportConfigService.getConfigById(exportId)
                  .then((result) => {

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

            module.exports = function() {
            
                passport.use(new ProxyPkiStrategy({
                    header: 'x-ssl-client-s-dn'
                }, function(req, dn, done) {
            Severity: Major
            Found in src/server/lib/strategies/proxy-pki.js - About 2 hrs to fix

              Function reset has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports.reset = (req, res, next) => {
              
                  // Init Variables
                  let password = req.body.password;
              
              

                Function forgot has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                exports.forgot = (req, res, next) => {
                
                    // Make sure there is a username
                    if(null == req.body.username) {
                        return res.status(400).json({ message: 'Username is missing.' });

                  File teams.server.service.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  'use strict';
                  
                  let
                      path = require('path'),
                      q = require('q'),
                  Severity: Minor
                  Found in src/server/app/teams/services/teams.server.service.js - About 2 hrs to fix

                    File admin-list-users.component.ts has 262 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { Component, ViewChild } from '@angular/core';
                    import { Response } from '@angular/http';
                    import { ActivatedRoute, Params } from '@angular/router';
                    
                    import * as _ from 'lodash';
                    Severity: Minor
                    Found in src/client/app/admin/user-management/admin-list-users.component.ts - About 2 hrs to fix

                      Function checkAdminAccess has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected checkAdminAccess(url: string, route: ActivatedRouteSnapshot): boolean {
                              if (!this.userStateService.user.isAdmin()) {
                                  // -----------------------------------------------------------
                                  // Check the role requirements for the route
                                  // -----------------------------------------------------------
                      Severity: Minor
                      Found in src/client/app/core/auth-guard.service.ts - About 2 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 searchTeams has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function searchTeams(search, query, queryParams, user) {
                              let page = util.getPage(queryParams);
                              let limit = util.getLimit(queryParams, 1000);
                      
                              let offset = page * limit;
                      Severity: Minor
                      Found in src/server/app/teams/services/teams.server.service.js - About 1 hr to fix

                        Function searchTags has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function searchTags(search, query, queryParams, user) {
                                let page = util.getPage(queryParams);
                                let limit = util.getLimit(queryParams);
                        
                                let offset = page * limit;
                        Severity: Minor
                        Found in src/server/app/teams/services/tags.server.service.js - About 1 hr to fix

                          Function toMongoose has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function toMongoose(obj) {
                              if (null != obj) {
                                  if (typeof obj === 'object') {
                                      if (Array.isArray(obj)) {
                                          var arr = [];
                          Severity: Minor
                          Found in src/server/app/util/services/util.server.service.js - About 1 hr 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 handleErrorResponse has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected handleErrorResponse(err: any, _caught: Observable<any>): Observable<any> {
                                  let errData = _.isString(err._body) ? JSON.parse(err._body) : err._body;
                                  switch (err.status) {
                                      case 401:
                          
                          
                          Severity: Minor
                          Found in src/client/app/shared/asy-http.service.ts - About 1 hr 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 searchResources has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function searchResources(query, queryParams, user) {
                                  let page = util.getPage(queryParams);
                                  let limit = util.getLimit(queryParams, 1000);
                          
                          
                          
                          Severity: Minor
                          Found in src/server/app/resources/services/resources.server.service.js - About 1 hr to fix

                            Function updateCurrentUser has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            exports.updateCurrentUser = (req, res) => {
                            
                                // Make sure the user is logged in
                                if (null == req.user){
                                    res.status(400).json({

                              Function getErrorMessage has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                              Open

                              module.exports.getErrorMessage = function(err) {
                                  var message = '';
                              
                                  if (null == err || typeof err === 'string') {
                                      message = err;
                              Severity: Minor
                              Found in src/server/app/core/controllers/errors.server.controller.js - About 1 hr 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

                              Severity
                              Category
                              Status
                              Source
                              Language