alexstep/create-riot-app-ejected

View on GitHub

Showing 8 of 26 total issues

Function exports has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function () {
  console.groupCollapsed('SW::Cache')
  const CACHE_NAME = '_cache_' + ((new Date()).toISOString())

  console.log('SW::Cache CACHE_NAME:', CACHE_NAME)
Severity: Major
Found in src/model/ServiceWorker/cache.sw.js - About 3 hrs to fix

    Function pan has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

      pan (e) {
        if (e.pointerType !== 'touch' || e.center.x <= 0 || [2,4].indexOf(e.direction) < 0) {
          return
        }
        if (!this.panning && e.pointers[0].clientX > this.handler_width && !this.drawer_open) {
    Severity: Minor
    Found in src/view/components/drawer/swipe.js - About 2 hrs 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 pan has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      pan (e) {
        if (e.pointerType !== 'touch' || e.center.x <= 0 || [2,4].indexOf(e.direction) < 0) {
          return
        }
        if (!this.panning && e.pointers[0].clientX > this.handler_width && !this.drawer_open) {
    Severity: Minor
    Found in src/view/components/drawer/swipe.js - About 1 hr to fix

      Function exports has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function (conf) {
        let sounds_path = conf.sounds_path ? conf.sounds_path : '/sounds/'
      
        let sounds = {}
      
      
      Severity: Minor
      Found in src/view/sounds.js - About 1 hr to fix

        Function resource has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              .then((response) => {
                if (response) {
                  console.log(`Cache [SW] fetch URL ${requestUrl.href} from cache`)
        
                  return response
        Severity: Minor
        Found in src/model/ServiceWorker/cache.sw.js - About 1 hr to fix

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

          module.exports = function () {
            self.addEventListener('message', (event) => {
              if (event.data && event.data.pushEnabled) {
                self.registration.showNotification(
                  'Notifications enbaled',
          Severity: Minor
          Found in src/model/ServiceWorker/push.sw.js - About 1 hr to fix

            Function topbarScrollHide has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              topbarScrollHide () {
                $(window).scrollTop(0)
            
                if ($(window).width() > 800) {
                  return false
            Severity: Minor
            Found in src/view/app.view.js - About 1 hr to fix

              Function exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = function (conf) {
                let sounds_path = conf.sounds_path ? conf.sounds_path : '/sounds/'
              
                let sounds = {}
              
              
              Severity: Minor
              Found in src/view/sounds.js - About 55 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