VsevolodTrofimov/Ripple.js

View on GitHub

Showing 6 of 39 total issues

Function show has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  show(target, event) {
    // setup
    let self = this
    let rect = this.getRect(target)

Severity: Minor
Found in src/ripple.js - About 1 hr to fix

    Function getFirstObjectExp has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    function getFirstObjectExp(str) {
      var opened = 0,
          started = false,
          comment = false,
          obj = "";
    Severity: Minor
    Found in docs/demo.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 hadlerFactory has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function hadlerFactory(el, rippleFactory) {
      // scoping
      return function () {
        let ripples = []
        let startTimeDate = undefined
    Severity: Minor
    Found in src/binders.js - About 1 hr to fix

      Function watch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function watch(selector = "*", rippleFactory, scope = document) {
        let handle = hadlerFactory(scope, rippleFactory)
      
        let startAdapter = function(event) {
          let el = event.target
      Severity: Minor
      Found in src/binders.js - About 1 hr to fix

        Function watch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function watch(selector = "*", rippleFactory, scope = document) {
          let handle = hadlerFactory(scope, rippleFactory)
        
          let startAdapter = function(event) {
            let el = event.target
        Severity: Minor
        Found in src/binders.js - About 45 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 show has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          show(target, event) {
            // setup
            let self = this
            let rect = this.getRect(target)
        
        
        Severity: Minor
        Found in src/ripple.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

        Severity
        Category
        Status
        Source
        Language