private-dreamnet/dreamtime

View on GitHub

Showing 149 of 149 total issues

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

            this.process.on('stderr', (output) => {
              const text = toString(output)
      
              // DreamPower errors.
              this.addCliLine({
      Severity: Major
      Found in src/modules/nudify/photo-run.js and 1 other location - About 3 hrs to fix
      src/modules/nudify/photo-run.js on lines 578..595

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 107.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

            this.process.on('stderr', (outputMessage) => {
              const text = toString(outputMessage)
      
              // Errors.
              this.addCliLine({
      Severity: Major
      Found in src/modules/nudify/photo-run.js and 1 other location - About 3 hrs to fix
      src/modules/nudify/photo-run.js on lines 483..500

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 107.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

              get platform() {
                let platform = super.platform
            
                if (platform === 'macos' || settings.preferences.advanced.device === 'CPU') {
                  platform = `${platform}-cpuonly`
            Severity: Major
            Found in src/modules/updater/dreampower.js and 1 other location - About 2 hrs to fix
            src/modules/updater/waifu.js on lines 40..50

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 93.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

              get platform() {
                let platform = super.platform
            
                if (platform === 'macos' || settings.preferences.advanced.device === 'CPU') {
                  platform = `${platform}-cpuonly`
            Severity: Major
            Found in src/modules/updater/waifu.js and 1 other location - About 2 hrs to fix
            src/modules/updater/dreampower.js on lines 40..50

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 93.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            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

                  Function download has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function download(url, options = {}) {
                    const events = new EventEmitter()
                  
                    let cancelled = false
                  
                  
                  Severity: Major
                  Found in src/electron/src/modules/tools/fs.js - About 2 hrs to fix

                    Function setup has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      static async setup() {
                        if (process.platform === 'darwin') {
                          if (!process.env.BUILD_PORTABLE && !process.env.DISABLE_ENFORCE_APP_LOCATION) {
                            const { enforceMacOSAppLocation } = require('electron-util')
                    
                    
                    Severity: Major
                    Found in src/electron/src/index.js - About 2 hrs to fix

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                        process.stdout.on('data', (output) => {
                          logger.info(output.toString())
                          const stdout = output.toString().trim().split('\n')
                          events.emit('stdout', null, stdout)
                        })
                      Severity: Major
                      Found in src/electron/src/modules/tools/waifu.js and 1 other location - About 2 hrs to fix
                      src/electron/src/modules/tools/power.js on lines 69..73

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 82.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                        process.stdout.on('data', (output) => {
                          logger.info(output.toString())
                          const stdout = output.toString().trim().split('\n')
                          events.emit('stdout', null, stdout)
                        })
                      Severity: Major
                      Found in src/electron/src/modules/tools/power.js and 1 other location - About 2 hrs to fix
                      src/electron/src/modules/tools/waifu.js on lines 63..67

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 82.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      File index.js has 259 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/electron/src/index.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language