oaeproject/Hilary

View on GitHub

Showing 432 of 882 total issues

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

OAE.tenantRouter.on('delete', '/api/meeting-jitsi/:meetingId/messages/:created', (request, response) => {
  MeetingsAPI.Meetings.deleteMessage(
    request.ctx,
    request.params.meetingId,
    request.params.created,
Severity: Major
Found in packages/oae-jitsi/lib/rest.js and 2 other locations - About 4 hrs to fix
packages/oae-authentication/lib/strategies/oauth/rest.js on lines 201..214
packages/oae-discussions/lib/rest.js on lines 504..517

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

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

OAE.tenantRouter.on('delete', '/api/folder/library/:principalId/:folderId', (request, response) => {
  FoldersAPI.removeFolderFromLibrary(request.ctx, request.params.principalId, request.params.folderId, (error) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-folders/lib/rest.js and 2 other locations - About 4 hrs to fix
packages/oae-content/lib/rest.js on lines 865..873
packages/oae-folders/lib/rest.js on lines 349..357

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

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

OAE.tenantRouter.on('post', '/api/folder/:folderId/invitations/:email/resend', (request, response) => {
  FoldersAPI.resendFolderInvitation(request.ctx, request.params.folderId, request.params.email, (error) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-folders/lib/rest.js and 2 other locations - About 4 hrs to fix
packages/oae-content/lib/rest.js on lines 865..873
packages/oae-folders/lib/rest.js on lines 408..416

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

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

OAE.tenantRouter.on('post', '/api/content/:contentId/invitations/:email/resend', (request, response) => {
  ContentAPI.resendContentInvitation(request.ctx, request.params.contentId, request.params.email, (error) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-content/lib/rest.js and 2 other locations - About 4 hrs to fix
packages/oae-folders/lib/rest.js on lines 349..357
packages/oae-folders/lib/rest.js on lines 408..416

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

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

OAE.tenantRouter.on('get', '/api/lti/:groupId', (request, response) => {
  LtiApi.getLtiTools(request.ctx, request.params.groupId, (error, results) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-lti/lib/rest.js and 3 other locations - About 4 hrs to fix
packages/oae-content/lib/rest.js on lines 837..845
packages/oae-folders/lib/rest.js on lines 321..329
packages/oae-ui/lib/rest.js on lines 133..141

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

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

OAE.tenantRouter.on('delete', '/api/meeting-jitsi/library/:principalId/:meetingId', (request, response) => {
  MeetingsAPI.Meetings.removeMeetingFromLibrary(
    request.ctx,
    request.params.principalId,
    request.params.meetingId,
Severity: Major
Found in packages/oae-jitsi/lib/rest.js and 1 other location - About 4 hrs to fix
packages/oae-discussions/lib/rest.js on lines 393..406

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

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

OAE.tenantRouter.on('get', '/api/folder/:folderId/invitations', (request, response) => {
  FoldersAPI.getFolderInvitations(request.ctx, request.params.folderId, (error, invitations) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-folders/lib/rest.js and 3 other locations - About 4 hrs to fix
packages/oae-lti/lib/rest.js on lines 103..111
packages/oae-content/lib/rest.js on lines 837..845
packages/oae-ui/lib/rest.js on lines 133..141

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

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

OAE.globalAdminRouter.on('get', '/api/ui/skin/variables', (request, response) => {
  UIAPI.getSkinVariables(request.ctx, request.query.tenant, (error, variables) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-ui/lib/rest.js and 3 other locations - About 4 hrs to fix
packages/oae-lti/lib/rest.js on lines 103..111
packages/oae-content/lib/rest.js on lines 837..845
packages/oae-folders/lib/rest.js on lines 321..329

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

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

OAE.tenantRouter.on('get', '/api/content/:contentId/invitations', (request, response) => {
  ContentAPI.getContentInvitations(request.ctx, request.params.contentId, (error, invitations) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-content/lib/rest.js and 3 other locations - About 4 hrs to fix
packages/oae-lti/lib/rest.js on lines 103..111
packages/oae-folders/lib/rest.js on lines 321..329
packages/oae-ui/lib/rest.js on lines 133..141

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

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

OAE.tenantRouter.on('post', '/api/discussion/:discussionId/invitations/:email/resend', (request, response) => {
  DiscussionsAPI.Discussions.resendDiscussionInvitation(
    request.ctx,
    request.params.discussionId,
    request.params.email,
Severity: Major
Found in packages/oae-discussions/lib/rest.js and 1 other location - About 4 hrs to fix
packages/oae-jitsi/lib/rest.js on lines 424..437

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

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

OAE.tenantRouter.on('delete', '/api/discussion/:discussionId', (request, response) => {
  DiscussionsAPI.Discussions.deleteDiscussion(request.ctx, request.params.discussionId, (error, message) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-discussions/lib/rest.js and 1 other location - About 4 hrs to fix
packages/oae-jitsi/lib/rest.js on lines 96..104

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

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

OAE.tenantRouter.on('get', '/api/meeting-jitsi/:meetingId', (request, response) => {
  MeetingsAPI.Meetings.getFullMeetingProfile(request.ctx, request.params.meetingId, (error, meeting) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-jitsi/lib/rest.js and 1 other location - About 4 hrs to fix
packages/oae-discussions/lib/rest.js on lines 134..142

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

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 _discussionTransformer = function (ctx, activityEntities, callback) {
  const transformedActivityEntities = {};

  _.each(activityEntities, (entities, activityId) => {
    transformedActivityEntities[activityId] = transformedActivityEntities[activityId] || {};
Severity: Major
Found in packages/oae-discussions/lib/activity.js and 1 other location - About 4 hrs to fix
packages/oae-jitsi/lib/activity.js on lines 426..439

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

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 _meetingTransformer = function (ctx, activityEntities, callback) {
  const transformedActivityEntities = {};

  _.each(activityEntities, (entities, activityId) => {
    transformedActivityEntities[activityId] = transformedActivityEntities[activityId] || {};
Severity: Major
Found in packages/oae-jitsi/lib/activity.js and 1 other location - About 4 hrs to fix
packages/oae-discussions/lib/activity.js on lines 412..423

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

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

OAE.globalAdminRouter.on('post', '/api/tenant/start', (request, response) => {
  // Sets the tenant to be ENABLED by passing in 'false'
  TenantsAPI.disableTenants(request.ctx, request.body.aliases, false, (error) => {
    if (error) {
      return response.status(error.code).send(error.msg);
Severity: Major
Found in packages/oae-tenants/lib/rest.js and 1 other location - About 3 hrs to fix
packages/oae-tenants/lib/rest.js on lines 387..396

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

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

OAE.globalAdminRouter.on('post', '/api/tenant/stop', (request, response) => {
  // Sets the tenant to be disabled by passing in 'true'
  TenantsAPI.disableTenants(request.ctx, request.body.aliases, true, (error) => {
    if (error) {
      return response.status(error.code).send(error.msg);
Severity: Major
Found in packages/oae-tenants/lib/rest.js and 1 other location - About 3 hrs to fix
packages/oae-tenants/lib/rest.js on lines 361..370

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

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

OAE.globalAdminRouter.on('get', '/api/auth/signed/tenant', (request, response) => {
  AuthenticationSignedUtil.getSignedTenantAuthenticationRequest(
    request.ctx,
    request.query.tenant,
    (error, requestInfo) => {
Severity: Major
Found in packages/oae-authentication/lib/strategies/signed/rest.js and 3 other locations - About 3 hrs to fix
packages/oae-folders/lib/rest.js on lines 114..122
packages/oae-principals/lib/rest.user.js on lines 65..73
packages/oae-tenants/lib/rest.js on lines 63..71

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

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

OAE.tenantRouter.on('post', '/api/content/:contentId/join', (request, response) => {
  ContentAPI.joinCollabDoc(request.ctx, request.params.contentId, (error, data) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-content/lib/rest.js and 1 other location - About 3 hrs to fix
packages/oae-content/lib/rest.js on lines 339..347

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

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

OAE.tenantRouter.on('get', '/api/content/:contentId', (request, response) => {
  ContentAPI.getFullContentProfile(request.ctx, request.params.contentId, (error, contentProfile) => {
    if (error) {
      return response.status(error.code).send(error.msg);
    }
Severity: Major
Found in packages/oae-content/lib/rest.js and 1 other location - About 3 hrs to fix
packages/oae-content/lib/rest.js on lines 502..510

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

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

  LtiApi.addLtiTool(
    request.ctx,
    request.params.groupId,
    request.body.url,
    request.body.secret,
Severity: Major
Found in packages/oae-lti/lib/rest.js and 1 other location - About 3 hrs to fix
packages/oae-principals/lib/rest.group.js on lines 62..76

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

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

Severity
Category
Status
Source
Language