File client.ts
has 668 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
/**
* Import interfaces
*/
import IWindow from "../../interfaces/IWindow";
- Create a ticketCreate a ticket
Function styleadvanced
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public styleadvanced(params: any = {}) {
return new Promise((resolve, reject) => {
const onerror = () => {
try {
link.href = "";
- Create a ticketCreate a ticket
Function emit
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public emit(params: any = {}) {
params.Event = params.Event || "";
params.Data = params.Data || {};
params.Debug = params.Debug || false;
- Create a ticketCreate a ticket
Function generateChoises
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public generateChoises() {
const choices = {
bad: {},
good: {},
normal: {},
- Read upRead up
- Create a ticketCreate a ticket
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 styleextend
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public styleextend(params: any = {}) {
return new Promise((resolve, reject) => {
const onerror = () => {
try {
link.href = "";
- Create a ticketCreate a ticket
Function onload
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onload = () => {
if (
link.sheet &&
link.sheet.cssRules.length > 0
) {
- Create a ticketCreate a ticket
Function style
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public style(params: any = {}) {
return new Promise((resolve, reject) => {
const onerror = () => {
try {
link.href = "";
- Create a ticketCreate a ticket
Function xhr
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public xhr(params: any = {}) {
return new Promise((resolve, reject) => {
let xhr;
const onerror = () => {
- Create a ticketCreate a ticket
Function fetch
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public fetch(params: any = {}) {
return new Promise((resolve, reject) => {
const onerror = () => {
reject();
};
- Create a ticketCreate a ticket
Function generateChoises
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public generateChoises() {
const choices = {
bad: {},
good: {},
normal: {},
- Create a ticketCreate a ticket
Function script
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public script(params: any = {}) {
return new Promise((resolve, reject) => {
const onerror = () => {
try {
script.src = "";
- Create a ticketCreate a ticket
Function iframe
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public iframe(params: any = {}) {
return new Promise((resolve, reject) => {
const onerror = () => {
try {
iframe.src = "";
- Create a ticketCreate a ticket
Function cleanOldChoises
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static cleanOldChoises() {
try {
for (let major = 1; major < 3; major++) {
for (let minor = 0; minor < 10; minor++) {
for (let patch = 0; patch < 100; patch++) {
- Read upRead up
- Create a ticketCreate a ticket
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 onload
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onload = () => {
if (
link.sheet &&
link.sheet.cssRules.length > 0
) {
- Create a ticketCreate a ticket
Function filterChoises
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public filterChoises() {
const _choices = this.generateChoises();
const choices = {
bad: {},
- Read upRead up
- Create a ticketCreate a ticket
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 deeply nested control flow statements. Open
if (rules) {
for (let i = 0; i < rules.length; i++) {
const rule = rules[i].split(":");
rule[1] = rule[1].match(/[0-9]*/ig).filter((v) => v !== "");
if (
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (_data) {
return resolve(_data);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for (let i3 = 0; i3 < HttpMethodsKeys.length; i3++) {
const HttpMethod = HttpMethodsKeys[i3];
if (
["GET", "POST", "PUT", "PATCH"].indexOf(HttpMethod) !== -1
- Create a ticketCreate a ticket
Function generateSubtransportChoices
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public generateSubtransportChoices(choices: any, obj: any, subtransports: any): void {
const l = subtransports.length;
if (l) {
for (let x = 0; x < l; x++) {
if (
- Read upRead up
- Create a ticketCreate a ticket
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"