4minitz/4minitz

View on GitHub

Showing 160 of 452 total issues

File minutesedit.js has 542 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import moment from 'moment/moment';
import { Template } from 'meteor/templating';
import { i18n } from 'meteor/universe:i18n';
import { Blaze } from 'meteor/blaze';
import { Session } from 'meteor/session';
Severity: Major
Found in client/templates/minutes/minutesedit.js - About 1 day to fix

    File topicInfoItemList.js has 537 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Topic } from '/imports/topic';
    import { Meteor } from 'meteor/meteor';
    import { Template } from 'meteor/templating';
    import { Session } from 'meteor/session';
    import { $ } from 'meteor/jquery';
    Severity: Major
    Found in client/templates/topic/topicInfoItemList.js - About 1 day to fix

      Minutes has 35 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export class Minutes {
          constructor(source) {   // constructs obj from Mongo ID or Mongo document
              if (! source)
                  throw new Meteor.Error('invalid-argument', 'Mongo ID or Mongo document required');
      
      
      Severity: Minor
      Found in imports/minutes.js - About 4 hrs to fix

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

        Topic has 34 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class Topic {
        
            /**
             *
             * @param parentElement {string|object} is either the id of the parent minute or parent meeting series
        Severity: Minor
        Found in imports/topic.js - About 4 hrs to fix

          MeetingSeries has 33 functions (exceeds 20 allowed). Consider refactoring.
          Open

          export class MeetingSeries {
              constructor(source) {   // constructs obj from Mongo ID or Mongo document
                  if (! source)
                      return;
          
          
          Severity: Minor
          Found in imports/meetingseries.js - About 4 hrs to fix

            File minutes.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { Meteor } from 'meteor/meteor';
            import { i18n } from 'meteor/universe:i18n';
            import { Random } from 'meteor/random';
            import { MinutesSchema } from './collections/minutes.schema';
            import { MeetingSeries } from './meetingseries';
            Severity: Minor
            Found in imports/minutes.js - About 4 hrs to fix

              File topicElement.js has 309 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { Minutes } from '/imports/minutes';
              import { Meteor } from 'meteor/meteor';
              import { Template } from 'meteor/templating';
              import { Session } from 'meteor/session';
              import { ReactiveVar } from 'meteor/reactive-var';
              Severity: Minor
              Found in client/templates/topic/topicElement.js - About 3 hrs to fix

                `` has 28 functions (exceeds 20 allowed). Consider refactoring.
                Open

                    Meteor.methods({
                        'e2e.debugLog'(message) {
                            console.log(message);
                        },
                        'e2e.resetMyApp'(skipUsersCreation) {
                Severity: Minor
                Found in server/end2end/end2end-helpers.js - About 3 hrs to fix

                  InfoItem has 26 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  export class InfoItem {
                  
                      constructor(parentTopic, source) {
                          if (!parentTopic || !source)
                              throw new Meteor.Error('It is not allowed to create a InfoItem without the parentTopicId and the source');
                  Severity: Minor
                  Found in imports/infoitem.js - About 3 hrs to fix

                    File topicInfoItemEdit.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import moment from 'moment/moment';
                    
                    import { Meteor } from 'meteor/meteor';
                    import { Template } from 'meteor/templating';
                    import { Session } from 'meteor/session';
                    Severity: Minor
                    Found in client/templates/topic/topicInfoItemEdit.js - About 2 hrs to fix

                      Function createTestCases has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          static createTestCases() {
                              // to add tests simply push a new TestCase Object to the testCases property
                      
                              // no topics in minute (F) (A)
                              QualityTestCase.testCases.push(new QualityTestCase('No topics in minute',
                      Severity: Major
                      Found in imports/client/QualityTestRunner.js - About 2 hrs to fix

                        Function show.bs.modal #dlgAddInfoItem has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            'show.bs.modal #dlgAddInfoItem': function (evt, tmpl) {
                                // at this point we clear the view
                                let saveButton = $('#btnInfoItemSave');
                                let cancelButton = $('#btnInfoItemCancel');
                                saveButton.prop('disabled',false);
                        Severity: Minor
                        Found in client/templates/topic/topicInfoItemEdit.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 users.editProfile has a Cognitive Complexity of 18 (exceeds 5 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 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 documentgeneration.createAndStoreFile has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            'documentgeneration.createAndStoreFile'(minutesId) {
                                if (Meteor.isClient) {
                                    return;
                                }
                                if (! Meteor.settings.public.docGeneration.enabled) {
                        Severity: Major
                        Found in imports/collections/documentgeneration_private.js - About 2 hrs to fix

                          Function show.bs.modal #dlgAddInfoItem has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              'show.bs.modal #dlgAddInfoItem': function (evt, tmpl) {
                                  // at this point we clear the view
                                  let saveButton = $('#btnInfoItemSave');
                                  let cancelButton = $('#btnInfoItemCancel');
                                  saveButton.prop('disabled',false);
                          Severity: Major
                          Found in client/templates/topic/topicInfoItemEdit.js - About 2 hrs to fix

                            Function workflow.addMinutes has 55 lines of code (exceeds 25 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: Major
                            Found in imports/collections/workflow_private.js - About 2 hrs to fix

                              File meetingseries.js has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { Meteor } from 'meteor/meteor';
                              import { Random } from 'meteor/random';
                              import { MeetingSeriesSchema } from './collections/meetingseries.schema';
                              import { MinutesFinder } from '/imports/services/minutesFinder';
                              import { Minutes } from './minutes';
                              Severity: Minor
                              Found in imports/meetingseries.js - About 2 hrs to fix

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

                                    static preImportCheck (db, msID) {
                                        return new Promise((resolve, reject) => {
                                            const mapFile = msID + ExpImpUsers.MAPNAME_POSTFIX;
                                            let usrMap = undefined;
                                            try {
                                Severity: Major
                                Found in imports/server/exportimport/expImpUsers.js - About 2 hrs to fix

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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language