4minitz/4minitz

View on GitHub

Showing 160 of 452 total issues

Function click #btnDelTopic has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    'click #btnDelTopic'(evt) {
        evt.preventDefault();

        if (!this.minutesID) {
            return;
Severity: Minor
Found in client/templates/topic/topicElement.js - About 1 hr to fix

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

        'documentgeneration.createHTML'(minuteID) {
            if (Meteor.isClient) {
                return;
            }
    
    
    Severity: Minor
    Found in imports/collections/documentgeneration_private.js - About 1 hr to fix

      Function submit #frmDlgChangePassword has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          'submit #frmDlgChangePassword'(evt, tmpl) {
              evt.preventDefault();
              if (!Meteor.user()) {
                  return;
              }
      Severity: Minor
      Found in client/templates/globals/passwordChangeDialog.js - About 1 hr to fix

        Function patchUsers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            static patchUsers(minDoc, usrMap) {
                let minIDs = [];
                for (let m = 0; m<minDoc.length; m++) {                 // iterate all minutes
                    minIDs.push(minDoc[m]._id);
                    for (let i=0; minDoc[m].visibleFor&&i<minDoc[m].visibleFor.length; i++) {
        Severity: Minor
        Found in imports/server/exportimport/expImpMinutes.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 attachments.remove has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            'attachments.remove'(attachmentID) {
                if (Meteor.isServer && attachmentID) {
                    if (! this.userId) {
                        console.log('Attachment removal prohibited. User not logged in.');
                        return false;
        Severity: Minor
        Found in imports/collections/attachments_private.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 patchUsers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            static patchUsers(topicDoc, usrMap) {
                // patch topic-responsibles
                for (let i=0; topicDoc.responsibles&&i<topicDoc.responsibles.length; i++) {
                    if (usrMap[topicDoc.responsibles[i]]) {  // may be "free text" user
                        topicDoc.responsibles[i] = usrMap[topicDoc.responsibles[i]];
        Severity: Minor
        Found in imports/server/exportimport/expImpTopics.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 _addLabelToken has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            _addLabelToken(token) {
                let completeLabel;
                if (this.newLabel) {
                    if (null !== this.currentLabel) {
                        this._addCompleteLabelToken();
        Severity: Minor
        Found in imports/search/QueryParser.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 minutes.sendAgenda has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            'minutes.sendAgenda'(id) {
                check(id, String);
                // Make sure the user is logged in before changing collections
                if (!Meteor.userId()) {
                    throw new Meteor.Error('not-authorized');
        Severity: Minor
        Found in imports/collections/minutes_private.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 upsertInfoItem has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            async upsertInfoItem(topicItemDoc, saveChanges, insertPlacementTop = true) {
                if (saveChanges === undefined) {
                    saveChanges = true;
                }
                let i = undefined;
        Severity: Minor
        Found in imports/topic.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 doImport has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            static doImport (db, msID, usrMap) {
                return new Promise((resolve, reject) => {
                    const minFile = msID + ExpImpMinutes.FILENAME_POSTFIX;
                    let minDoc = undefined;
                    try {
        Severity: Minor
        Found in imports/server/exportimport/expImpMinutes.js - About 1 hr to fix

          Function submit #frmDlgEditProfile has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              'submit #frmDlgEditProfile'(evt, tmpl) {
                  evt.preventDefault();
          
                  if (!Meteor.user()) {
                      return;
          Severity: Minor
          Found in client/templates/globals/profileEditDialog.js - About 1 hr to fix

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

            module.exports = function (ldapSettings, userData) {
                ldapSettings.propertyMap = ldapSettings.propertyMap || {};
                const usernameAttribute = ldapSettings.searchDn || ldapSettings.propertyMap.username || 'cn',
                    longnameAttribute = ldapSettings.propertyMap.longname,
                    mailAttribute = ldapSettings.propertyMap.email || 'mail';
            Severity: Minor
            Found in imports/ldap/transformUser.js - About 1 hr to fix

              Function handleDemoUserAccount has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              let handleDemoUserAccount = function () {
                  if (GlobalSettings.createDemoAccount()) {
                      let demoUser = Meteor.users.findOne({$and: [{username: 'demo'}, {isDemoUser: true}]});
                      if (!demoUser) {    // we don't have a demo user, but settings demand one
                          Accounts.createUser({username: 'demo', password: 'demo', email: '', profile: {name: 'Demo User'}});
              Severity: Minor
              Found in server/main.server.js - About 1 hr to fix

                Function meetingseries.update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    'meetingseries.update'(doc) {
                        if (!doc) {
                            console.log('meetingseries.update: no data given');
                            return;
                        }
                Severity: Minor
                Found in imports/collections/meetingseries_private.js - About 1 hr to fix

                  Function meetingseries.insert has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      'meetingseries.insert'(doc, optimisticUICallback) {
                          console.log('meetingseries.insert');
                  
                          // Make sure the user is logged in before changing collections
                          if (!Meteor.userId()) {
                  Severity: Minor
                  Found in imports/collections/meetingseries_private.js - About 1 hr to fix

                    Function resolveEmailAddressesForResponsibles has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        static resolveEmailAddressesForResponsibles(responsibleList) {
                            if (Meteor.isClient || !responsibleList || responsibleList.length === 0) {
                                return [];
                            }
                    
                    
                    Severity: Minor
                    Found in imports/services/responsibleResolver.js - About 1 hr to fix

                      Function click #btnRegisterUserSave has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          'click #btnRegisterUserSave'(evt, tmpl) {
                              if (! Meteor.user().isAdmin) {
                                  return;
                              }
                      
                      
                      Severity: Minor
                      Found in client/templates/admin/adminRegisterUser.js - About 1 hr to fix

                        Function bindValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        LDAP.bindValue = function (usernameOrEmail, isEmailAddress) {
                            if (!LdapSettings.ldapEnabled()) {
                                return '';
                            }
                        
                        
                        Severity: Minor
                        Found in server/ldap.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 workflow.addMinutes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            'workflow.addMinutes'(doc, clientCallback) {
                                checkUserAvailableAndIsModeratorOf(doc.meetingSeries_id);
                        
                                // It is not allowed to insert new minutes if the last minute was not finalized
                                check(doc.meetingSeries_id, String);
                        Severity: Minor
                        Found in imports/collections/workflow_private.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 setVisibleAndInformedUsers has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            setVisibleAndInformedUsers(newVisibleForArray, newInformedUsersArray) {
                                if (!this._id) {
                                    throw new Meteor.Error('MeetingSeries not saved.', 'Call save() before using addVisibleUser()');
                                }
                                if (!$.isArray(newVisibleForArray)) {
                        Severity: Minor
                        Found in imports/meetingseries.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language