grafana/grafana-polystat-panel

View on GitHub

Showing 96 of 189 total issues

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

const numericalFrameA = toDataFrame({
  fields: [
    { name: 'time', type: FieldType.time, values: [time, time + 1, time + 2] },
    { name: '02', type: FieldType.number, values: [200, 210, 220], config: field },
  ],
Severity: Major
Found in src/__mocks__/models/models.ts and 1 other location - About 2 hrs to fix
src/__mocks__/models/models.ts on lines 66..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 83.

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 casedFrameA = toDataFrame({
  fields: [
    { name: 'time', type: FieldType.time, values: [time, time + 1, time + 2] },
    { name: 'series-a1', type: FieldType.number, values: [200, 210, 220], config: field },
  ],
Severity: Major
Found in src/__mocks__/models/models.ts and 1 other location - About 2 hrs to fix
src/__mocks__/models/models.ts on lines 39..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 83.

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 getOperator = (operatorName: string) => {
    const keys = OperatorOptions.keys();
    for (const aKey of keys) {
      if (OperatorOptions[aKey].value === operatorName) {
        return OperatorOptions[aKey];
Severity: Major
Found in src/components/overrides/OverrideItem.tsx and 1 other location - About 2 hrs to fix
src/components/composites/CompositeItem.tsx on lines 12..21

Duplicated Code

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

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

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

Tuning

This issue has a mass of 81.

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

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

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

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

Refactorings

Further Reading

Function upgradeOldAngularValueMapping has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function upgradeOldAngularValueMapping(old: any, thresholds?: ThresholdsConfig): ValueMapping {
  const valueMaps: ValueMap = { type: MappingType.ValueToText, options: {} };
  const newMappings: ValueMapping[] = [];

  // Use the color we would have picked from thresholds
Severity: Minor
Found in src/data/valueMappingsWrapper/v8/valueMappings.ts - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

const numericalFrameB = toDataFrame({
  fields: [
    { name: 'time', type: FieldType.time, values: [time, time + 1, time + 2] },
    { name: '03', type: FieldType.number, values: [500, 510, 520] },
  ],
Severity: Major
Found in src/__mocks__/models/models.ts and 4 other locations - About 2 hrs to fix
src/__mocks__/models/models.ts on lines 28..33
src/__mocks__/models/models.ts on lines 55..60
src/__mocks__/models/models.ts on lines 74..79
src/__mocks__/models/models.ts on lines 82..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 76.

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

const frameC = toDataFrame({
  fields: [
    { name: 'time', type: FieldType.time, values: [time, time + 1, time + 2] },
    { name: 'C-series01', type: FieldType.number, values: [333, 444, 555] },
  ],
Severity: Major
Found in src/__mocks__/models/models.ts and 4 other locations - About 2 hrs to fix
src/__mocks__/models/models.ts on lines 47..52
src/__mocks__/models/models.ts on lines 55..60
src/__mocks__/models/models.ts on lines 74..79
src/__mocks__/models/models.ts on lines 82..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 76.

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

const numericalFrameC = toDataFrame({
  fields: [
    { name: 'time', type: FieldType.time, values: [time, time + 1, time + 2] },
    { name: '01', type: FieldType.number, values: [333, 444, 555] },
  ],
Severity: Major
Found in src/__mocks__/models/models.ts and 4 other locations - About 2 hrs to fix
src/__mocks__/models/models.ts on lines 28..33
src/__mocks__/models/models.ts on lines 47..52
src/__mocks__/models/models.ts on lines 74..79
src/__mocks__/models/models.ts on lines 82..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 76.

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

const casedFrameC = toDataFrame({
  fields: [
    { name: 'time', type: FieldType.time, values: [time, time + 1, time + 2] },
    { name: 'series-A2', type: FieldType.number, values: [333, 444, 555] },
  ],
Severity: Major
Found in src/__mocks__/models/models.ts and 4 other locations - About 2 hrs to fix
src/__mocks__/models/models.ts on lines 28..33
src/__mocks__/models/models.ts on lines 47..52
src/__mocks__/models/models.ts on lines 55..60
src/__mocks__/models/models.ts on lines 74..79

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

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

const casedFrameB = toDataFrame({
  fields: [
    { name: 'time', type: FieldType.time, values: [time, time + 1, time + 2] },
    { name: 'series-a3', type: FieldType.number, values: [500, 510, 520] },
  ],
Severity: Major
Found in src/__mocks__/models/models.ts and 4 other locations - About 2 hrs to fix
src/__mocks__/models/models.ts on lines 28..33
src/__mocks__/models/models.ts on lines 47..52
src/__mocks__/models/models.ts on lines 55..60
src/__mocks__/models/models.ts on lines 82..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 76.

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

import { getActiveThreshold } from './thresholds';
import { stringToJsRegex } from '@grafana/data';
import {
  MappingType,
  SpecialValueMatch,
Severity: Minor
Found in src/data/valueMappingsWrapper/v8/valueMappings.ts - About 2 hrs to fix

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

    const InlineSVG = ({ src }: { src: string }) => {
      // testId will be the file name without extension (e.g. `public/img/icons/angle-double-down.svg` -> `angle-double-down`)
      const testId = src.replace(SVG_FILE_NAME_REGEX, '$2');
      return <svg xmlns="http://www.w3.org/2000/svg" data-testid={testId} viewBox="0 0 24 24" />;
    };
    Severity: Major
    Found in .config/jest/mocks/react-inlinesvg.tsx and 1 other location - About 2 hrs to fix
    .config/mocks/react-inlinesvg.tsx on lines 19..23

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 75.

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

    const InlineSVG = ({ src }: { src: string }) => {
      // testId will be the file name without extension (e.g. `public/img/icons/angle-double-down.svg` -> `angle-double-down`)
      const testId = src.replace(SVG_FILE_NAME_REGEX, '$2');
      return <svg xmlns="http://www.w3.org/2000/svg" data-testid={testId} viewBox="0 0 24 24" />;
    };
    Severity: Major
    Found in .config/mocks/react-inlinesvg.tsx and 1 other location - About 2 hrs to fix
    .config/jest/mocks/react-inlinesvg.tsx on lines 19..23

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 75.

    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 interface OverrideItemProps {
      override: OverrideItemType;
      ID: string;
      enabled: boolean;
      setter: any;
    Severity: Major
    Found in src/components/overrides/types.ts and 1 other location - About 1 hr to fix
    src/components/composites/types.ts on lines 46..56

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

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

    export const ApplyGlobalRegexPattern = (data: PolystatModel[], regexPattern: string): PolystatModel[] => {
      for (let i = 0; i < data.length; i++) {
        if (regexPattern !== '') {
          const regexVal = stringToJsRegex(regexPattern);
          if (data[i].name && regexVal.test(data[i].name.toString())) {
    Severity: Minor
    Found in src/data/processor.ts - About 1 hr 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

    Function ThresholdsEditor has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    export const ThresholdsEditor: React.FC<Props> = (options) => {
      const [tracker, _setTracker] = useState((): ThresholdItemTracker[] => {
        if (!options.thresholds) {
          return [] as ThresholdItemTracker[];
        }
    Severity: Minor
    Found in src/components/thresholds/ThresholdsEditor.tsx - About 1 hr 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

    Function migrateOverrides has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    export const migrateOverrides = (angular: AngularSavedOverrides) => {
      let options = {} as any;
    
      options.overrideConfig = {
        overrides: [],
    Severity: Minor
    Found in src/migrations.ts - About 1 hr 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

    Function DataFrameToPolystat has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    export const DataFrameToPolystat = (frame: DataFrame, globalOperator: string): PolystatModel[] => {
    
      const valueFields: Field[] = [];
      let newestTimestamp = 0;
    
    
    Severity: Minor
    Found in src/data/processor.ts - About 1 hr 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

    Function CompositeMetricItem has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    export const CompositeMetricItem: React.FC<CompositeMetricItemProps> = (props) => {
      const [metricHints, setMetricHints] = useState<CascaderOption[]>([]);
    
      async function copySelectedMetricToClipboard(index: number) {
        if (props.metric.seriesMatch) {
    Severity: Minor
    Found in src/components/composites/CompositeMetricItem.tsx - About 1 hr 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

    Function getThresholdLevelForValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    function getThresholdLevelForValue(
      thresholds: PolystatThreshold[] | undefined,
      value: number | null,
      defaultColor: string
    ): { thresholdLevel: number; color: string } {
    Severity: Minor
    Found in src/data/threshold_processor.ts - About 1 hr 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 2 locations. Consider refactoring.
    Open

      if (angular.columns) {
        let numColumns = parseInt(angular.columns, 10);
        if (isNaN(numColumns) || numColumns < 1) {
          numColumns = 8;
        }
    Severity: Major
    Found in src/migrations.ts and 1 other location - About 1 hr to fix
    src/migrations.ts on lines 340..346

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

    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