ileri/l-system

View on GitHub

Showing 5 of 7 total issues

Function default has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function(ctx, step, angle, startAngle, startLength, lengthChange) {
    angle = degToRad(angle);

    var pos = new Vector(10, 10),
        stack = [],
Severity: Minor
Found in examples/fractal-plant.js - About 1 hr to fix

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

      constructor (axiom, productionRules) {
        if (!(Symbol.iterator in productionRules)) {
          throw new Error('LSystem: productionRules (argument 1) must be iterable')
        }
    
    
    Severity: Minor
    Found in l-system.js - 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 default has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function(ctx, step, angle, startAngle, startLength, lengthChange) {
        angle = degToRad(angle);
    
        var pos = new Vector(10, 10),
            stack = [],
    Severity: Minor
    Found in examples/fractal-plant.js - 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 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      constructor (axiom, productionRules) {
        if (!(Symbol.iterator in productionRules)) {
          throw new Error('LSystem: productionRules (argument 1) must be iterable')
        }
    
    
    Severity: Minor
    Found in l-system.js - About 1 hr to fix

      Function default has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      export default function(ctx, step, angle, startAngle, startLength, lengthChange) {
      Severity: Minor
      Found in examples/fractal-plant.js - About 45 mins to fix
        Severity
        Category
        Status
        Source
        Language