private-dreamnet/dreamtime

View on GitHub

Showing 149 of 149 total issues

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

  get algorithmActiveLabel() {
    switch (this.algorithmActive) {
      case ALGORITHM.NONE:
      default:
        return 'Loading'
Severity: Major
Found in src/modules/nudify/photo-run.js and 1 other location - About 1 hr to fix
src/modules/nudify/photo-run.js on lines 193..208

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 62.

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

  get algorithmActiveTooltip() {
    switch (this.algorithmActive) {
      case ALGORITHM.NONE:
      default:
        return ''
Severity: Major
Found in src/modules/nudify/photo-run.js and 1 other location - About 1 hr to fix
src/modules/nudify/photo-run.js on lines 176..191

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 62.

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

  set(path, payload) {
    if (isPlainObject(path)) {
      this.payload = path
    } else {
      this.payload = set(this.payload, path, payload)
Severity: Major
Found in src/electron/src/modules/services/base.js and 1 other location - About 1 hr to fix
src/modules/system/settings.js on lines 60..68

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 61.

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

  set(path, payload) {
    if (isPlainObject(path)) {
      this.payload = path
    } else {
      this.payload = set(this.payload, path, payload)
Severity: Major
Found in src/modules/system/settings.js and 1 other location - About 1 hr to fix
src/electron/src/modules/services/base.js on lines 155..163

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 61.

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 getMetadata has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function getMetadata(filepath) {
  const exists = existsSync(filepath)

  const workload = [
    Promise.resolve(mime.lookup(filepath)),
Severity: Minor
Found in src/workers/fs/worker.js - About 1 hr to fix

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

        this.queue.on('task_added', (photo) => {
          photo.onQueue()
    
          consola.debug(`๐Ÿ“ท Photo added: ${photo.file.fullname}`)
        })
    Severity: Major
    Found in src/modules/nudify/queue.js and 1 other location - About 1 hr to fix
    src/modules/nudify/queue.js on lines 38..42

    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 60.

    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.queue.on('task_started', (photo) => {
          photo.onStart()
    
          consola.debug(`๐Ÿš— Photo started: ${photo.file.fullname}`)
        })
    Severity: Major
    Found in src/modules/nudify/queue.js and 1 other location - About 1 hr to fix
    src/modules/nudify/queue.js on lines 32..36

    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 60.

    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.queue.on('task_finished', (run) => {
          run.onFinish()
    
          this.consola.debug(`๐Ÿ Run finished: #${run.id}`)
        })
    Severity: Major
    Found in src/modules/nudify/photo.js and 1 other location - About 1 hr to fix
    src/modules/nudify/photo.js on lines 668..672

    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 60.

    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.queue.on('task_started', (run) => {
          run.onStart()
    
          this.consola.debug(`๐Ÿš— Run started: #${run.id}`)
        })
    Severity: Major
    Found in src/modules/nudify/photo.js and 1 other location - About 1 hr to fix
    src/modules/nudify/photo.js on lines 674..678

    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 60.

    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 run has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export async function run(args, events) {
      const process = exec(args)
      let cancelled = false
    
      process.on('error', (error) => {
    Severity: Minor
    Found in src/electron/src/modules/tools/waifu.js - About 1 hr to fix

      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 canShowGenerate has 31 lines of code (exceeds 25 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 1 hr to fix

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

            async init() {
              if (dreamtrack.enabled) {
                this.data = dreamtrack.get('projects.dreamtime', this.data)
              }
          
          
          Severity: Major
          Found in src/modules/projects/dreamtime.js and 1 other location - About 1 hr to fix
          src/modules/projects/waifu.js on lines 49..55

          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 59.

          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

            async init() {
              if (dreamtrack.enabled) {
                this.data = dreamtrack.get('projects.waifu', this.data)
              }
          
          
          Severity: Major
          Found in src/modules/projects/waifu.js and 1 other location - About 1 hr to fix
          src/modules/projects/dreamtime.js on lines 57..63

          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 59.

          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 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
                    Severity
                    Category
                    Status
                    Source
                    Language