RackHD/on-web-ui

View on GitHub

Showing 26 of 162 total issues

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

  ngOnInit() {
    if (this.editable) {
      this.graphTaskService.getAll()
      .subscribe(allTasks => {
        this.taskInjectableNames = allTasks.map(function (item) {
Severity: Minor
Found in src/app/canvas-graph/canvas-graph.component.ts - About 1 hr to fix

    Function drawNodes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      drawNodes() {
        if (!this.workflow) return;
    
        this.graph.clear();
    
    
    Severity: Minor
    Found in src/app/canvas-graph/canvas-graph.component.ts - About 1 hr to fix

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

          public createTaskNode(task: any, position): any {
            let waitOnLength = _.keys(task[this.waitOnKey]).length;
            let taskNodeName = 'rackhd/task_' + waitOnLength;
            let taskNode = global.LiteGraph.createNode(taskNodeName);
            taskNode.title = task.label;
      Severity: Minor
      Found in src/app/canvas-graph/canvas-helper.ts - 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

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

        isTaskWaitOnLegal(obj: any): boolean {
          let isLegal = true;
          if (obj && obj.tasks) {
            let taskLables = _.map(obj.tasks, 'label');
            let waitOnLables = _.unionBy(_.flatten(_.map(obj.tasks, 'waitOn').map(_.keys)));
      Severity: Minor
      Found in src/app/workflow-center/workflow-editor/workflow-editor.component.ts - 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

      Function ngOnInit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        ngOnInit() {
          this.route.queryParams
          .subscribe(params => {
            this.isDefinition = this.isDefinition || !!params.graphName;
            this.graphId = params && (params.graphId || params.graphName);
      Severity: Minor
      Found in src/app/workflow-center/workflow-viewer/workflow-viewer.component.ts - About 25 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 onSubmit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        onSubmit(){
          let payload = this.modalFormGroup.value;
          this.optionsJsonValid = isJsonTextValid(payload.options);
          this.tasksJsonValid = isJsonTextValid(payload.tasks);
          if (this.optionsJsonValid && this.tasksJsonValid) {
      Severity: Minor
      Found in src/app/management-center/workflows/workflows.component.ts - About 25 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

      Severity
      Category
      Status
      Source
      Language