core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts

Summary

Maintainability
F
2 wks
Test Coverage

File contribution-and-review.service.spec.ts has 1261 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2018 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

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

        const translationSuggestions = [
          {
            suggestion_type: 'suggestion',
            suggestion_id: 'id',
            target_type: 'exploration',
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 1258..1379

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

    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

            expect(sortedTranslationSuggestions).toEqual([
              {
                suggestion_type: 'suggestion',
                suggestion_id: 'id',
                target_type: 'exploration',
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 1049..1170

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

    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 statesBackendDict: StateObjectsBackendDict = {
          'First State': {
            classifier_model_id: null,
            content: {
              content_id: 'content',
    core/templates/pages/exploration-player-page/services/checkpoint-celebration-utility.service.spec.ts on lines 66..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 319.

    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 mockStates = {
              Introduction: {
                classifier_model_id: null,
                content: {
                  content_id: 'content',
    core/templates/components/checkpoint-celebration-modal/checkpoint-celebration-modal.component.spec.ts on lines 96..168

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

    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 questionStateData = {
          classifier_model_id: null,
          content: {
            content_id: 'content',
            html: '',
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review-backend-api.service.spec.ts on lines 286..340

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

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

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

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

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

    Refactorings

    Further Reading

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

        it(
          'should call onSuccess function on' +
            'resolving suggestion to exploration correctly',
          fakeAsync(() => {
            spyOn(carbas, 'reviewExplorationSuggestionAsync').and.returnValue(
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 783..810

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

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

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

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

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

    Refactorings

    Further Reading

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

        it(
          'should call onSuccess function on' +
            'resolving suggestion to skill correctly',
          fakeAsync(() => {
            spyOn(carbas, 'reviewSkillSuggestionAsync').and.returnValue(
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 707..734

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 125.

    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

          cars
            .getUserCreatedQuestionSuggestionsAsync(true, 'sort_key')
            .then(response => {
              expect(response.suggestionIdToDetails.suggestion_id_1).toEqual(
                expectedSuggestionDict
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 227..238
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 257..268

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

    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

          cars
            .getUserCreatedQuestionSuggestionsAsync(false, 'sort_key')
            .then(response => {
              expect(response.suggestionIdToDetails.suggestion_id_3).toEqual(
                expectedSuggestion3Dict
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 182..193
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 257..268

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

    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

          cars
            .getUserCreatedQuestionSuggestionsAsync(true, 'sort_key')
            .then(response => {
              expect(response.suggestionIdToDetails.suggestion_id_1).toEqual(
                expectedSuggestionDict
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 182..193
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 227..238

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

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

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

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

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

    Refactorings

    Further Reading

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

        it('should return translation suggestions and opportunity details', () => {
          fetchSuggestionsAsyncSpy.and.returnValue(
            Promise.resolve(backendFetchResponse)
          );
    
    
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 150..164

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

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

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

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

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

    Refactorings

    Further Reading

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

        it('should return available question suggestions and opportunity details', () => {
          fetchSuggestionsAsyncSpy.and.returnValue(
            Promise.resolve(backendFetchResponse)
          );
    
    
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 351..365

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

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

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

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

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

    Refactorings

    Further Reading

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

        beforeEach(() => {
          onSuccess = jasmine.createSpy('onSuccess', (suggestionId: string) => {});
          onFailure = jasmine.createSpy('onFailure', (errorMessage: string) => {});
        });
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 986..989

    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

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

        beforeEach(() => {
          onSuccess = jasmine.createSpy('onSuccess', (suggestionId: string) => {});
          onFailure = jasmine.createSpy('onFailure', (suggestionId: string) => {});
        });
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 702..705

    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

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

                    suggestion: {
                      suggestion_type: 'suggestion',
                      suggestion_id: 'id',
                      target_type: 'exploration',
                      target_id: '1',
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 580..592
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 593..605
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 606..618
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 619..631
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 632..644
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 645..657

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

              {
                suggestion_type: 'suggestion',
                suggestion_id: 'id',
                target_type: 'exploration',
                target_id: '1',
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 580..592
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 593..605
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 619..631
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 632..644
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 645..657
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 665..677

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

              {
                suggestion_type: 'suggestion',
                suggestion_id: 'id',
                target_type: 'exploration',
                target_id: '1',
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 580..592
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 593..605
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 606..618
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 632..644
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 645..657
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 665..677

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

              {
                suggestion_type: 'suggestion',
                suggestion_id: 'id',
                target_type: 'exploration',
                target_id: '1',
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 580..592
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 593..605
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 606..618
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 619..631
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 645..657
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 665..677

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

              {
                suggestion_type: 'suggestion',
                suggestion_id: 'id',
                target_type: 'exploration',
                target_id: '1',
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 593..605
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 606..618
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 619..631
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 632..644
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 645..657
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 665..677

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

              {
                suggestion_type: 'suggestion',
                suggestion_id: 'id',
                target_type: 'exploration',
                target_id: '1',
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 580..592
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 606..618
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 619..631
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 632..644
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 645..657
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 665..677

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

              {
                suggestion_type: 'suggestion',
                suggestion_id: 'id',
                target_type: 'exploration',
                target_id: '1',
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 580..592
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 593..605
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 606..618
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 619..631
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 632..644
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.spec.ts on lines 665..677

    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

        imagesData.forEach(obj => {
          if (obj.imageBlob !== null) {
            requestBody.append(obj.filename, obj.imageBlob);
          }
        });
    core/templates/pages/contributor-dashboard-page/services/contribution-and-review.service.ts on lines 482..486

    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

    There are no issues that match your filters.

    Category
    Status