Showing 75 of 149 total issues
Function _upgrade
has 300 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _upgrade() {
if (this.payload?.version === this._default.version) {
return
}
Function _upgrade
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
async _upgrade() {
if (this.payload?.version === this._default.version) {
return
}
- 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
File settings.js
has 544 lines of code (exceeds 250 allowed). Consider refactoring. 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
File photo-run.js
has 506 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable no-control-regex */
// DreamTime.
// Copyright (C) DreamNet. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
Photo
has 55 functions (exceeds 20 allowed). Consider refactoring. Open
export class Photo extends EventEmitter {
/**
* @type {string}
*/
id
File photo.js
has 471 lines of code (exceeds 250 allowed). Consider refactoring. 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
Function _loadDefault
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadDefault() {
const { v4: uuid } = require('uuid')
const hasGPU = process.platform === 'darwin' ? false : system.graphics.length > 0
this.payload = {
File base.js
has 345 lines of code (exceeds 250 allowed). Consider refactoring. 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
export class BaseUpdater {
/**
* @type {boolean}
*/
enabled = false
Function runNudification
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
runNudification() {
this.algorithmActive = ALGORITHM.DREAMPOWER
this.algorithmStatus = ALGORITHM_STATUS.PREPARING
return new Promise((resolve, reject) => {
File fs.js
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
attempt, startsWith, merge, endsWith, toNumber,
} from 'lodash'
import { join } from 'path'
import fs from 'fs-extra'
Function default
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export default function ({ route, redirect }) {
const { wizard } = settings
if (!wizard.welcome) {
if (route.path !== '/wizard/welcome') {
- 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
PhotoRun
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
export class PhotoRun {
/**
* @type {string}
*/
id
Function transform
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const transform = (run) => {
// Photo data
const { preferences, photo } = run
logger.debug(preferences)
Function downloadFromIPFS
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function downloadFromIPFS(cid, options, events, writeStream) {
/** @type {import('ipfsd-ctl/src/ipfsd-daemon')} */
let node
let stats
let readStream
Function observeInternal
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
async observeInternal(device, ms, events) {
let stop = false
events.on('stop', () => { stop = true })
let previous = {}
- 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
File
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
export class File extends EventEmitter {
/**
* File name without extension.
* @type {string}
*/
Function getVersion
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getVersion = () => new Promise((resolve) => {
if (version) {
resolve({
status: true,
version,
Function transform
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export const transform = (run) => {
// Photo data
const { preferences, photo } = run
logger.debug(preferences)
- 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 runUpscale
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
runUpscale() {
this.algorithmActive = ALGORITHM.WAIFU2X
this.algorithmStatus = ALGORITHM_STATUS.WORKING
return new Promise((resolve, reject) => {