oaeproject/Hilary

View on GitHub
packages/oae-jitsi/lib/api.meetings.js

Summary

Maintainability
C
1 day
Test Coverage
B
88%

Function createMeeting has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

  ctx,
  displayName,
  description,
  chat,
  contactList,
Severity: Major
Found in packages/oae-jitsi/lib/api.meetings.js - About 1 hr to fix

    Function createMessage has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    const createMessage = function (ctx, meetingId, body, replyToCreatedTimestamp, callback) {
    Severity: Minor
    Found in packages/oae-jitsi/lib/api.meetings.js - About 35 mins to fix

      Function getMessages has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      const getMessages = function (ctx, meetingId, start, limit, callback) {
      Severity: Minor
      Found in packages/oae-jitsi/lib/api.meetings.js - About 35 mins to fix

        Function getMeetingsLibrary has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        const getMeetingsLibrary = function (ctx, principalId, start, limit, callback) {
        Severity: Minor
        Found in packages/oae-jitsi/lib/api.meetings.js - About 35 mins to fix

          Function getMeetingMembers has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          const getMeetingMembers = function (ctx, meetingId, start, limit, callback) {
          Severity: Minor
          Found in packages/oae-jitsi/lib/api.meetings.js - About 35 mins to fix

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

              getMeeting(ctx, meetingId, (error, meeting) => {
                if (error) {
                  return callback(error);
                }
            
            
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 1 day to fix
            packages/oae-discussions/lib/api.discussions.js on lines 1050..1082

            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 210.

            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.
            Invalid

              getMeeting(ctx, meetingId, (error, meeting) => {
                if (error) {
                  return callback(error);
                }
            
            
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 6 hrs to fix
            packages/oae-discussions/lib/api.discussions.js on lines 550..577

            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 165.

            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 3 locations. Consider refactoring.
            Invalid

              try {
                unless(isLoggedInUser, {
                  code: 401,
                  msg: 'Only authenticated users can post on meetings'
                })(ctx);
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 2 other locations - About 5 hrs to fix
            packages/oae-discussions/lib/api.discussions.js on lines 858..883
            packages/oae-folders/lib/api.js on lines 1560..1588

            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 154.

            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.
            Invalid

            const getMeeting = function (ctx, meetingId, callback) {
              try {
                unless(isResourceId, {
                  code: 400,
                  msg: 'A valid resource id must be specified'
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 4 hrs to fix
            packages/oae-discussions/lib/api.discussions.js on lines 426..449

            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 133.

            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.
            Invalid

            const getMeetingInvitations = function (ctx, meetingId, callback) {
              try {
                unless(isResourceId, {
                  code: 400,
                  msg: 'A valid resource id must be specified'
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 3 hrs to fix
            packages/oae-discussions/lib/api.discussions.js on lines 589..606

            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 105.

            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.
            Invalid

              try {
                unless(isLoggedInUser, {
                  code: 401,
                  msg: 'You must be authenticated to remove a meeting from a library'
                })(ctx);
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 3 hrs to fix
            packages/oae-discussions/lib/api.discussions.js on lines 784..801

            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 100.

            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 6 locations. Consider refactoring.
            Invalid

              try {
                unless(isLoggedInUser, {
                  code: 401,
                  msg: 'Only authenticated users can delete messages'
                })(ctx);
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 5 other locations - About 2 hrs to fix
            packages/oae-authentication/lib/strategies/oauth/api.js on lines 80..97
            packages/oae-content/lib/api.js on lines 1462..1479
            packages/oae-discussions/lib/api.discussions.js on lines 949..964
            packages/oae-folders/lib/api.js on lines 1418..1435
            packages/oae-folders/lib/api.js on lines 1648..1665

            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

            const _getMeeting = function (meetingId, callback) {
              MeetingsDAO.getMeeting(meetingId, (error, meeting) => {
                if (error) {
                  return callback(error);
                }
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 2 hrs to fix
            packages/oae-discussions/lib/api.discussions.js on lines 1096..1108

            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 85.

            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.
            Invalid

                    AuthzAPI.updateRoles(meetingId, memberChangeInfo.changes, (error_) => {
                      if (error_) {
                        return callback(error_);
                      }
            
            
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 2 hrs to fix
            packages/oae-jitsi/lib/api.meetings.js on lines 567..586

            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 81.

            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.
            Invalid

                ResourceActions.setRoles(ctx, meeting, changes, (error, memberChangeInfo) => {
                  if (error) {
                    return callback(error);
                  }
            
            
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 2 hrs to fix
            packages/oae-jitsi/lib/api.meetings.js on lines 965..984

            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 81.

            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 15 locations. Consider refactoring.
            Invalid

              try {
                unless(isResourceId, {
                  code: 400,
                  msg: 'Must provide a valid meeting id'
                })(meetingId);
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 14 other locations - About 1 hr to fix
            packages/oae-authentication/lib/strategies/oauth/api.js on lines 39..51
            packages/oae-authentication/lib/strategies/oauth/api.js on lines 179..191
            packages/oae-resource/lib/actions.js on lines 410..422
            packages/oae-content/lib/api.js on lines 2389..2401
            packages/oae-content/lib/api.js on lines 2464..2476
            packages/oae-content/lib/api.js on lines 2733..2745
            packages/oae-discussions/lib/api.discussions.js on lines 1036..1047
            packages/oae-folders/lib/api.js on lines 954..966
            packages/oae-folders/lib/api.js on lines 1731..1743
            packages/oae-following/lib/api.js on lines 187..199
            packages/oae-following/lib/api.js on lines 246..258
            packages/oae-principals/lib/api.group.js on lines 646..658
            packages/oae-principals/lib/api.group.js on lines 702..714
            packages/oae-principals/lib/api.user.js on lines 1327..1339

            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 69.

            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 4 locations. Consider refactoring.
            Open

            export {
              createMeeting,
              getFullMeetingProfile,
              getMeetingInvitations,
              getMeetingMembers,
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 3 other locations - About 1 hr to fix
            packages/oae-search/lib/internal/elasticsearch.js on lines 533..547
            packages/oae-tenants/lib/api.js on lines 1078..1092
            packages/oae-util/lib/mq.js on lines 609..623

            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 67.

            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

                    MeetingsAPI.emitter.emit(MeetingsConstants.events.UPDATED_MEETING, ctx, updatedMeeting, meeting, (errs) => {
                      if (errs) {
                        return callback(_.first(errs));
                      }
            
            
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 1 hr to fix
            packages/oae-jitsi/lib/api.meetings.js on lines 147..153

            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 63.

            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

                MeetingsAPI.emitter.emit(MeetingsConstants.events.CREATED_MEETING, ctx, meeting, memberChangeInfo, (errs) => {
                  if (errs) {
                    return callback(_.first(errs));
                  }
            
            
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 1 hr to fix
            packages/oae-jitsi/lib/api.meetings.js on lines 438..444

            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 63.

            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.
            Invalid

                forEachObjIndexed((role /* , memberId */) => {
                  unless(isIn, {
                    code: 400,
                    msg: 'The role: ' + role + ' is not a valid member role for a meeting'
                  })(role, MeetingsConstants.roles.ALL_PRIORITY);
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 1 other location - About 1 hr to fix
            packages/oae-discussions/lib/api.discussions.js on lines 121..126

            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 60.

            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 14 locations. Consider refactoring.
            Invalid

              try {
                unless(isPrincipalId, {
                  code: 400,
                  msg: 'A user or group id must be provided'
                })(principalId);
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 13 other locations - About 35 mins to fix
            packages/oae-authz/lib/invitations/dao.js on lines 405..412
            packages/oae-jitsi/lib/api.meetings.js on lines 294..301
            packages/oae-principals/lib/internal/dao.js on lines 282..289
            packages/oae-discussions/lib/api.discussions.js on lines 355..362
            packages/oae-discussions/lib/api.discussions.js on lines 466..473
            packages/oae-folders/lib/api.js on lines 1306..1313
            packages/oae-folders/lib/api.js on lines 1489..1496
            packages/oae-following/lib/api.js on lines 56..63
            packages/oae-following/lib/api.js on lines 124..131
            packages/oae-principals/lib/api.group.js on lines 202..209
            packages/oae-principals/lib/api.user.js on lines 795..802
            packages/oae-principals/lib/api.user.js on lines 1049..1056
            packages/oae-util/lib/mq.js on lines 365..372

            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 46.

            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 14 locations. Consider refactoring.
            Invalid

              try {
                unless(isResourceId, {
                  code: 400,
                  msg: 'A valid resource id must be specified'
                })(meetingId);
            Severity: Major
            Found in packages/oae-jitsi/lib/api.meetings.js and 13 other locations - About 35 mins to fix
            packages/oae-authz/lib/invitations/dao.js on lines 405..412
            packages/oae-jitsi/lib/api.meetings.js on lines 852..859
            packages/oae-principals/lib/internal/dao.js on lines 282..289
            packages/oae-discussions/lib/api.discussions.js on lines 355..362
            packages/oae-discussions/lib/api.discussions.js on lines 466..473
            packages/oae-folders/lib/api.js on lines 1306..1313
            packages/oae-folders/lib/api.js on lines 1489..1496
            packages/oae-following/lib/api.js on lines 56..63
            packages/oae-following/lib/api.js on lines 124..131
            packages/oae-principals/lib/api.group.js on lines 202..209
            packages/oae-principals/lib/api.user.js on lines 795..802
            packages/oae-principals/lib/api.user.js on lines 1049..1056
            packages/oae-util/lib/mq.js on lines 365..372

            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 46.

            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

            There are no issues that match your filters.

            Category
            Status