src/modules/updater/base.js
File base.js
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// DreamTime.
// Copyright (C) DreamNet. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License 3.0 as published by
BaseUpdater
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class BaseUpdater {
/**
* @type {boolean}
*/
enabled = false
Function _downloadFrom
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_downloadFrom(url) {
this.consola.info(`Downloading update from: ${url}`)
if (this.downloadMethod === DMETHOD.IPFS) {
consola.track('DOWNLOAD_IPFS', url)
Function setup
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async setup() {
this.enabled = false
if (!system.online) {
this.error = new Warning('There is no Internet connection. Please make sure you are connected before starting.')
Function _getDownloadUrls
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
_getDownloadUrls() {
let urls
let asset
try {
- 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"