private-dreamnet/dreamtime

View on GitHub

Showing 75 of 149 total issues

Function nudify has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export async function nudify(args, events) {
  const process = exec(args)
  let cancelled = false

  process.on('error', (error) => {
Severity: Minor
Found in src/electron/src/modules/tools/power.js - About 1 hr to fix

    Function setup has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    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.')
    Severity: Minor
    Found in src/modules/updater/base.js - About 1 hr to fix

      Function parseArgs has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        parseArgs(args) {
          args.forEach((value) => {
            if (isNil(value)) {
              // YEP
            } else if (value instanceof Logger.Logger) {
      Severity: Minor
      Found in src/modules/consola/log.js - About 1 hr to fix

        Function nextMask has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          get nextMask() {
            const { scaleMode, useColorPaddingRemoval } = this.photo
            const { waifu } = this.photo.preferences.advanced
        
            switch (this.id) {
        Severity: Minor
        Found in src/modules/nudify/photo-mask.js - About 1 hr to fix

          Function install has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            async install(filepath) {
              const powerPath = getPowerPath()
          
              // Removing the previous installation
              try {
          Severity: Minor
          Found in src/modules/updater/dreampower.js - About 1 hr 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 config has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            get config() {
              return {
                accessToken: this.accessToken,
                captureUncaught: false,
                captureUnhandledRejections: false,
          Severity: Minor
          Found in src/modules/services/rollbar.js - About 1 hr to fix

            Function extractSeven has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function extractSeven(path, destinationPath) {
              const { is, platform } = require('electron-util')
              const { extractFull } = require('node-7z')
            
              const def = deferred()
            Severity: Minor
            Found in src/electron/src/modules/tools/fs.js - About 1 hr to fix

              Function add has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                add(file, params = {}) {
                  const photo = new Photo(file, params)
              
                  if (!settings.app.duplicates) {
                    const exists = this.getPhotoById(photo.id)
              Severity: Minor
              Found in src/modules/nudify/nudify.js - About 55 mins 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 nextMask has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                get nextMask() {
                  const { scaleMode, useColorPaddingRemoval } = this.photo
                  const { waifu } = this.photo.preferences.advanced
              
                  switch (this.id) {
              Severity: Minor
              Found in src/modules/nudify/photo-mask.js - About 55 mins 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 getMasksPath has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              export const getMasksPath = (...args) => {
                let folder
              
                if (process.env.BUILD_PORTABLE) {
                  folder = getPath('temp')
              Severity: Minor
              Found in src/electron/src/modules/tools/paths.js - About 45 mins 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 report has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                async report() {
                  if (this.reported) {
                    return this
                  }
              
              
              Severity: Minor
              Found in src/modules/consola/log.js - About 45 mins 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 transform has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              export const transform = (photoPreferences, input, output) => {
                if (!output) {
                  output = input
                }
              
              
              Severity: Minor
              Found in src/electron/src/modules/tools/waifu.js - About 35 mins 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 _getLatestCompatible has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                _getLatestCompatible(releases) {
                  const currentVersion = `v${process.env.npm_package_version}`
              
                  const minimum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'minimum'], 'v1.2.10')
                  const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'maximum'])
              Severity: Minor
              Found in src/modules/updater/dreampower.js - About 35 mins 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 _getLatestCompatible has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                _getLatestCompatible(releases) {
                  const currentVersion = `v${process.env.npm_package_version}`
              
                  const minimum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'waifu', 'minimum'], 'v0.1.0')
                  const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'waifu', 'maximum'])
              Severity: Minor
              Found in src/modules/updater/waifu.js - About 35 mins 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 install has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                async install(filepath) {
                  const waifuPath = getWaifuPath()
              
                  // Removing the previous installation
                  try {
              Severity: Minor
              Found in src/modules/updater/waifu.js - About 35 mins 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 make has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                static make() {
                  return new Proxy(new this(), {
                    get: (obj, prop) => {
                      if (prop in obj) {
                        return obj[prop]
              Severity: Minor
              Found in src/modules/services/base.js - About 35 mins 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 download has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              export function download(url, options = {}) {
                const events = new EventEmitter()
              
                let cancelled = false
              
              
              Severity: Minor
              Found in src/electron/src/modules/tools/fs.js - About 35 mins 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 canShowGenerate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                get canShowGenerate() {
                  const { scaleMode, useColorPaddingRemoval } = this.photo
              
                  switch (this.id) {
                    case STEP.CORRECT:
              Severity: Minor
              Found in src/modules/nudify/photo-mask.js - About 35 mins 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 boot has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                static async boot() {
                  const logDir = getPath('userData', 'logs', new Date().toJSON().slice(0, 10))
                  fs.ensureDirSync(logDir)
              
                  // logger setup
              Severity: Minor
              Found in src/electron/src/index.js - About 35 mins 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

              Avoid too many return statements within this function.
              Open

                  return scaleMode
              Severity: Major
              Found in src/modules/nudify/photo.js - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language