Asymmetrik/mean2-starter

View on GitHub

Showing 101 of 230 total issues

Function initialize has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public initialize() {
        this.messageService.initialize();

        this.authentication.initializing$
            .subscribe(() => {
Severity: Minor
Found in src/client/app/messages/message-handler.service.ts - About 1 hr to fix

    Function searchTest has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.searchTest = function(req, res) {
        let query = req.body.q || {};
        let search = req.body.s;
    
        if (search) {
    Severity: Minor
    Found in src/server/app/messages/controllers/message.server.controller.js - About 1 hr to fix

      Function filterResourcesByAccess has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function filterResourcesByAccess(ids, user) {
              if (!_.isArray(ids)) {
                  return q([]);
              }
              else {
      Severity: Minor
      Found in src/server/app/resources/services/resources.server.service.js - About 1 hr to fix

        Function updateRole has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            updateRole(member: TeamMember, role: string) {
                // No update required
                if (member.role === role) {
                    return;
                }
        Severity: Minor
        Found in src/client/app/teams/list-team-members.component.ts - About 1 hr to fix

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

          module.exports = function(columns) {
          
              // Create a stream to turn Mongo records into CSV rows
              var stream = through2.obj(function (chunk, enc, callback) {
                  var row = [];
          Severity: Minor
          Found in src/server/app/util/services/csv-stream.server.service.js - About 1 hr to fix

            Function handleErrorResponse has 37 lines of code (exceeds 25 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

              Function searchEuas has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports.searchEuas = (req, res) => {
              
                  // Handle the query/search/page
                  let query = req.body.q;
                  let search = req.body.s;
              Severity: Minor
              Found in src/server/app/admin/controllers/users/eua.server.controller.js - About 1 hr to fix

                Function pagingQuery has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function pagingQuery(schema, find, projection, options, sort, limit, offset, runCount) {
                
                    // Build the query
                    var baseQuery = schema.find(find);
                    var findQuery = schema.find(find, projection, options).sort(sort).skip(offset).limit(limit).maxscan(config.maxScan);
                Severity: Minor
                Found in src/server/app/util/services/query.server.service.js - About 1 hr to fix

                  Function getTimeFilterQueryObject has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private getTimeFilterQueryObject(): any {
                          let timeQuery: any = null;
                  
                          if (this.dateRangeFilter.selected === 'choose') {
                              if (null != this.queryStartDate) {
                  Severity: Minor
                  Found in src/client/app/audit/audit.component.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 searchUsers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function searchUsers(req, res, copyUserFn) {
                  
                      // Handle the query/search/page
                      let query = req.body.q;
                      let search = req.body.s;

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

                    exports.matchEntries = function(req, res) {
                        // Handle the query/search/page
                        var query = req.body.q;
                        var search = req.body.s;
                    
                    

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

                      exports.matchUsers = (req, res) => {
                          // Handle the query/search/page
                          let query = req.body.q;
                          let search = req.body.s;
                      
                      

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

                            public initialize() {
                        
                                // Subscribe to state changes
                                this.notificationStateService.notificationsCleared$
                                    .subscribe((clear) => {
                        Severity: Minor
                        Found in src/client/app/notifications/notification-handler.service.ts - About 1 hr to fix

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

                          module.exports.searchEntries = function(req, res) {
                          
                              // Handle the query/search/page
                              var query = req.body.q;
                              var search = req.body.s;

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

                            exports.search = function(req, res) {
                                // Handle the query/search/page
                                let query = req.body.q;
                                let search = req.body.s;
                            
                            
                            Severity: Minor
                            Found in src/server/app/messages/controllers/message.server.controller.js - About 1 hr to fix

                              Function ngOnInit has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  ngOnInit() {
                                      this.dateRangeOptions = [
                                          { value: -1, display: 'Last 24 Hours' },
                                          { value: -3, display: 'Last 3 Days' },
                                          { value: -7, display: 'Last 7 Days' },
                              Severity: Minor
                              Found in src/client/app/audit/audit.component.ts - About 1 hr to fix

                                Function sendMail has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const sendMail = (mailOptions) => {
                                
                                    return new Promise((resolve, reject) => {
                                        const postData = JSON.stringify(transformMailOptions(mailOptions));
                                        const options = generateOptions();
                                Severity: Minor
                                Found in src/server/app/util/providers/email/https-email.server.provider.js - About 1 hr to fix

                                  Function search has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  exports.search = function(req, res) {
                                      let search = req.body.s || null;
                                      let query = req.body.q || {};
                                      query = util.toMongoose(query);
                                  
                                  
                                  Severity: Minor
                                  Found in src/server/app/audit/controllers/audit.server.controller.js - About 1 hr to fix

                                    Function ngOnInit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        ngOnInit() {
                                            this.alertService.clearAllAlerts();
                                    
                                            this.user = this.authService.getCurrentUser();
                                    
                                    
                                    Severity: Minor
                                    Found in src/client/app/teams/list-team-members.component.ts - About 1 hr to fix

                                      Function adminGetFeedbackCSV has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      exports.adminGetFeedbackCSV = function(req, res) {
                                          let exportFileName;
                                          const exportId = req.params.exportId;
                                      
                                          const dateCallback = (value) => (value) ? new Date(value).toISOString(): '';
                                      Severity: Minor
                                      Found in src/server/app/core/controllers/core.server.controller.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language