Asymmetrik/node-rest-starter

View on GitHub

Showing 301 of 301 total issues

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

            it('explicitly pass "member" role', async () => {
                const configGetStub = sandbox.stub(config, 'get');
                configGetStub.withArgs('teams.nestedTeams').returns(true);
                configGetStub.callThrough();

Severity: Major
Found in src/app/core/teams/teams.service.spec.ts and 2 other locations - About 4 hrs to fix
src/app/core/teams/teams.service.spec.ts on lines 1362..1374
src/app/core/teams/teams.service.spec.ts on lines 1400..1412

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

            it('default/all roles', async () => {
                const configGetStub = sandbox.stub(config, 'get');
                configGetStub.withArgs('teams.nestedTeams').returns(true);
                configGetStub.callThrough();

Severity: Major
Found in src/app/core/teams/teams.service.spec.ts and 2 other locations - About 4 hrs to fix
src/app/core/teams/teams.service.spec.ts on lines 1362..1374
src/app/core/teams/teams.service.spec.ts on lines 1414..1426

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

export const updateEua = async (req, res) => {
    // A copy of the original eua for auditing purposes
    const originalEua = req.euaParam.auditCopy();

    const results = await euaService.update(req.euaParam, req.body);
Severity: Major
Found in src/app/core/user/eua/eua.controller.ts and 1 other location - About 4 hrs to fix
src/app/core/messages/message.controller.ts on lines 32..45

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

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

export const update = async (req, res) => {
    // Make a copy of the original message for auditing purposes
    const originalMessage = req.message.auditCopy();

    const updatedMessage = await messageService.update(req.message, req.body);
Severity: Major
Found in src/app/core/messages/message.controller.ts and 1 other location - About 4 hrs to fix
src/app/core/user/eua/eua.controller.ts on lines 74..87

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

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

    describe('updatePreferences', () => {
        it('user is logged in (user attached to request)', async () => {
            const req = {
                body: {},
                user: new User()
Severity: Major
Found in src/app/core/user/user.controller.spec.ts and 1 other location - About 4 hrs to fix
src/app/core/user/user.controller.spec.ts on lines 195..211

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

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

    describe('updateRequiredOrgs', () => {
        it('user is logged in (user attached to request)', async () => {
            const req = {
                body: {},
                user: new User()
Severity: Major
Found in src/app/core/user/user.controller.spec.ts and 1 other location - About 4 hrs to fix
src/app/core/user/user.controller.spec.ts on lines 177..193

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

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

            it('should not match when team does not have requiresExternalTeams', () => {
                const _user = new User({ externalGroups: ['one', 'two', 'three'] });
                let _team = new Team({});
                let match = teamsService.isImplicitMember(_user, _team);
                match.should.equal(false);
Severity: Major
Found in src/app/core/teams/teams.service.spec.ts and 1 other location - About 4 hrs to fix
src/app/core/teams/teams.service.spec.ts on lines 824..833

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

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

            it('should not match when team does not have requiresExternalRoles', () => {
                const _user = new User({ externalRoles: ['one', 'two', 'three'] });
                let _team = new Team({});
                let match = teamsService.isImplicitMember(_user, _team);
                match.should.equal(false);
Severity: Major
Found in src/app/core/teams/teams.service.spec.ts and 1 other location - About 4 hrs to fix
src/app/core/teams/teams.service.spec.ts on lines 868..877

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

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 updateMemberFilter has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    updateMemberFilter(query: FilterQuery<UserDocument>, team: TeamDocument) {
        // Extract member types and roles for filtering
        const types = query.$and?.find((filter) => filter.type)?.type.$in ?? [];
        const roles: TeamRoles[] =
            query.$and?.find((filter) => filter.role)?.role.$in ?? [];
Severity: Minor
Found in src/app/core/teams/teams.service.ts - 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

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

    describe('searchFeedback', () => {
        it('search returns feedback', async () => {
            const req = { body: {} };

            sandbox.stub(feedbackService, 'search').resolves();
Severity: Major
Found in src/app/core/feedback/feedback.controller.spec.ts and 2 other locations - About 4 hrs to fix
src/app/core/teams/teams.controller.spec.ts on lines 102..117
src/app/core/user/eua/eua.controller.spec.ts on lines 29..44

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

    describe('searchEuas', () => {
        it('search returns euas', async () => {
            const req = {
                body: {}
            };
Severity: Major
Found in src/app/core/user/eua/eua.controller.spec.ts and 2 other locations - About 4 hrs to fix
src/app/core/feedback/feedback.controller.spec.ts on lines 48..60
src/app/core/teams/teams.controller.spec.ts on lines 102..117

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

    describe('search', () => {
        it('search returns teams', async () => {
            const req = {
                body: {}
            };
Severity: Major
Found in src/app/core/teams/teams.controller.spec.ts and 2 other locations - About 4 hrs to fix
src/app/core/feedback/feedback.controller.spec.ts on lines 48..60
src/app/core/user/eua/eua.controller.spec.ts on lines 29..44

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

        it('should return only team ids where user is a member', async () => {
            const teamIds = await teamsService.getExplicitTeamIds(
                _user,
                TeamRoles.Member
            );
Severity: Major
Found in src/app/core/teams/teams.service.spec.ts and 1 other location - About 4 hrs to fix
src/app/core/teams/teams.service.spec.ts on lines 1610..1621

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

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

        it('should return only team ids where user is an editor', async () => {
            const teamIds = await teamsService.getExplicitTeamIds(
                _user,
                TeamRoles.Editor
            );
Severity: Major
Found in src/app/core/teams/teams.service.spec.ts and 1 other location - About 4 hrs to fix
src/app/core/teams/teams.service.spec.ts on lines 1597..1608

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

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

        beforeEach(async () => {
            const euas = [...Array(100).keys()].map((index) => {
                return new UserAgreement({
                    title: `Title-${index}`,
                    text: `Text-${index}`
Severity: Major
Found in src/app/core/user/eua/eua.service.spec.ts and 1 other location - About 4 hrs to fix
src/app/core/teams/teams.service.spec.ts on lines 453..462

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

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

        beforeEach(async () => {
            const teams = [...Array(94).keys()].map((index) => {
                return new Team({
                    name: `Name-${index}`,
                    description: `Description-${index}`
Severity: Major
Found in src/app/core/teams/teams.service.spec.ts and 1 other location - About 4 hrs to fix
src/app/core/user/eua/eua.service.spec.ts on lines 126..135

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

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 user.model.ts has 334 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import crypto, { BinaryLike } from 'crypto';

import _ from 'lodash';
import mongoose, {
    HydratedDocument,
Severity: Minor
Found in src/app/core/user/user.model.ts - About 4 hrs to fix

    TeamsService has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class TeamsService {
        constructor(
            private model: TeamModel,
            private userModel: UserModel
        ) {}
    Severity: Minor
    Found in src/app/core/teams/teams.service.ts - About 4 hrs to fix

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

              if (strategy === 'roles' && (user.externalRoles?.length ?? 0) > 0) {
                  query.$and.push(
                      {
                          requiresExternalRoles: { $exists: true }
                      },
      Severity: Major
      Found in src/app/core/teams/teams.service.ts and 1 other location - About 3 hrs to fix
      src/app/core/teams/teams.service.ts on lines 735..752

      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

              if (strategy === 'teams' && (user.externalGroups?.length ?? 0) > 0) {
                  query.$and.push(
                      {
                          requiresExternalTeams: { $exists: true }
                      },
      Severity: Major
      Found in src/app/core/teams/teams.service.ts and 1 other location - About 3 hrs to fix
      src/app/core/teams/teams.service.ts on lines 717..734

      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

      Severity
      Category
      Status
      Source
      Language