TryGhost/Ghost

View on GitHub
ghost/admin/app/components/gh-post-settings-menu.js

Summary

Maintainability
F
1 wk
Test Coverage

File gh-post-settings-menu.js has 472 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Component from '@ember/component';
import boundOneWay from 'ghost-admin/utils/bound-one-way';
import classic from 'ember-classic-decorator';
import moment from 'moment-timezone';
import {action, computed} from '@ember/object';
Severity: Minor
Found in ghost/admin/app/components/gh-post-settings-menu.js - About 7 hrs to fix

    GhPostSettingsMenu has 37 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @classic
    @tagName('')
    export default class GhPostSettingsMenu extends Component {
        @service feature;
        @service store;
    Severity: Minor
    Found in ghost/admin/app/components/gh-post-settings-menu.js - About 4 hrs to fix

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

          @action
          setMetaDescription(metaDescription) {
              // Grab the post and current stored meta description
              let post = this.post;
              let currentDescription = post.get('metaDescription');
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 5 other locations - About 5 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 349..371
      ghost/admin/app/components/gh-post-settings-menu.js on lines 421..443
      ghost/admin/app/components/gh-post-settings-menu.js on lines 445..467
      ghost/admin/app/components/gh-post-settings-menu.js on lines 469..491
      ghost/admin/app/components/gh-post-settings-menu.js on lines 493..515

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

      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

          @action
          setTwitterTitle(twitterTitle) {
              // Grab the post and current stored twitter title
              let post = this.post;
              let currentTitle = post.get('twitterTitle');
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 5 other locations - About 5 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 349..371
      ghost/admin/app/components/gh-post-settings-menu.js on lines 373..395
      ghost/admin/app/components/gh-post-settings-menu.js on lines 421..443
      ghost/admin/app/components/gh-post-settings-menu.js on lines 445..467
      ghost/admin/app/components/gh-post-settings-menu.js on lines 493..515

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

      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

          @action
          setMetaTitle(metaTitle) {
              // Grab the post and current stored meta title
              let post = this.post;
              let currentTitle = post.get('metaTitle');
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 5 other locations - About 5 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 373..395
      ghost/admin/app/components/gh-post-settings-menu.js on lines 421..443
      ghost/admin/app/components/gh-post-settings-menu.js on lines 445..467
      ghost/admin/app/components/gh-post-settings-menu.js on lines 469..491
      ghost/admin/app/components/gh-post-settings-menu.js on lines 493..515

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

      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

          @action
          setOgTitle(ogTitle) {
              // Grab the post and current stored facebook title
              let post = this.post;
              let currentTitle = post.get('ogTitle');
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 5 other locations - About 5 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 349..371
      ghost/admin/app/components/gh-post-settings-menu.js on lines 373..395
      ghost/admin/app/components/gh-post-settings-menu.js on lines 445..467
      ghost/admin/app/components/gh-post-settings-menu.js on lines 469..491
      ghost/admin/app/components/gh-post-settings-menu.js on lines 493..515

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

      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

          @action
          setTwitterDescription(twitterDescription) {
              // Grab the post and current stored twitter description
              let post = this.post;
              let currentDescription = post.get('twitterDescription');
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 5 other locations - About 5 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 349..371
      ghost/admin/app/components/gh-post-settings-menu.js on lines 373..395
      ghost/admin/app/components/gh-post-settings-menu.js on lines 421..443
      ghost/admin/app/components/gh-post-settings-menu.js on lines 445..467
      ghost/admin/app/components/gh-post-settings-menu.js on lines 469..491

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

      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

          @action
          setOgDescription(ogDescription) {
              // Grab the post and current stored facebook description
              let post = this.post;
              let currentDescription = post.get('ogDescription');
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 5 other locations - About 5 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 349..371
      ghost/admin/app/components/gh-post-settings-menu.js on lines 373..395
      ghost/admin/app/components/gh-post-settings-menu.js on lines 421..443
      ghost/admin/app/components/gh-post-settings-menu.js on lines 469..491
      ghost/admin/app/components/gh-post-settings-menu.js on lines 493..515

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

      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

          @action
          setFooterInjection(code) {
              let post = this.post;
              let currentCode = post.get('codeinjectionFoot');
      
      
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 2 other locations - About 3 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 307..319
      ghost/admin/app/components/gh-post-settings-menu.js on lines 321..333

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

      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

          @action
          setHeaderInjection(code) {
              let post = this.post;
              let currentCode = post.get('codeinjectionHead');
      
      
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 2 other locations - About 3 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 307..319
      ghost/admin/app/components/gh-post-settings-menu.js on lines 335..347

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

      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

          @action
          setCustomExcerpt(excerpt) {
              let post = this.post;
              let currentExcerpt = post.get('customExcerpt');
      
      
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 2 other locations - About 3 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 321..333
      ghost/admin/app/components/gh-post-settings-menu.js on lines 335..347

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

      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

          @action
          setOgImage(image) {
              this.set('post.ogImage', image);
      
              if (this.get('post.isNew')) {
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 2 other locations - About 2 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 517..529
      ghost/admin/app/components/gh-post-settings-menu.js on lines 573..585

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

      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

          @action
          setCoverImage(image) {
              this.set('post.featureImage', image);
      
              if (this.get('post.isNew')) {
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 2 other locations - About 2 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 545..557
      ghost/admin/app/components/gh-post-settings-menu.js on lines 573..585

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

      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

          @action
          setTwitterImage(image) {
              this.set('post.twitterImage', image);
      
              if (this.get('post.isNew')) {
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 2 other locations - About 2 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 517..529
      ghost/admin/app/components/gh-post-settings-menu.js on lines 545..557

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

      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

          @action
          clearTwitterImage() {
              this.set('post.twitterImage', '');
      
              if (this.get('post.isNew')) {
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 2 other locations - About 2 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 531..543
      ghost/admin/app/components/gh-post-settings-menu.js on lines 559..571

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

      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

          @action
          clearCoverImage() {
              this.set('post.featureImage', '');
      
              if (this.get('post.isNew')) {
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 2 other locations - About 2 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 559..571
      ghost/admin/app/components/gh-post-settings-menu.js on lines 587..599

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

      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

          @action
          clearOgImage() {
              this.set('post.ogImage', '');
      
              if (this.get('post.isNew')) {
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 2 other locations - About 2 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 531..543
      ghost/admin/app/components/gh-post-settings-menu.js on lines 587..599

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

      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

              if (post.get('isNew') || time === post.get('publishedAtBlogTime')) {
                  post.validate({property: 'publishedAtBlog'});
              } else {
                  post.set('publishedAtBlogTime', time);
                  return this.savePostTask.perform();
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 1 other location - About 2 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 266..271

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

      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

              if (post.get('isNew') || date === post.get('publishedAtBlogDate')) {
                  post.validate({property: 'publishedAtBlog'});
              } else {
                  post.set('publishedAtBlogDate', dateString);
                  return this.savePostTask.perform();
      Severity: Major
      Found in ghost/admin/app/components/gh-post-settings-menu.js and 1 other location - About 2 hrs to fix
      ghost/admin/app/components/gh-post-settings-menu.js on lines 299..304

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

      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