4minitz/4minitz

View on GitHub

Showing 160 of 452 total issues

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

    'blur .addItemForm' (evt, tmpl) {
        if (!tmpl.data.isEditable) {
            throw new Meteor.Error('illegal-state', 'Tried to call an illegal event in read-only mode');
        }

Severity: Minor
Found in client/templates/topic/topicElement.js - About 1 hr to fix

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

    let statisticsDetails = function (minMinutesCount = 2, minTopicsCount = 5) { //eslint-disable-line
        let MS = MeetingSeriesSchema.find();
        let MScount = 0;
        let MinutesCount = 0;
        let TopicCount = 0;
    Severity: Minor
    Found in imports/statistics.js - About 1 hr to fix

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

              'e2e.resetMyApp'(skipUsersCreation) {
                  console.log('-------------------------- E2E-METHOD: resetMyApp ');
                  AttachmentsCollection.remove({});
                  console.log('Count AttachmentsCollection after reset:'+AttachmentsCollection.find().count());
                  // remove the meeting series attachment dir
      Severity: Minor
      Found in server/end2end/end2end-helpers.js - About 1 hr to fix

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

        export function createItem(itemDoc, parentTopic, minutesId, meetingSeries, type = 'infoItem', labels = []) {
            itemDoc.labels = convertOrCreateLabelsFromStrings(labels, meetingSeries);
        
            if (!itemDoc.createdInMinute) {
                itemDoc.createdInMinute = minutesId;
        Severity: Minor
        Found in client/templates/topic/helpers/create-item.js - About 1 hr to fix

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

          let updateCheck = function (forceReport) {
              HTTP.get(url, {}, function (error, result) {
                  if (error || !result.data || !result.data.tag) {
                      // Swallow silently.
                      // If we can't check the version - we will not bother the admin...
          Severity: Minor
          Found in server/updatecheck/slave.js - About 1 hr to fix

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

                static doImport (db, msID, usrMap) {
                    return new Promise((resolve, reject) => {
                        db.collection('meetingSeries')
                            .findOne({_id: msID})
                            .then(doc => {
            Severity: Minor
            Found in imports/server/exportimport/expImpMeetingseries.js - About 1 hr to fix

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

                  static doExport (db, msID, userIDs) {
                      return new Promise((resolve, reject) => {
                          db.collection('minutes')
                              .find({meetingSeries_id: msID})
                              .toArray()
              Severity: Minor
              Found in imports/server/exportimport/expImpMinutes.js - About 1 hr to fix

                Function docMatchesFilterTokens has a Cognitive Complexity of 12 (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/TopicsFilter.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 doExport has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    static doExport (db, msID, userIDsFlat) {
                        return new Promise((resolve, reject) => {
                            userIDsFlat = Object.keys(userIDsFlat);
                            let userIDsOuputMap = {};
                
                
                Severity: Minor
                Found in imports/server/exportimport/expImpUsers.js - About 1 hr to fix

                  Function users.admin.registerUser has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      'users.admin.registerUser'(username, longname, email, password1, password2, sendMail, sendPassword) {
                          console.log('users.admin.registerUser for user: '+username);
                          // #Security: Only logged in admin may invoke this method: users.admin.registerUser
                          if (! Meteor.userId()) {
                              throw new Meteor.Error('Cannot register user', 'User not logged in.');
                  Severity: Minor
                  Found in imports/collections/users_private.js - About 1 hr to fix

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

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

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

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

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

                            'submit #frmDlgAddInfoItem': async function(evt, tmpl) {
                                let saveButton = $('#btnInfoItemSave');
                        
                                try {
                                    saveButton.prop('disabled', true);
                        Severity: Minor
                        Found in client/templates/topic/topicInfoItemEdit.js - About 1 hr to fix

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

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

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

                            let updateTopicSorting = function (event, ui) {
                                const draggedTopicID = $(ui.item).attr('data-id');
                                if (!draggedTopicID) {
                                    return;
                                }
                            Severity: Minor
                            Found in client/templates/minutes/minutesedit.js - About 1 hr to fix

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

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

                                let _insertUsers = function (client, mongoUri, users) {
                                    // unique id from the random package also used by minimongo
                                    // character list: https://github.com/meteor/meteor/blob/release/METEOR%401.4.0.1/packages/random/random.js#L88
                                    // string length: https://github.com/meteor/meteor/blob/release/METEOR%401.4.0.1/packages/random/random.js#L197
                                    const randomStringConfig = {
                                Severity: Minor
                                Found in imports/ldap/saveUsers.js - About 1 hr to fix

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

                                      'minutes.addTopic'(minutesId, doc, insertPlacementTop) {
                                          check(minutesId, String);
                                          console.log(`addTopic to minute: ${minutesId}`);
                                  
                                          // Make sure the user is logged in before changing collections
                                  Severity: Minor
                                  Found in imports/collections/minutes_private.js - About 1 hr to fix

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

                                        'workflow.finalizeMinute'(id, sendActionItems, sendInfoItems) {
                                            console.log('workflow.finalizeMinute on ' + id);
                                            check(id, String);
                                    
                                            let minutes = new Minutes(id);
                                    Severity: Minor
                                    Found in imports/services/finalize-minutes/finalizer.js - About 1 hr to fix

                                      Function docMatchesFilterTokens has 32 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/TopicsFilter.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language