Showing 26 of 162 total issues
File os-install.component.ts
has 416 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, OnInit } from '@angular/core';
import { Poller, Node, API_PATTERN, ADDR_PATTERN, REPO_PATTERN, IP_PATTERN, DNS_PATTERN } from 'app/models';
import { FormControl, FormGroup, FormBuilder, Validators } from '@angular/forms';
import {
AlphabeticalComparator,
Function init
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
init(connectCb, disconnectCb, clickCb){
if(this.initialized) return;
// inject hook actions
TaskNode.prototype.onConnectionsChange = function(connection, slot, connected, link_info){
if(connection===global.LiteGraph.OUTPUT){
- Read upRead up
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
File canvas-graph.component.ts
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
Component,
ElementRef,
EventEmitter,
Input,
Function addNode
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
addNode() {
// mothod 1 for keep current context
let self = this;
// this function is referenced from lightgraph src.
OsInstallComponent
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'app-os-install',
templateUrl: './os-install.component.html',
styleUrls: ['./os-install.component.scss']
})
Function drawBackCanvas
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static drawBackCanvas() {
return function(){
var canvas = this.bgcanvas;
if (canvas.width != this.canvas.width ||
canvas.height != this.canvas.height) {
File canvas-helper.ts
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as _ from 'lodash';
import { CONSTS } from '../../config/consts';
const global = (window as any);
ObmComponent
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'app-obm',
templateUrl: './obm.component.html',
styleUrls: ['./obm.component.scss']
})
Function init
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(connectCb, disconnectCb, clickCb){
if(this.initialized) return;
// inject hook actions
TaskNode.prototype.onConnectionsChange = function(connection, slot, connected, link_info){
if(connection===global.LiteGraph.OUTPUT){
NodesComponent
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'app-nodes',
templateUrl: './nodes.component.html',
styleUrls: ['./nodes.component.scss'],
encapsulation: ViewEncapsulation.None
RunWorkflowComponent
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'app-run-workflow',
templateUrl: './run-workflow.component.html',
styleUrls: ['./run-workflow.component.scss']
})
HistoryWorkflowComponent
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'app-history-workflow',
templateUrl: './history-workflow.component.html',
styleUrls: ['./history-workflow.component.scss'],
encapsulation: ViewEncapsulation.None
Function createPayloadOptions
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
createPayloadOptions(): object {
let tmpJson = {};
let generalJson = {};
let version = { 'version': this.payloadForm.value['version'] };
let repo = { 'repo': this.payloadForm.value['repoUrl'] };
Function createSku
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
createSku(): void {
let jsonData = {};
this.skuForm.getRawValue();
let value = this.skuForm.value;
// data transform
Function createSku
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
createSku(): void {
let jsonData = {};
this.skuForm.getRawValue();
let value = this.skuForm.value;
// data transform
- Read upRead up
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 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
this.OS_TYPE_VERSION = {
'esxi': ['6.5', '6', '5.5'],
'centos': ['7', '6.5'],
'rhel': ['7.0', '7.1', '7.2'],
Function generateRowPos
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public generateRowPos(colPosMatrix: any, waitOnsList: any): {[propName: string]: number} {
let rowPosMatrix = {};
let tasksSortedByCol = this.sortTaskByCol(colPosMatrix);
let waitedBysMatrix = this.getWaitedBysMatrix(this.tasks);
Function upload
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@ErrorHanlder()
public upload(file: File, identifier?: string, method?: string): any {
//Angular doesn't support upload formData with 'application/x-www-form-urlencoded'
//RackHD files API only supports 'application/x-www-form-urlencoded' till now
//Thus XMLHttpRequest() is used instead of HttpClient POST/PUT methods.
Function createPayloadOptions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
createPayloadOptions(): object {
let tmpJson = {};
let generalJson = {};
let version = { 'version': this.payloadForm.value['version'] };
let repo = { 'repo': this.payloadForm.value['repoUrl'] };
- Read upRead up
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 afterClick
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
afterClick(e, node) {
if (!node || !node.properties)
return;
let self = this;