apuliasoft/j2se-js

View on GitHub

Showing 7 of 53 total issues

Jint has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

export class Jint implements JEquality<Jchar | Jint | Jdouble>,
                             JRelational<Jchar | Jint | Jdouble>,
                             JUnary<Jint>,
                             JArithmetic<Jchar | Jint | Jdouble, Jint | Jdouble> {

Severity: Minor
Found in packages/java.lang/src/jint_primitive.ts - About 2 hrs to fix

    Function constructor has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      public constructor(...args: any[]) {
        super();
    
        switch (args.length) {
          case 4:
    Severity: Minor
    Found in packages/java.lang/src/jthrowable.ts - About 1 hr 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 constructor has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public constructor(...args: any[]) {
        super();
    
        switch (args.length) {
          case 4:
    Severity: Minor
    Found in packages/java.lang/src/jthrowable.ts - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

          if (!value.match(longRegex) &&
            !value.match(doubleRegex) &&
            !value.match(floatRegex) &&
            !value.match(hexRegex) &&
            !value.match(binaryRegex) &&
      Severity: Major
      Found in packages/java.lang/src/jdouble_primitive.ts - About 40 mins to fix

        Function validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          private static validate(value: string | Jint) {
            if (typeof value === 'string') {
              if (value.length > 1) {
                throw Error('incompatible types: string cannot be converted to char');
              }
        Severity: Minor
        Found in packages/java.lang/src/jchar_primitive.ts - About 35 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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          public constructor(value: string | Jchar = '0') {
            this._values = new Int32Array(1);
        
            let isNegative = false;
            if (typeof value === 'string') {
        Severity: Minor
        Found in packages/java.lang/src/jint_primitive.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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          public constructor(value: string | Jchar = '0.0') {
            let isNegative = false;
            if (typeof value === 'string') {
              value = value.replace(/^\+/, '');
              isNegative = value.charAt(0) === '-';
        Severity: Minor
        Found in packages/java.lang/src/jdouble_primitive.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