4minitz/4minitz

View on GitHub

Showing 160 of 452 total issues

Function docMatchesFilterTokens has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    docMatchesFilterTokens(doc, filterTokens) {
        for (let i=0; i < filterTokens.length; i++) {
            let filter = filterTokens[i];

            switch (filter.key) {
Severity: Minor
Found in imports/search/ItemsFilter.js - 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 click .detailText has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    'click .detailText'(evt, tmpl) {
        evt.preventDefault();
        /** @type {TopicInfoItemListContext} */
        const context = tmpl.data;

Severity: Major
Found in client/templates/topic/topicInfoItemList.js - About 2 hrs to fix

    Function getDocumentData has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static getDocumentData(context) {
            let presentParticipants = context._participants.filter(participant => {
                return participant.present;
            });
    
    
    Severity: Major
    Found in imports/documentGeneration.js - About 2 hrs to fix

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

          'click #btnDelInfoItem'(evt, tmpl) {
              /** @type {TopicInfoItemListContext} */
              const context = tmpl.data;
              performActionForItem(evt, tmpl, (item) => {
                  let isDeleteAllowed = item.isDeleteAllowed(context.getSeriesId(item._infoItemDoc._id));
      Severity: Minor
      Found in client/templates/topic/topicInfoItemList.js - About 1 hr to fix

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

            'submit #frmDlgEditMeetingSeries': function(evt, tmpl) {
                evt.preventDefault();
                let saveButton = $('#btnMeetingSeriesSave');
                let cancelButton = $('btnMeetinSeriesEditCancel');
                saveButton.prop('disabled',true);
        Severity: Minor
        Found in client/templates/meetingseries/meetingSeriesEdit.js - About 1 hr to fix

          Function blur .detailInput has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              'blur .detailInput'(evt, tmpl) {
                  evt.preventDefault();
                  /** @type {TopicInfoItemListContext} */
                  const context = tmpl.data;
          
          
          Severity: Minor
          Found in client/templates/topic/topicInfoItemList.js - About 1 hr to fix

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

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

              Function handleDemoUserAccount has a Cognitive Complexity of 14 (exceeds 5 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

              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 blur .detailInput has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  'blur .detailInput'(evt, tmpl) {
                      evt.preventDefault();
                      /** @type {TopicInfoItemListContext} */
                      const context = tmpl.data;
              
              
              Severity: Minor
              Found in client/templates/topic/topicInfoItemList.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 select2search has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function select2search(selectResponsibles, delayTime, freeTextValidator, minuteID, topicOrItem) {
                  let minute = new Minutes(minuteID);
                  let preparer = new ParticipantsPreparer(minute, topicOrItem, Meteor.users, freeTextValidator);
                  let participants = preparer.getPossibleResponsibles();
                  selectResponsibles.select2({
              Severity: Minor
              Found in imports/client/ResponsibleSearch.js - About 1 hr to fix

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

                    onBeforeUpload: function (file) {
                        if (! GlobalSettings.getAttachmentsEnabled()) {
                            return 'Upload not allowed in settings.json';
                        }
                        // Check if this upload candidate is allowed by size and extension
                Severity: Minor
                Found in imports/collections/attachments_private.js - About 1 hr to fix

                  Function onBeforeUpload has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      onBeforeUpload: function (file) {
                          if (! GlobalSettings.getAttachmentsEnabled()) {
                              return 'Upload not allowed in settings.json';
                          }
                          // Check if this upload candidate is allowed by size and extension
                  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 notifyOnRoleChange has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const notifyOnRoleChange = function(usersWithRolesAfterEdit, meetingSeriesId) {
                      function sendEmail (userId, oldRole, newRole, meetingSeriesId) {
                          Meteor.call('meetingseries.sendRoleChange', userId, oldRole, newRole, meetingSeriesId);
                      }
                  
                  
                  Severity: Minor
                  Found in client/templates/meetingseries/meetingSeriesEdit.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 removeIsEditedMinute has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function removeIsEditedMinute(minuteId, ignoreLock) {
                      let minute = new Minutes(minuteId);
                      for (let topic of minute.topics) {
                          if (ignoreLock === true) {
                              topic.isEditedBy = null;
                  Severity: Minor
                  Found in imports/services/isEditedService.js - About 1 hr to fix

                    Function docMatchesFilterTokens has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        docMatchesFilterTokens(doc, filterTokens) {
                            for (let i=0; i < filterTokens.length; i++) {
                                let filter = filterTokens[i];
                    
                                switch (filter.key) {
                    Severity: Minor
                    Found in imports/search/ItemsFilter.js - About 1 hr to fix

                      Function preImportCheck has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          static preImportCheck (db, msID, force=false) {
                              return new Promise((resolve, reject) => {
                                  db.collection('migrations')
                                      .findOne()
                                      .then(doc => {
                      Severity: Minor
                      Found in imports/server/exportimport/expImpSchema.js - About 1 hr to fix

                        Function responsiblesSearch has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            'responsiblesSearch' (partialName, participants) {
                                check(partialName, String);
                                let results_participants = []; // get all the participants for the minute
                                let foundPartipantsNames = [];
                        
                        
                        Severity: Minor
                        Found in imports/collections/minutes_private.js - About 1 hr to fix

                          Function users.editProfile has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              'users.editProfile'(userId, eMail, longName) {
                                  check(eMail, String);
                                  check(longName, String);
                                  if (! Meteor.userId()) {
                                      throw new Meteor.Error('Cannot edit profile', 'User not logged in.');
                          Severity: Minor
                          Found in imports/collections/users_private.js - About 1 hr to fix

                            Function send has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                send() {
                                    let emailFrom = this._moderator.emails;
                                    let modFrom = (emailFrom && emailFrom.length > 0)
                                        ? emailFrom[0].address
                                        : GlobalSettings.getDefaultEmailSenderAddress();
                            Severity: Minor
                            Found in imports/mail/RoleChangeMailHandler.js - About 1 hr to fix

                              Function _fetchLDAPUsers has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              let _fetchLDAPUsers = function (connection) {
                                  let client = connection.client,
                                      settings = connection.settings,
                                      base = settings.serverDn,
                                      searchDn = _.get(settings, 'propertyMap.username', 'cn'),
                              Severity: Minor
                              Found in imports/ldap/getLDAPUsers.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language