private-dreamnet/dreamtime

View on GitHub

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
    }

Severity: Major
Found in src/electron/src/modules/settings.js - About 1 day to fix

    Function _upgrade has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

      async _upgrade() {
        if (this.payload?.version === this._default.version) {
          return
        }
    
    
    Severity: Minor
    Found in src/electron/src/modules/settings.js - About 1 day 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

    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
    Severity: Major
    Found in src/electron/src/modules/settings.js - About 1 day to fix

      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
      Severity: Major
      Found in src/modules/nudify/photo-run.js - About 1 day to fix

        Photo has 55 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class Photo extends EventEmitter {
          /**
           * @type {string}
           */
          id
        Severity: Major
        Found in src/modules/nudify/photo.js - About 7 hrs to fix

          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
          Severity: Minor
          Found in src/modules/nudify/photo.js - About 7 hrs to fix

            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 = {
            Severity: Major
            Found in src/electron/src/modules/settings.js - About 5 hrs to fix

              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
              Severity: Minor
              Found in src/modules/updater/base.js - About 4 hrs to fix

                BaseUpdater has 32 functions (exceeds 20 allowed). Consider refactoring.
                Open

                export class BaseUpdater {
                  /**
                   * @type {boolean}
                   */
                  enabled = false
                Severity: Minor
                Found in src/modules/updater/base.js - About 4 hrs to fix

                  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) => {
                  Severity: Major
                  Found in src/modules/nudify/photo-run.js - About 3 hrs to fix

                    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'
                    Severity: Minor
                    Found in src/electron/src/modules/tools/fs.js - About 3 hrs to fix

                      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') {
                      Severity: Minor
                      Found in src/middleware/wizard.js - About 3 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

                      PhotoRun has 29 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      export class PhotoRun {
                        /**
                         * @type {string}
                         */
                        id
                      Severity: Minor
                      Found in src/modules/nudify/photo-run.js - About 3 hrs to fix

                        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)
                        Severity: Major
                        Found in src/electron/src/modules/tools/power.js - About 3 hrs to fix

                          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
                          Severity: Major
                          Found in src/electron/src/modules/tools/fs.js - About 3 hrs to fix

                            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 = {}
                            Severity: Minor
                            Found in src/electron/src/modules/tools/system.js - About 3 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

                            File has 24 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            export class File extends EventEmitter {
                              /**
                               * File name without extension.
                               * @type {string}
                               */
                            Severity: Minor
                            Found in src/modules/file.js - About 2 hrs to fix

                              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,
                              Severity: Major
                              Found in src/electron/src/modules/tools/power.js - About 2 hrs to fix

                                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)
                                Severity: Minor
                                Found in src/electron/src/modules/tools/power.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 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) => {
                                Severity: Major
                                Found in src/modules/nudify/photo-run.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language