NodeRedis/node-redis

View on GitHub
packages/search/lib/commands/AGGREGATE.spec.ts

Summary

Maintainability
F
4 days
Test Coverage

File AGGREGATE.spec.ts has 473 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { AggregateGroupByReducers, AggregateSteps, transformArguments } from './AGGREGATE';
import { SchemaFieldTypes } from '.';

Severity: Minor
Found in packages/search/lib/commands/AGGREGATE.spec.ts - About 7 hrs to fix

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

                    it('RANDOM_SAMPLE', () => {
                        assert.deepEqual(
                            transformArguments('index', '*', {
                                STEPS: [{
                                    type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 1 other location - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 237..251

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

                    it('QUANTILE', () => {
                        assert.deepEqual(
                            transformArguments('index', '*', {
                                STEPS: [{
                                    type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 1 other location - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 343..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 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 9 locations. Consider refactoring.
    Open

                    it('SUM', () => {
                        assert.deepEqual(
                            transformArguments('index', '*', {
                                STEPS: [{
                                    type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 8 other locations - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 132..145
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 147..160
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 177..190
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 192..205
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 207..220
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 222..235
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 253..266
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 269..282

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

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

                    it('MAX', () => {
                        assert.deepEqual(
                            transformArguments('index', '*', {
                                STEPS: [{
                                    type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 8 other locations - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 132..145
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 147..160
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 162..175
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 177..190
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 207..220
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 222..235
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 253..266
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 269..282

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

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

                    it('TO_LIST', () => {
                        assert.deepEqual(
                            transformArguments('index', '*', {
                                STEPS: [{
                                    type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 8 other locations - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 132..145
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 147..160
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 162..175
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 177..190
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 192..205
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 207..220
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 222..235
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 269..282

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

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

                    it('MIN', () => {
                        assert.deepEqual(
                            transformArguments('index', '*', {
                                STEPS: [{
                                    type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 8 other locations - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 132..145
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 147..160
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 162..175
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 192..205
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 207..220
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 222..235
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 253..266
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 269..282

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

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

                    it('COUNT_DISTINCT', () => {
                        assert.deepEqual(
                            transformArguments('index', '*', {
                                STEPS: [{
                                    type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 8 other locations - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 147..160
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 162..175
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 177..190
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 192..205
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 207..220
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 222..235
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 253..266
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 269..282

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

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

                    it('AVG', () => {
                        assert.deepEqual(
                            transformArguments('index', '*', {
                                STEPS: [{
                                    type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 8 other locations - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 132..145
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 147..160
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 162..175
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 177..190
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 192..205
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 222..235
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 253..266
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 269..282

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

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

                    it('STDDEV', () => {
                        assert.deepEqual(
                            transformArguments('index', '*', {
                                STEPS: [{
                                    type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 8 other locations - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 132..145
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 147..160
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 162..175
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 177..190
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 192..205
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 207..220
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 253..266
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 269..282

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

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

                        it('simple', () => {
                            assert.deepEqual(
                                transformArguments('index', '*', {
                                    STEPS: [{
                                        type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 8 other locations - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 132..145
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 147..160
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 162..175
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 177..190
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 192..205
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 207..220
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 222..235
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 253..266

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

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

                    it('COUNT_DISTINCTISH', () => {
                        assert.deepEqual(
                            transformArguments('index', '*', {
                                STEPS: [{
                                    type: AggregateSteps.GROUPBY,
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 8 other locations - About 2 hrs to fix
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 132..145
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 162..175
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 177..190
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 192..205
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 207..220
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 222..235
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 253..266
    packages/search/lib/commands/AGGREGATE.spec.ts on lines 269..282

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

    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

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

            await Promise.all([
                client.ft.create('index', {
                    field: SchemaFieldTypes.NUMERIC
                }),
                client.hSet('1', 'field', '1'),
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 2 other locations - About 1 hr to fix
    packages/search/lib/commands/PROFILE_AGGREGATE.spec.ts on lines 33..39
    packages/search/lib/commands/SEARCH.spec.ts on lines 275..281

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

                        Object.create(null, {
                            sum: {
                                value: '3',
                                configurable: true,
                                enumerable: true
    Severity: Minor
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 1 other location - About 55 mins to fix
    packages/client/lib/commands/generic-transformers.spec.ts on lines 183..194

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

    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('with PARAMS', () => {
                assert.deepEqual(
                    transformArguments('index', '*', {
                        PARAMS: {
                            param: 'value'
    Severity: Major
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 2 other locations - About 50 mins to fix
    packages/search/lib/commands/EXPLAIN.spec.ts on lines 13..22
    packages/search/lib/commands/SEARCH.spec.ts on lines 217..226

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

    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('{ identifier: string }', () => {
                            assert.deepEqual(
                                transformArguments('index', '*', {
                                    LOAD: {
                                        identifier: '@property'
    Severity: Minor
    Found in packages/search/lib/commands/AGGREGATE.spec.ts and 1 other location - About 45 mins to fix
    packages/search/lib/commands/SEARCH.spec.ts on lines 104..113

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

    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