CrazySquirrel/UniqueTransport

View on GitHub

Showing 65 of 96 total issues

Function decodeSync has a Cognitive Complexity of 6 (exceeds 5 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("@"));
Severity: Minor
Found in lib/ts/server.ts - About 25 mins to fix

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 getHostFromHeaderHost has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  public getHostFromHeaderHost(request, params) {
    if (request.headers.host) {
      let origin;

      if (request.headers.host.indexOf("http") === -1) {
Severity: Minor
Found in lib/ts/server.ts - About 25 mins to fix

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 responceError has a Cognitive Complexity of 6 (exceeds 5 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"]);
Severity: Minor
Found in lib/ts/server.ts - About 25 mins to fix

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 getHostFromHeaderReferer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  public getHostFromHeaderReferer(request, params) {
    if (request.headers.referer) {
      let origin;

      if (request.headers.referer.indexOf("http") === -1) {
Severity: Minor
Found in lib/ts/server.ts - About 25 mins to fix

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 getHostFromHeaderOrigin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  public getHostFromHeaderOrigin(request, params) {
    if (request.headers.origin) {
      let origin;

      if (request.headers.origin.indexOf("http") === -1) {
Severity: Minor
Found in lib/ts/server.ts - About 25 mins to fix

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

Severity
Category
Status
Source
Language