superdesk/superdesk-client-core

View on GitHub
scripts/apps/authoring-react/authoring-react.tsx

Summary

Maintainability
F
1 wk
Test Coverage

File authoring-react.tsx has 1195 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import {
    IArticle,
    IAuthoringFieldV2,
    IContentProfileV2,
Severity: Major
Found in scripts/apps/authoring-react/authoring-react.tsx - About 3 days to fix

    Function render has 328 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        render() {
            const state = this.state;
            const {authoringStorage, fieldsAdapter, storageAdapter, getLanguage, getSidePanel} = this.props;
    
            if (state.initialized !== true) {
    Severity: Major
    Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 day to fix

      Function componentDidMount has 202 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          componentDidMount() {
              const authThemes = ng.get('authThemes');
      
              this._mounted = true;
      
      
      Severity: Major
      Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 day to fix

        Function authoringActions has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                const authoringActions: Array<IAuthoringAction> = (() => {
                    const actions = this.props.getActions?.(exposed) ?? [];
                    const coreActions: Array<IAuthoringAction> = [];
        
                    if (appConfig.features.useTansaProofing !== true) {
        Severity: Major
        Found in scripts/apps/authoring-react/authoring-react.tsx - About 2 hrs to fix

          Function render has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

              render() {
                  const state = this.state;
                  const {authoringStorage, fieldsAdapter, storageAdapter, getLanguage, getSidePanel} = this.props;
          
                  if (state.initialized !== true) {
          Severity: Minor
          Found in scripts/apps/authoring-react/authoring-react.tsx - About 2 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          AuthoringReact has 24 functions (exceeds 20 allowed). Consider refactoring.
          Open

          export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureComponent<IPropsAuthoring<T>, IState<T>> {
              private cleanupFunctionsToRunBeforeUnmounting: Array<() => void>;
              private _mounted: boolean;
              private componentRef: HTMLElement | null;
          
          
          Severity: Minor
          Found in scripts/apps/authoring-react/authoring-react.tsx - About 2 hrs to fix

            Function constructor has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                constructor(props: IPropsAuthoring<T>) {
                    super(props);
            
                    this.state = {
                        initialized: false,
            Severity: Major
            Found in scripts/apps/authoring-react/authoring-react.tsx - About 2 hrs to fix

              Function save has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  save(state: IStateLoaded<T>): Promise<T> {
                      const {authoringStorage} = this.props;
              
                      if ((this.props.validateBeforeSaving ?? true) === true) {
                          const {profile} = state;
              Severity: Minor
              Found in scripts/apps/authoring-react/authoring-react.tsx - About 2 hrs to fix

                Function getInitialState has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function getInitialState<T extends IBaseRestApiResponse>(
                    item: {saved: T; autosaved: T},
                    profile: IContentProfileV2,
                    userPreferencesForFields: IStateLoaded<T>['userPreferencesForFields'],
                    spellcheckerEnabled: boolean,
                Severity: Minor
                Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 hr to fix

                  Function getInitialState has 11 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      item: {saved: T; autosaved: T},
                      profile: IContentProfileV2,
                      userPreferencesForFields: IStateLoaded<T>['userPreferencesForFields'],
                      spellcheckerEnabled: boolean,
                      fieldsAdapter: IFieldsAdapter<T>,
                  Severity: Major
                  Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 hr to fix

                    Function toggleField has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        toggleField(fieldId: string) {
                            if (!this.state.initialized) {
                                return;
                            }
                    
                    
                    Severity: Minor
                    Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 hr to fix

                      Function handleUnsavedChanges has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          handleUnsavedChanges(state: IStateLoaded<T>): Promise<T> {
                              return new Promise((resolve, reject) => {
                                  if (!this.hasUnsavedChanges()) {
                                      resolve(state.itemOriginal);
                                      return;
                      Severity: Minor
                      Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 hr to fix

                        Function constructor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            constructor(props: IPropsAuthoring<T>) {
                                super(props);
                        
                                this.state = {
                                    initialized: false,
                        Severity: Minor
                        Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 hr to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function printPreviewAction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                const printPreviewAction = (() => {
                                    const execute = () => {
                                        previewAuthoringEntity(
                                            state.itemWithChanges,
                                            state.profile,
                        Severity: Minor
                        Found in scripts/apps/authoring-react/authoring-react.tsx - About 1 hr to fix

                          Function serializeFieldsDataAndApplyOnEntity has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              item: T,
                              fieldsProfile: Map<string, IAuthoringFieldV2>,
                              fieldsData: Map<string, unknown>,
                              userPreferencesForFields: {[key: string]: unknown},
                              fieldsAdapter: IFieldsAdapter<T>,
                          Severity: Major
                          Found in scripts/apps/authoring-react/authoring-react.tsx - About 50 mins to fix

                            Function componentDidUpdate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                componentDidUpdate(_prevProps, prevState: IState<T>) {
                                    const {authoringStorage} = this.props;
                                    const state = this.state;
                            
                                    if (
                            Severity: Minor
                            Found in scripts/apps/authoring-react/authoring-react.tsx - About 45 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function save has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                save(state: IStateLoaded<T>): Promise<T> {
                                    const {authoringStorage} = this.props;
                            
                                    if ((this.props.validateBeforeSaving ?? true) === true) {
                                        const {profile} = state;
                            Severity: Minor
                            Found in scripts/apps/authoring-react/authoring-react.tsx - About 45 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function getFieldsData has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                item: T,
                                fields: Map<string, IAuthoringFieldV2>,
                                fieldsAdapter: IFieldsAdapter<T>,
                                authoringStorage: IAuthoringStorage<T>,
                                storageAdapter: IStorageAdapter<T>,
                            Severity: Minor
                            Found in scripts/apps/authoring-react/authoring-react.tsx - About 45 mins to fix

                              Function getVocabularyItems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  getVocabularyItems(vocabularyId): Array<IVocabularyItem> {
                                      const vocabulary = sdApi.vocabularies.getAll().get(vocabularyId);
                              
                                      if (vocabularyId === ANPA_CATEGORY.vocabularyId) {
                                          return vocabulary.items;
                              Severity: Minor
                              Found in scripts/apps/authoring-react/authoring-react.tsx - About 35 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                                              authoringStorage.getEntity(state.itemOriginal._id).then((item) => {
                                                  this.setState(getInitialState(
                                                      item,
                                                      state.profile,
                                                      state.userPreferencesForFields,
                              Severity: Major
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 5 hrs to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 740..754

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

                              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

                                              authoringStorage.getEntity(state.itemOriginal._id).then((item) => {
                                                  this.setState(getInitialState(
                                                      item,
                                                      state.profile,
                                                      state.userPreferencesForFields,
                              Severity: Major
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 5 hrs to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 766..780

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                              export const getUiThemeFontSize = (value: IFontSizeOption) => {
                                  if (value === 'small') {
                                      return '1.4rem';
                                  } else if (value === 'medium') {
                                      return '1.6rem';
                              Severity: Major
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 2 hrs to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 232..242

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 75.

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

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

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

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

                              Refactorings

                              Further Reading

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

                              export const getUiThemeFontSizeHeading = (value: IFontSizeOption) => {
                                  if (value === 'small') {
                                      return '2.3rem';
                                  } else if (value === 'medium') {
                                      return '2.8rem';
                              Severity: Major
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 2 hrs to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 220..230

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 75.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                                      onTrigger: () => {
                                                          const nextValue = true;
                              
                                                          this.setState({
                                                              ...state,
                              Severity: Major
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 1 hr to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 1195..1210

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

                              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

                                                          'ctrl+shift+y': () => {
                                                              const nextValue = true;
                              
                                                              this.setState({
                                                                  ...state,
                              Severity: Major
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 1 hr to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 1178..1193

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

                              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

                                              } else if (action === IUnsavedChangesActionWithSaving.discardChanges) {
                                                  this.discardUnsavedChanges(state).then(() => {
                                                      closePromptFn();
                              
                                                      if (this.state.initialized) {
                              Severity: Major
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 1 hr to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 850..860

                              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

                                              } else if (action === IUnsavedChangesActionWithSaving.save) {
                                                  this.save(state).then(() => {
                                                      closePromptFn();
                              
                                                      if (this.state.initialized) {
                              Severity: Major
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 1 hr to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 842..860

                              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

                                                          'ctrl+shift+y': () => {
                                                              this.setState({
                                                                  ...state,
                                                                  spellcheckerEnabled: nextValue,
                                                              });
                              Severity: Major
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 1 hr to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 1144..1157

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

                              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

                                                      onTrigger: () => {
                                                          this.setState({
                                                              ...state,
                                                              spellcheckerEnabled: nextValue,
                                                          });
                              Severity: Major
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 1 hr to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 1159..1172

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

                              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 (state.itemOriginal === state.itemWithChanges) {
                                                              /**
                                                               * if object references are the same before patching
                                                               * they should be the same after patching too
                                                               * in order for checking for changes to work correctly
                              Severity: Minor
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 50 mins to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 677..707

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

                              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 (!this.hasUnsavedChanges()) {
                                                      /**
                                                       * if object references are the same before patching
                                                       * they should be the same after patching too
                                                       * in order for checking for changes to work correctly
                              Severity: Minor
                              Found in scripts/apps/authoring-react/authoring-react.tsx and 1 other location - About 50 mins to fix
                              scripts/apps/authoring-react/authoring-react.tsx on lines 616..646

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

                              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