BabylonJS/Spector.js

View on GitHub
src/embeddedFrontend/resultView/resultView.ts

Summary

Maintainability
F
1 wk
Test Coverage

File resultView.ts has 708 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Import application Styles.
import "../styles/resultView.scss";

import { Observable } from "../../shared/utils/observable";
import { ICapture } from "../../shared/capture/capture";
Severity: Major
Found in src/embeddedFrontend/resultView/resultView.ts - About 1 day to fix

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

        constructor(private readonly rootPlaceHolder: Element = null) {
            this.onSourceCodeChanged = new Observable();
    
            this.rootPlaceHolder = this.rootPlaceHolder || document.body;
            this.mvx = new MVX(this.rootPlaceHolder);
    Severity: Major
    Found in src/embeddedFrontend/resultView/resultView.ts - About 4 hrs to fix

      ResultView has 33 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export class ResultView {
          public readonly onSourceCodeChanged: Observable<ISourceCodeChangeEvent>;
      
          private readonly mvx: MVX;
      
      
      Severity: Minor
      Found in src/embeddedFrontend/resultView/resultView.ts - About 4 hrs to fix

        Function displayJSON has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            private displayJSON(parentGroupId: number, json: any) {
                if (json.VisualState) {
                    this.mvx.addChildState(parentGroupId, json.VisualState, this.jsonVisualStateItemComponent);
                }
        
        
        Severity: Minor
        Found in src/embeddedFrontend/resultView/resultView.ts - About 3 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

        Function getJSONAsString has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            private getJSONAsString(parentGroupId: number, key: string, json: any): string {
                if (json === null) {
                    return "null";
                }
        
        
        Severity: Minor
        Found in src/embeddedFrontend/resultView/resultView.ts - About 3 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

        Function createCommands has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private createCommands(capture: ICapture): void {
                this.mvx.removeChildrenStates(this.commandListStateId);
                let tempVisualStateId = this.initVisualStateId;
                let visualStateSet = false;
        
        
        Severity: Major
        Found in src/embeddedFrontend/resultView/resultView.ts - About 2 hrs to fix

          Function createCommands has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              private createCommands(capture: ICapture): void {
                  this.mvx.removeChildrenStates(this.commandListStateId);
                  let tempVisualStateId = this.initVisualStateId;
                  let visualStateSet = false;
          
          
          Severity: Minor
          Found in src/embeddedFrontend/resultView/resultView.ts - 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

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

              private getJSONAsString(parentGroupId: number, key: string, json: any): string {
                  if (json === null) {
                      return "null";
                  }
          
          
          Severity: Minor
          Found in src/embeddedFrontend/resultView/resultView.ts - About 1 hr to fix

            Function displayCurrentCommandDetail has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private displayCurrentCommandDetail(commandState: ICommandListItemState): number {
                    const command = commandState.capture;
                    this.mvx.removeChildrenStates(this.commandDetailStateId);
            
                    const visualState = this.mvx.getGenericState<any>(commandState.visualStateId);
            Severity: Minor
            Found in src/embeddedFrontend/resultView/resultView.ts - About 1 hr to fix

              Function displayJSON has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private displayJSON(parentGroupId: number, json: any) {
                      if (json.VisualState) {
                          this.mvx.addChildState(parentGroupId, json.VisualState, this.jsonVisualStateItemComponent);
                      }
              
              
              Severity: Minor
              Found in src/embeddedFrontend/resultView/resultView.ts - About 1 hr to fix

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

                    private initMenuComponent(): void {
                        this.mvx.updateState(this.menuStateId, {
                            status: MenuStatus.Captures,
                            searchText: this.searchText,
                            commandCount: 0,
                Severity: Minor
                Found in src/embeddedFrontend/resultView/resultView.ts - About 1 hr to fix

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

                      private displayCurrentCommandDetail(commandState: ICommandListItemState): number {
                          const command = commandState.capture;
                          this.mvx.removeChildrenStates(this.commandDetailStateId);
                  
                          const visualState = this.mvx.getGenericState<any>(commandState.visualStateId);
                  Severity: Minor
                  Found in src/embeddedFrontend/resultView/resultView.ts - 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

                  Avoid too many return statements within this function.
                  Open

                              return json.displayText;
                  Severity: Major
                  Found in src/embeddedFrontend/resultView/resultView.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return arrayResult.length === 0 ? null : arrayResult.join(", ");
                    Severity: Major
                    Found in src/embeddedFrontend/resultView/resultView.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return "Empty Array";
                      Severity: Major
                      Found in src/embeddedFrontend/resultView/resultView.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return null;
                        Severity: Major
                        Found in src/embeddedFrontend/resultView/resultView.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return json;
                          Severity: Major
                          Found in src/embeddedFrontend/resultView/resultView.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return json ? "true" : "false";
                            Severity: Major
                            Found in src/embeddedFrontend/resultView/resultView.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return null;
                              Severity: Major
                              Found in src/embeddedFrontend/resultView/resultView.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            return json.__SPECTOR_Object_TAG.displayText;
                                Severity: Major
                                Found in src/embeddedFrontend/resultView/resultView.ts - About 30 mins to fix

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

                                          this.sourceCodeComponent.onBeautifyChanged.add((sourceCodeState) => {
                                              const state = this.mvx.getGenericState<ISourceCodeState>(this.sourceCodeComponentStateId);
                                              state.beautify = (sourceCodeState.sender as HTMLInputElement).checked;
                                              this.mvx.updateState(this.sourceCodeComponentStateId, state);
                                          });
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 3 hrs to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 189..193

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 99.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          this.sourceCodeComponent.onPreprocessChanged.add((sourceCodeState) => {
                                              const state = this.mvx.getGenericState<ISourceCodeState>(this.sourceCodeComponentStateId);
                                              state.preprocessed = (sourceCodeState.sender as HTMLInputElement).checked;
                                              this.mvx.updateState(this.sourceCodeComponentStateId, state);
                                          });
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 3 hrs to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 184..188

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 99.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          this.sourceCodeComponent.onTranslatedFragmentSourceClicked.add((sourceCodeState) => {
                                              const state = this.mvx.getGenericState<ISourceCodeState>(this.sourceCodeComponentStateId);
                                              state.fragment = true;
                                              state.translated = true;
                                              this.mvx.updateState(this.sourceCodeComponentStateId, state);
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 3 other locations - About 3 hrs to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 151..156
                                  src/embeddedFrontend/resultView/resultView.ts on lines 163..168
                                  src/embeddedFrontend/resultView/resultView.ts on lines 169..174

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          this.sourceCodeComponent.onTranslatedVertexSourceClicked.add((sourceCodeState) => {
                                              const state = this.mvx.getGenericState<ISourceCodeState>(this.sourceCodeComponentStateId);
                                              state.fragment = false;
                                              state.translated = true;
                                              this.mvx.updateState(this.sourceCodeComponentStateId, state);
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 3 other locations - About 3 hrs to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 157..162
                                  src/embeddedFrontend/resultView/resultView.ts on lines 163..168
                                  src/embeddedFrontend/resultView/resultView.ts on lines 169..174

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          this.sourceCodeComponent.onFragmentSourceClicked.add((sourceCodeState) => {
                                              const state = this.mvx.getGenericState<ISourceCodeState>(this.sourceCodeComponentStateId);
                                              state.fragment = true;
                                              state.translated = false;
                                              this.mvx.updateState(this.sourceCodeComponentStateId, state);
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 3 other locations - About 3 hrs to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 151..156
                                  src/embeddedFrontend/resultView/resultView.ts on lines 157..162
                                  src/embeddedFrontend/resultView/resultView.ts on lines 163..168

                                  Duplicated Code

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

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

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

                                  Tuning

                                  This issue has a mass of 96.

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                          this.sourceCodeComponent.onVertexSourceClicked.add((sourceCodeState) => {
                                              const state = this.mvx.getGenericState<ISourceCodeState>(this.sourceCodeComponentStateId);
                                              state.fragment = false;
                                              state.translated = false;
                                              this.mvx.updateState(this.sourceCodeComponentStateId, state);
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 3 other locations - About 3 hrs to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 151..156
                                  src/embeddedFrontend/resultView/resultView.ts on lines 157..162
                                  src/embeddedFrontend/resultView/resultView.ts on lines 169..174

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

                                  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

                                          switch (command.status) {
                                              case CommandCaptureStatus.Deprecated:
                                                  status = "Deprecated";
                                                  break;
                                              case CommandCaptureStatus.Unused:
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 2 hrs to fix
                                  src/embeddedFrontend/resultView/commandList/commandListItemComponent.ts on lines 31..47

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

                                  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

                                      private displayEndState(): void {
                                          const capture = this.onCaptureRelatedAction(MenuStatus.EndState);
                                  
                                          const jsonContentStateId = this.mvx.addChildState(this.contentStateId, null, this.jsonContentComponent);
                                          this.displayJSON(jsonContentStateId, capture.endState);
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 2 hrs to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 549..554

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

                                  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

                                      private displayInitState(): void {
                                          const capture = this.onCaptureRelatedAction(MenuStatus.InitState);
                                  
                                          const jsonContentStateId = this.mvx.addChildState(this.contentStateId, null, this.jsonContentComponent);
                                          this.displayJSON(jsonContentStateId, capture.initState);
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 2 hrs to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 556..561

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                      private selectPreviousCommand(): void {
                                          const commandState = this.mvx.getGenericState<ICommandListItemState>(this.currentCommandStateId);
                                          if (commandState.previousCommandStateId < 0) {
                                              return;
                                          }
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 3 other locations - About 1 hr to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 316..323
                                  src/embeddedFrontend/resultView/resultView.ts on lines 325..332
                                  src/embeddedFrontend/resultView/resultView.ts on lines 334..341

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                      private selectNextVisualState(): void {
                                          const visualState = this.mvx.getGenericState<IVisualStateItem>(this.currentVisualStateId);
                                          if (visualState.nextVisualStateId < 0) {
                                              return;
                                          }
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 3 other locations - About 1 hr to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 307..314
                                  src/embeddedFrontend/resultView/resultView.ts on lines 316..323
                                  src/embeddedFrontend/resultView/resultView.ts on lines 325..332

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                      private selectPreviousVisualState(): void {
                                          const visualState = this.mvx.getGenericState<IVisualStateItem>(this.currentVisualStateId);
                                          if (visualState.previousVisualStateId < 0) {
                                              return;
                                          }
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 3 other locations - About 1 hr to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 307..314
                                  src/embeddedFrontend/resultView/resultView.ts on lines 316..323
                                  src/embeddedFrontend/resultView/resultView.ts on lines 334..341

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

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

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

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

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

                                  Refactorings

                                  Further Reading

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

                                      private selectNextCommand(): void {
                                          const commandState = this.mvx.getGenericState<ICommandListItemState>(this.currentCommandStateId);
                                          if (commandState.nextCommandStateId < 0) {
                                              return;
                                          }
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 3 other locations - About 1 hr to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 307..314
                                  src/embeddedFrontend/resultView/resultView.ts on lines 325..332
                                  src/embeddedFrontend/resultView/resultView.ts on lines 334..341

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

                                  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 (previousCommandState) {
                                                  previousCommandState = this.mvx.getGenericState<ICommandListItemState>(previousCommandStateId);
                                                  previousCommandState.nextCommandStateId = commandStateId;
                                                  this.mvx.updateState(previousCommandStateId, previousCommandState);
                                              }
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 1 hr to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 748..752

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

                                  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 (previousVisualState) {
                                                      previousVisualState = this.mvx.getGenericState<IVisualStateItem>(previousVisualStateId);
                                                      previousVisualState.nextVisualStateId = tempVisualStateId;
                                                      this.mvx.updateState(previousVisualStateId, previousVisualState);
                                                  }
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 1 hr to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 725..729

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

                                  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

                                      public selectVisualState(visualStateId: number): void {
                                          this.currentVisualStateId = visualStateId;
                                          this.currentCommandStateId = this.displayCurrentVisualState();
                                          this.displayCurrentCommand();
                                      }
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 1 hr to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 221..225

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

                                  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

                                      public selectCommand(commandStateId: number): void {
                                          this.currentCommandStateId = commandStateId;
                                          this.currentVisualStateId = this.displayCurrentCommand();
                                          this.displayCurrentVisualState();
                                      }
                                  Severity: Major
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 1 hr to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 227..231

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

                                  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

                                          this.commandListItemComponent.onFragmentSelected.add((commandEventArgs) => {
                                              this.selectCommand(commandEventArgs.stateId);
                                              this.openShader(true);
                                          });
                                  Severity: Minor
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 50 mins to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 140..143

                                  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

                                          this.commandListItemComponent.onVertexSelected.add((commandEventArgs) => {
                                              this.selectCommand(commandEventArgs.stateId);
                                              this.openShader(false);
                                          });
                                  Severity: Minor
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 1 other location - About 50 mins to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 144..147

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

                                          this.mvx.updateAllChildrenGenericState<ICommandListItemState>(this.commandListStateId,
                                              (state) => { state.active = false; return state; },
                                          );
                                  Severity: Minor
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 2 other locations - About 35 mins to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 565..567
                                  src/embeddedFrontend/resultView/resultView.ts on lines 671..673

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

                                  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

                                          this.mvx.updateAllChildrenGenericState<IVisualStateItem>(this.visualStateListStateId,
                                              (state) => { state.active = false; return state; },
                                          );
                                  Severity: Minor
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 2 other locations - About 35 mins to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 565..567
                                  src/embeddedFrontend/resultView/resultView.ts on lines 589..591

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

                                  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

                                          this.mvx.updateAllChildrenGenericState<ICaptureListItemState>(this.captureListStateId,
                                              (state) => { state.active = false; return state; },
                                          );
                                  Severity: Minor
                                  Found in src/embeddedFrontend/resultView/resultView.ts and 2 other locations - About 35 mins to fix
                                  src/embeddedFrontend/resultView/resultView.ts on lines 589..591
                                  src/embeddedFrontend/resultView/resultView.ts on lines 671..673

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

                                  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