4minitz/4minitz

View on GitHub

Showing 435 of 452 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Template.tabTopics.onCreated(function() {
    this.topicFilterQuery = new ReactiveVar('');
    let myTemplate = Template.instance();
    this.topicFilterHandler = (query) => {
        myTemplate.topicFilterQuery.set(query);
Severity: Major
Found in client/templates/meetingseries/tabTopics.js and 1 other location - About 4 hrs to fix
client/templates/meetingseries/tabItems.js on lines 22..35

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Template.tabItems.onCreated(function() {
    this.topicFilterQuery = new ReactiveVar('');
    let myTemplate = Template.instance();
    this.topicFilterHandler = (query) => {
        myTemplate.topicFilterQuery.set(query);
Severity: Major
Found in client/templates/meetingseries/tabItems.js and 1 other location - About 4 hrs to fix
client/templates/meetingseries/tabTopics.js on lines 22..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        Template.home.events({
            'click .nav-tabs li': function(event, tmpl) {
                let currentTab = $(event.target).closest('li');
        
                tmpl.activeTabId.set(currentTab.attr('id'));
        Severity: Major
        Found in client/templates/home.js and 1 other location - About 3 hrs to fix
        client/templates/meetingseries/meetingSeriesDetails.js on lines 140..148

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 104.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        Template.meetingSeriesDetails.events({
            'click .nav-tabs li': function(event, tmpl) {
                let currentTab = $(event.target).closest('li');
        
                tmpl.activeTabId.set(currentTab.attr('id'));
        Severity: Major
        Found in client/templates/meetingseries/meetingSeriesDetails.js and 1 other location - About 3 hrs to fix
        client/templates/home.js on lines 57..65

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 104.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              function checkUserAvailableAndIsModeratorOf(meetingSeriesId) {
                  // Make sure the user is logged in before changing collections
                  if (!Meteor.userId()) {
                      throw new Meteor.Error('not-authorized', 'You are not authorized to perform this action.');
                  }
              Severity: Major
              Found in imports/services/finalize-minutes/finalizer.js and 1 other location - About 2 hrs to fix
              imports/collections/workflow_private.js on lines 17..28

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 92.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              function checkUserAvailableAndIsModeratorOf(meetingSeriesId) {
                  // Make sure the user is logged in before changing collections
                  if (!Meteor.userId()) {
                      throw new Meteor.Error('not-authorized', 'You are not authorized to perform this action.');
                  }
              Severity: Major
              Found in imports/collections/workflow_private.js and 1 other location - About 2 hrs to fix
              imports/services/finalize-minutes/finalizer.js on lines 20..31

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 92.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  static up() {
                      let demoUser = Meteor.users.findOne({'$and': [
                          {'username': 'demo'},
                          {'isDemoUser': true}
                      ]});
              Severity: Major
              Found in server/migrations/migrate_v14.js and 1 other location - About 2 hrs to fix
              server/migrations/migrate_v14.js on lines 15..23

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 89.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      MinutesSchema.getCollection().find().forEach(minute => {
                          MigrateV7._upgradeTopics(minute.topics);
              
                          // We use getCollection() here to skip .clean & .validate to allow empty string values
                          MinutesSchema.getCollection().update(
              Severity: Major
              Found in server/migrations/migrate_v7.js and 1 other location - About 2 hrs to fix
              server/migrations/migrate_v7.js on lines 72..82

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 89.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  static down() {
                      let demoUser = Meteor.users.findOne({'$and': [
                          {'username': 'demo'},
                          {'isDemoUser': true}
                      ]});
              Severity: Major
              Found in server/migrations/migrate_v14.js and 1 other location - About 2 hrs to fix
              server/migrations/migrate_v14.js on lines 5..13

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 89.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      MinutesSchema.getCollection().find().forEach(minute => {
                          MigrateV7._downgradeTopics(minute.topics);
              
                          // We use getCollection() here to skip .clean & .validate to allow empty string values
                          MinutesSchema.getCollection().update(
              Severity: Major
              Found in server/migrations/migrate_v7.js and 1 other location - About 2 hrs to fix
              server/migrations/migrate_v7.js on lines 36..46

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 89.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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

                  Severity
                  Category
                  Status
                  Source
                  Language