CloudSlang/score

View on GitHub

Showing 3,943 of 3,943 total issues

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

/*
 * Copyright © 2014-2017 EntIT Software LLC, a Micro Focus company (L.P.)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
worker/worker-monitor/score-worker-monitor-impl/src/main/java/io/cloudslang/worker/monitor/metrics/DiskReadUtilizationService.java on lines 1..37

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

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

        for (FinishedBranch fb : finishedBranches) {
            finishedContexts.add(new EndBranchDataContainer(fb.getBranchContexts().getContexts(), fb.getBranchContexts().getSystemContext(), fb.getBranchException()));
            if (fb.getBranchContexts().isBranchCancelled()) {
                wasExecutionCancelled = true;
            }
engine/orchestrator/score-orchestrator-impl/src/main/java/io/cloudslang/orchestrator/services/SplitJoinServiceImpl.java on lines 409..414

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

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

        for (FinishedBranch fb : finishedBranches) {
                finishedContexts.add(new EndBranchDataContainer(fb.getBranchContexts().getContexts(), fb.getBranchContexts().getSystemContext(), fb.getBranchException()));
            if (fb.getBranchContexts().isBranchCancelled()) {
                wasExecutionCancelled = true;
            }
engine/orchestrator/score-orchestrator-impl/src/main/java/io/cloudslang/orchestrator/services/SplitJoinServiceImpl.java on lines 435..440

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

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

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

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

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

Refactorings

Further Reading

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

    public ScoreEvent createFailedBranchEvent(Execution execution) {
        String eventType = EventConstants.SCORE_BRANCH_FAILURE_EVENT;
        Serializable eventData = createBranchFailureEventData(execution);
        SystemContext systemContext = execution.getSystemContext();
        return new ScoreEvent(eventType, systemContext.getLanguageName(), eventData, systemContext.getMetaData());
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 47..52
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 54..59
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 61..67

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

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

    public ScoreEvent createFinishedEvent(Execution execution) {
        String eventType = EventConstants.SCORE_FINISHED_EVENT;
        Serializable eventData = createFinishedEventData(execution);
        SystemContext systemContext = execution.getSystemContext();
        return new ScoreEvent(eventType, systemContext.getLanguageName(), eventData, systemContext.getMetaData());
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 54..59
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 61..67
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 69..74

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

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

    public ScoreEvent createFailureEvent(Execution execution) {
        String eventType = EventConstants.SCORE_FAILURE_EVENT;
        Serializable eventData = createFailureEventData(execution);
        SystemContext systemContext = execution.getSystemContext();
        return new ScoreEvent(eventType, systemContext.getLanguageName(), eventData, systemContext.getMetaData());
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 47..52
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 61..67
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 69..74

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

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

    private Document parseScriptExecutionResult(String scriptExecutionResult)
            throws IOException, ParserConfigurationException, SAXException {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        InputSource is = new InputSource();
runtime-management/runtime-management-impl/src/main/java/io/cloudslang/runtime/impl/python/external/ExternalPythonExecutorCompletableFutureTimeout.java on lines 197..204

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

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

    private Document parseScriptExecutionResult(String scriptExecutionResult)
            throws IOException, ParserConfigurationException, SAXException {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        InputSource is = new InputSource();
runtime-management/runtime-management-impl/src/main/java/io/cloudslang/runtime/impl/python/external/ExternalPythonExecutorScheduledExecutorTimeout.java on lines 221..228

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

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

    final private String QUERY_COUNT_MESSAGES_WITHOUT_ACK_FOR_WORKER_SQL =
            "SELECT COUNT(*)  " +
                    "  FROM  OO_EXECUTION_QUEUES  q  " +
                    "  WHERE " +
                    "      (q.ASSIGNED_WORKER  = ? ) AND " +
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/repositories/ExecutionQueueRepositoryImpl.java on lines 126..138

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

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

    @Override
    public ScoreEvent createFinishedBranchEvent(Execution execution) {
        String eventType = EventConstants.SCORE_FINISHED_BRANCH_EVENT;
        Serializable eventData = createFinishedEventData(execution);
        SystemContext systemContext = execution.getSystemContext();
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 47..52
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 54..59
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/services/ScoreEventFactoryImpl.java on lines 69..74

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

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

    final private String QUERY_COUNT_MESSAGES_WITHOUT_ACK_FOR_WORKER_SQL_MSSQL =
            "SELECT COUNT(*)  " +
                    "  FROM  OO_EXECUTION_QUEUES  q  " +
                    "  WHERE " +
                    "      (q.ASSIGNED_WORKER  = CAST(? AS NVARCHAR(40))) AND " +
engine/queue/score-queue-impl/src/main/java/io/cloudslang/engine/queue/repositories/ExecutionQueueRepositoryImpl.java on lines 112..124

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

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

    public WorkerKeepAliveInfo(String workerRecoveryVersion, boolean active, QueueDetails queueDetails, boolean monitorWorker) {
        this.workerRecoveryVersion = workerRecoveryVersion;
        this.active = active;
        this.queueDetails = queueDetails;
        this.monitorWorker = monitorWorker;
engine/orchestrator/score-orchestrator-impl/src/main/java/io/cloudslang/orchestrator/services/MergedConfigurationServiceImpl.java on lines 127..136
score-api/src/main/java/io/cloudslang/score/events/ScoreEvent.java on lines 44..49

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

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

    public ScoreEvent(String eventType, String languageName, Serializable data, Map<String, ? extends  Serializable> metadata) {
        this.eventType = eventType;
        this.languageName = languageName;
        this.data = data;
        this.metadata = metadata;
engine/node/score-node-api/src/main/java/io/cloudslang/engine/node/entities/WorkerKeepAliveInfo.java on lines 30..35
engine/orchestrator/score-orchestrator-impl/src/main/java/io/cloudslang/orchestrator/services/MergedConfigurationServiceImpl.java on lines 127..136

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

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

        public RefreshMergedConfigurationRunnable(CancelExecutionService cancelExecutionService,
                PauseResumeService pauseResumeService,
                WorkerNodeService workerNodeService,
                AtomicReference<MergedConfigurationHolder> ref) {

engine/node/score-node-api/src/main/java/io/cloudslang/engine/node/entities/WorkerKeepAliveInfo.java on lines 30..35
score-api/src/main/java/io/cloudslang/score/events/ScoreEvent.java on lines 44..49

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

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

Method runPythonEvalProcess has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private PythonEvaluationResult runPythonEvalProcess(String pythonPath, String payload,
            Map<String, Serializable> context, long timeout, ExecutorService executorService) {

    Method getPythonEvaluationResult has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        private PythonEvaluationResult getPythonEvaluationResult(String expression, String prepareEnvironmentScript,
                Map<String, Serializable> context, long evaluationTimeout, ExecutorService executorService) {

      Method splitWithContext has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public void splitWithContext(ExecutionRuntimeServices executionRuntimeServices,
                                       Map<String, Serializable> executionContext,
                                       String flowUuid,
                                       Map<String, Serializable> context,
                                       List<String> inputKeysFromParentContext){

        Method setField has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private void setField(String fieldId, Object fieldValue, Class<?> fieldType, Class<?> currentParameterClass,
                                  Object currentParameter)

          Method createChildExecutionsForMi has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              private List<Execution> createChildExecutionsForMi(Long executionId,
                                                                 List<StartBranchDataContainer> newBranches,
                                                                 String splitUuid,
                                                                 int nrOfAlreadyCreatedBranches,
                                                                 ExecutionStep currStep) {

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

                private void registerExecutionPostconditionService(Element element, ParserContext parserContext) {
                    String registerPostconditionService = element.getAttribute("registerExecutionPostconditionService");
                    if (!FALSE.toString().equals(registerPostconditionService)) {
                        new BeanRegistrator(parserContext)
                                .NAME("executionPostconditionService")
            package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 189..197
            package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 206..214
            package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 216..224
            package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 251..259
            package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 261..269
            package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 271..279
            package/score-worker/src/main/java/io/cloudslang/schema/WorkerBeanDefinitionParser.java on lines 281..289

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

            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