Showing 65 of 96 total issues
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 preprocessor
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public preprocessor(request) {
return new Promise((resolve, reject) => {
const data = [];
/**
* Get data from url
- Create a ticketCreate a ticket
Function getChoiseType
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static getChoiseType(rate: any, choices: any): string {
if (rate === 0) {
if (Transport.isObjectNotEmpty(choices.normal)) {
return "normal";
} else if (Transport.isObjectNotEmpty(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
Function encodeSync
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public encodeSync(data: any, password: string) {
if (
this.cryptoModule === "" ||
this.cryptoModule === "base64salt"
) {
- 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 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 redirectProxy
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const redirectProxy = () => {
if (
result.Data.link.indexOf(".css") === -1 &&
result.Data.link.indexOf("yandex") === -1
) {
- 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 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 combineSettings
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static combineSettings(settedSettings: any, defaultSettings: any): any {
let settings;
if (
(
typeof settedSettings === "boolean" ||
- 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 decodeSync
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public decodeSync(data: any, password: string) {
try {
let dec = decodeURIComponent(global.escape(Buffer.from(data, "base64").toString("utf8"))).split("@");
dec.shift();
dec = JSON.parse(dec.join("@"));
- Create a ticketCreate a ticket
Function listenr
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public listenr(request, response) {
this.AcceptEncoding = request.headers["accept-encoding"] || "";
const headers = Object.assign({}, baseHeaders);
- 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
Consider simplifying this complex logical expression. Open
if (
(
typeof settedSettings === "boolean" ||
typeof settedSettings === "number" ||
typeof settedSettings === "string" ||
- 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 getTransport
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public getTransport(_transports: string[], type: string): string[] {
/**
* Filter sub transports by settings
*/
const transports = [];
- 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 combineSettings
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static combineSettings(settedSettings: any, defaultSettings: any): any {
let settings;
if (
(
typeof settedSettings === "boolean" ||
- Create a ticketCreate a ticket
Function responceError
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public responceError(id, request, response, headers, e?, ...data) {
this.ErrorHandler(e, id, data);
if (request.headers["x-real-404"]) {
const url = URL.parse(request.headers["x-real-404"]);
- Create a ticketCreate a ticket
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
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 (
this.listners["proxy"]
) {
new Promise(
(_resolve) => {
- Create a ticketCreate a ticket