Showing 14 of 16 total issues
Function watch
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static watch() {
if (CSLogger.arrLog.length > 0 && CSLogger.arrLog.length < 100) {
for (let j = 0; j < CSLogger.arrLog.length; j++) {
const l = CSLogger.arrLog[j];
const data = encodeURIComponent(JSON.stringify(l));
- Create a ticketCreate a ticket
Function watch
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static watch() {
if (CSLogger.arrLog.length > 0 && CSLogger.arrLog.length < 100) {
for (let j = 0; j < CSLogger.arrLog.length; j++) {
const l = CSLogger.arrLog[j];
const data = encodeURIComponent(JSON.stringify(l));
- 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 status === "number" &&
status > 0 &&
typeof message === "string" &&
message.length > 0
- Create a ticketCreate a ticket
Function showMessange
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static showMessange(status: number, message: string): boolean {
if (
typeof status === "number" &&
status > 0 &&
typeof message === "string" &&
- Create a ticketCreate a ticket
Function log
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static log(status?: number,
message?: string,
properties?: any): boolean {
if (
typeof status === "number" &&
- Create a ticketCreate a ticket
Function statusLavelSentry
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static statusLavelSentry(status: number): string {
if (
typeof status === "number" &&
status > 0
) {
- 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 init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static init(settings) {
if (typeof settings === "object") {
for (const prop in settings) {
if (settings.hasOwnProperty(prop)) {
CSLogger.settings[prop] = settings[prop];
- 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 statusLavelConsole
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static statusLavelConsole(status: number): string {
if (
typeof status === "number" &&
status > 0
) {
- 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 too many return
statements within this function. Open
return "";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "debug";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "debug";
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "";
- Create a ticketCreate a ticket
Function showMessange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static showMessange(status: number, message: string): boolean {
if (
typeof status === "number" &&
status > 0 &&
typeof message === "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
Function log
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static log(status?: number,
message?: string,
properties?: any): boolean {
if (
typeof status === "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"