Showing 7,178 of 10,782 total issues

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

interface SkillMisconceptionNameChange {
  cmd: 'update_skill_misconceptions_property';
  property_name: 'name';
  new_value: string;
  old_value: string;
Severity: Major
Found in core/templates/domain/editor/undo_redo/change.model.ts and 6 other locations - About 30 mins to fix
core/templates/domain/editor/undo_redo/change.model.ts on lines 147..153
core/templates/domain/editor/undo_redo/change.model.ts on lines 155..161
core/templates/domain/editor/undo_redo/change.model.ts on lines 540..546
core/templates/domain/editor/undo_redo/change.model.ts on lines 548..554
core/templates/domain/editor/undo_redo/change.model.ts on lines 556..562
core/templates/domain/editor/undo_redo/change.model.ts on lines 564..570

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

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

  toBackendDict(): SkillDifficultyBackendDict {
    return {
      id: this._id,
      description: this._description,
      difficulty: this._difficulty,
Severity: Major
Found in core/templates/domain/skill/skill-difficulty.model.ts and 5 other locations - About 30 mins to fix
core/templates/domain/exploration/ParamChangeObjectFactory.ts on lines 66..72
core/templates/domain/exploration/TranslatedContentObjectFactory.ts on lines 76..82
core/templates/domain/exploration/WrittenTranslationObjectFactory.ts on lines 97..103
core/templates/domain/state/state-version-history.model.ts on lines 65..71
core/templates/domain/statistics/learner-action.model.ts on lines 64..70

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

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

    spyOn(csrfService, 'getTokenAsync').and.callFake(async () => {
      return new Promise(resolve => {
        resolve('sample-csrf-token');
      });
    });
core/templates/domain/collection/collection-rights-backend-api.service.spec.ts on lines 49..53
core/templates/domain/learner_dashboard/learner-dashboard-activity-backend-api.service.spec.ts on lines 69..73
core/templates/pages/email-dashboard-pages/email-dashboard-data.service.spec.ts on lines 56..60
core/templates/pages/exploration-editor-page/services/autosave-info-modals.service.spec.ts on lines 65..69
core/templates/pages/exploration-editor-page/services/user-email-preferences.service.spec.ts on lines 55..59

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

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

    if (!(typeof language === 'string')) {
      warningsList.push({
        type: AppConstants.WARNING_TYPES.ERROR,
        message: 'Programming language name must be a string.',
      });
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 58..63
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 66..71
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 74..79
extensions/interactions/PencilCodeEditor/directives/pencil-code-editor-validation.service.ts on lines 50..55

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

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

  navigateToImprovementsTab(): void {
    this._savePendingChanges();
    this._changeTab(this.TABS.IMPROVEMENTS.path);
  }
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 303..306
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 313..316
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 318..321
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 323..326

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

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

  it('should throw error on setting invalid content id', () => {
    expect(() => {
      ttacis.setActiveContent('feedback_2', 'html');
    }).toThrowError('Invalid active content id: feedback_2');
  });
core/templates/domain/story/story-contents-object.model.spec.ts on lines 319..323
core/templates/domain/story/story-contents-object.model.spec.ts on lines 410..414
core/templates/domain/topic/topic-object.model.spec.ts on lines 672..676
core/templates/domain/topic/topic-object.model.spec.ts on lines 678..682

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

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

    spyOn(
      blogHomePageBackendApiService,
      'fetchBlogPostPageDataAsync'
    ).and.returnValue(
      Promise.reject({
core/templates/pages/blog-author-profile-page/blog-author-profile-page.component.spec.ts on lines 316..324
core/templates/pages/blog-author-profile-page/blog-author-profile-page.component.spec.ts on lines 345..353
core/templates/pages/blog-home-page/blog-home-page.component.spec.ts on lines 757..765
core/templates/pages/blog-home-page/blog-home-page.component.spec.ts on lines 785..793

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

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

  navigateToFeedbackTab(): void {
    this._savePendingChanges();
    this._changeTab(this.TABS.FEEDBACK.path);
  }
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 303..306
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 308..311
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 313..316
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 318..321

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

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

    spyOn(
      blogHomePageBackendApiService,
      'fetchBlogAuthorProfilePageDataAsync'
    ).and.returnValue(
      Promise.reject({
core/templates/pages/blog-author-profile-page/blog-author-profile-page.component.spec.ts on lines 345..353
core/templates/pages/blog-home-page/blog-home-page.component.spec.ts on lines 757..765
core/templates/pages/blog-home-page/blog-home-page.component.spec.ts on lines 785..793
core/templates/pages/blog-post-page/blog-post-page-root.component.spec.ts on lines 261..269

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

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

    if (!(typeof postCode === 'string')) {
      warningsList.push({
        type: AppConstants.WARNING_TYPES.ERROR,
        message: 'The post-code text must be a string.',
      });
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 50..55
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 58..63
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 66..71
extensions/interactions/PencilCodeEditor/directives/pencil-code-editor-validation.service.ts on lines 50..55

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

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

  navigateToStatsTab(): void {
    this._savePendingChanges();
    this._changeTab(this.TABS.STATS.path);
  }
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 308..311
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 313..316
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 318..321
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 323..326

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

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

    if (!(typeof placeholder === 'string')) {
      warningsList.push({
        type: AppConstants.WARNING_TYPES.ERROR,
        message: 'Placeholder text must be a string.',
      });
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 50..55
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 66..71
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 74..79
extensions/interactions/PencilCodeEditor/directives/pencil-code-editor-validation.service.ts on lines 50..55

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

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

  it('should warn user if skill is present in a subtopic', () => {
    expect(() => {
      _sampleTopic.addUncategorizedSkill('skill_3', 'Description 3');
    }).toThrowError('Given skillId is already present in a subtopic.');
  });
Severity: Major
Found in core/templates/domain/topic/topic-object.model.spec.ts and 4 other locations - About 30 mins to fix
core/templates/domain/story/story-contents-object.model.spec.ts on lines 319..323
core/templates/domain/story/story-contents-object.model.spec.ts on lines 410..414
core/templates/domain/topic/topic-object.model.spec.ts on lines 678..682
core/templates/pages/exploration-editor-page/translation-tab/services/translation-tab-active-content-id.service.spec.ts on lines 52..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 45.

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

  it('should warn user if destination node does not exist', () => {
    expect(() => {
      _sampleStoryContents.addDestinationNodeIdToNode('node_2', 'node_4');
    }).toThrowError("The destination node with given id doesn't exist");
  });
core/templates/domain/story/story-contents-object.model.spec.ts on lines 319..323
core/templates/domain/topic/topic-object.model.spec.ts on lines 672..676
core/templates/domain/topic/topic-object.model.spec.ts on lines 678..682
core/templates/pages/exploration-editor-page/translation-tab/services/translation-tab-active-content-id.service.spec.ts on lines 52..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 45.

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

        spyOn(
          blogHomePageBackendApiService,
          'fetchBlogHomePageDataAsync'
        ).and.returnValue(
          Promise.reject({
core/templates/pages/blog-author-profile-page/blog-author-profile-page.component.spec.ts on lines 316..324
core/templates/pages/blog-author-profile-page/blog-author-profile-page.component.spec.ts on lines 345..353
core/templates/pages/blog-home-page/blog-home-page.component.spec.ts on lines 757..765
core/templates/pages/blog-post-page/blog-post-page-root.component.spec.ts on lines 261..269

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

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

    if (!(typeof initialCode === 'string')) {
      warningsList.push({
        type: AppConstants.WARNING_TYPES.ERROR,
        message: 'The initialCode must be a string.',
      });
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 50..55
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 58..63
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 66..71
extensions/interactions/CodeRepl/directives/code-repl-validation.service.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 45.

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

  navigateToHistoryTab(): void {
    this._savePendingChanges();
    this._changeTab(this.TABS.HISTORY.path);
  }
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 303..306
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 308..311
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 313..316
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 323..326

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

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

      spyOn(
        blogHomePageBackendApiService,
        'fetchBlogAuthorProfilePageDataAsync'
      ).and.returnValue(
        Promise.reject({
core/templates/pages/blog-author-profile-page/blog-author-profile-page.component.spec.ts on lines 316..324
core/templates/pages/blog-home-page/blog-home-page.component.spec.ts on lines 757..765
core/templates/pages/blog-home-page/blog-home-page.component.spec.ts on lines 785..793
core/templates/pages/blog-post-page/blog-post-page-root.component.spec.ts on lines 261..269

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

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

  navigateToSettingsTab(): void {
    this._savePendingChanges();
    this._changeTab(this.TABS.SETTINGS.path);
  }
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 303..306
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 308..311
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 318..321
core/templates/pages/exploration-editor-page/services/router.service.ts on lines 323..326

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

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

    if (!(typeof preCode === 'string')) {
      warningsList.push({
        type: AppConstants.WARNING_TYPES.ERROR,
        message: 'The pre-code text must be a string.',
      });
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 50..55
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 58..63
extensions/interactions/CodeRepl/directives/code-repl-validation.service.ts on lines 74..79
extensions/interactions/PencilCodeEditor/directives/pencil-code-editor-validation.service.ts on lines 50..55

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

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