bbc/unicode-bidirectional

View on GitHub

Showing 27 of 46 total issues

Function resolveIsolates has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function resolveIsolates(types, codepoints, sos, eos, level) {
Severity: Minor
Found in src/neutral/resolveIsolates.js - About 35 mins to fix

    Function en has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function en(types, run, sos, eos, level) {
    Severity: Minor
    Found in src/weak/rule/en.js - About 35 mins to fix

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

      function es(types) {
        if (types.size < 3) return types;
      
        const isNumber = t => includes(['AN', 'EN'], t);
        const first = types.take(1);
      Severity: Minor
      Found in src/weak/rule/es.js - 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 other has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      function other(ch, bidiType, index, state) {
        if (isNonFormatting(bidiType)) return state;
      
        const lastEntry = state.get('directionalStatusStack').peek();
        const lastLevel = lastEntry.get('level');
      Severity: Minor
      Found in src/paragraph/rule/other.js - 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

      Avoid too many return statements within this function.
      Open

                  return currTypes;
      Severity: Major
      Found in src/neutral/resolveBrackets.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return state;
        Severity: Major
        Found in src/neutral/bracketPairs.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return state;
          Severity: Major
          Found in src/neutral/bracketPairs.js - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language