Showing 56 of 59 total issues
Function getName
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static getName(): string {
let os = "";
const clientStrings = [
{
r: /(Windows 10.0|Windows NT 10.0)/,
- Create a ticketCreate a ticket
Function setItem
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public static setItem(checkSupport: boolean = true,
key: string,
value: string,
expires: number = 30,
path: string = "/",
- 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
File UtilsAnimationEasing.ts
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
/**
* Different time animation functions
*/
export default class Easing {
- Create a ticketCreate a ticket
Easing
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
export default class Easing {
public static def = "easeOutQuad";
public static isValidParams(t: number, b: number, c: number, d: number, s?: number): boolean {
return (
- Create a ticketCreate a ticket
Function implementationStaticMethods
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public static implementationStaticMethods(realObject: any, className?: string): void {
if (
!!realObject &&
typeof realObject === "object"
) {
- 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 getWheelDelta
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static getWheelDelta(e): number {
if (
e &&
typeof e === "object" &&
(
- 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
Browser
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
export default class Browser {
/**
* Get browser info
* @return {{browser: string, mobile: boolean, version: string}}
*/
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
typeof checkSupport === "boolean" &&
(
typeof key === "string" &&
Cookie.regValidKey.test(key)
- Create a ticketCreate a ticket
File UtilsDOM.ts
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
/**
* Import additional classes
*/
import UtilsMain from "./UtilsMain";
- Create a ticketCreate a ticket
Function stack
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static stack(): any[] {
const e: IError = new Error();
return (
e &&
e.stack &&
- Create a ticketCreate a ticket
Function setItem
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static setItem(checkSupport: boolean = true,
key: string,
value: string,
expires: number = 30,
path: string = "/",
- Create a ticketCreate a ticket
Function getBoundingClientRect
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static getBoundingClientRect(domNode: any, domDocument: Document = document, showForce: boolean = false): {
bottom: number,
height: number,
left: number,
right: number,
- Create a ticketCreate a ticket
Function isVisible
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static isVisible(domNode: HTMLElement,
booElement: boolean,
numDocumentWidth: number,
numDocumentHeight: number): 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 getWheelDelta
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static getWheelDelta(e): number {
if (
e &&
typeof e === "object" &&
(
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
e &&
typeof e === "object" &&
(
"detail" in e ||
- Create a ticketCreate a ticket
Function checkTotalVisibility
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static checkTotalVisibility(domBanner: HTMLElement): number {
/**
* Устанавливаем флаг видимости элемента
* Записываем элемент во временную переменную дял перебора по родителям
* Устанавливаем флаг соответствия элемента исходному
- 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 getItem
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static getItem(checkSupport: boolean = true,
key: string): string|boolean {
try {
/**
* Validate input data
- 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 calcVisibility
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static calcVisibility(objSizes: {
left: number,
right: number,
top: number,
bottom: number,
- 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 (
!domNode ||
domNode.nodeType !== 1 || !domNode.parentNode ||
domNode.parentNode.nodeName === "HTML" ||
(
- Create a ticketCreate a ticket
Function easeInOutElastic
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static easeInOutElastic(t: number, b: number, c: number, d: number): number {
if (Easing.isValidParams(t, b, c, d)) {
let s = 1.70158;
let p = 0;
let a = c;
- 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"