Showing 8 of 26 total issues
Function exports
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function () {
console.groupCollapsed('SW::Cache')
const CACHE_NAME = '_cache_' + ((new Date()).toISOString())
console.log('SW::Cache CACHE_NAME:', CACHE_NAME)
Function pan
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
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) {
- Read upRead up
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
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) {
Function exports
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (conf) {
let sounds_path = conf.sounds_path ? conf.sounds_path : '/sounds/'
let sounds = {}
Function resource
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
.then((response) => {
if (response) {
console.log(`Cache [SW] fetch URL ${requestUrl.href} from cache`)
return response
Function exports
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function () {
self.addEventListener('message', (event) => {
if (event.data && event.data.pushEnabled) {
self.registration.showNotification(
'Notifications enbaled',
Function topbarScrollHide
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
topbarScrollHide () {
$(window).scrollTop(0)
if ($(window).width() > 800) {
return false
Function exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (conf) {
let sounds_path = conf.sounds_path ? conf.sounds_path : '/sounds/'
let sounds = {}
- Read upRead up
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"