private-dreamnet/dreamtime

View on GitHub

Showing 149 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

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

      async _hasCompatiblePower() {
        if (!this.power.installed) {
          return false
        }
    
    
    Severity: Major
    Found in src/modules/system/requirements.js and 1 other location - About 1 day to fix
    src/modules/system/requirements.js on lines 160..195

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

    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 _hasCompatibleWaifu() {
        if (!this.waifu.installed) {
          return false
        }
    
    
    Severity: Major
    Found in src/modules/system/requirements.js and 1 other location - About 1 day to fix
    src/modules/system/requirements.js on lines 123..158

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

    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 _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

            Similar blocks of code found in 2 locations. 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: Major
            Found in src/modules/updater/dreampower.js and 1 other location - About 6 hrs to fix
            src/modules/updater/waifu.js on lines 63..86

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

            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

              _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: Major
            Found in src/modules/updater/waifu.js and 1 other location - About 6 hrs to fix
            src/modules/updater/dreampower.js on lines 63..86

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

            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 _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

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

                sendNotification() {
                  if (!requirements.power.installed) {
                    return
                  }
              
              
              Severity: Major
              Found in src/modules/updater/dreampower.js and 2 other locations - About 4 hrs to fix
              src/modules/updater/checkpoints.js on lines 72..93
              src/modules/updater/waifu.js on lines 137..158

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

              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 description() {
                  switch (this.id) {
                    case STEP.CORRECT:
                      return '[OPENCV] The algorithm applies color correction to the photo to understand it more easily.<br><br><strong>NOTE:</strong> Scale and editor changes are applied here.'
              
              
              Severity: Major
              Found in src/modules/nudify/photo-mask.js and 1 other location - About 4 hrs to fix
              src/modules/nudify/photo-mask.js on lines 170..202

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

              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 3 locations. Consider refactoring.
              Open

                sendNotification() {
                  if (!requirements.waifu.installed) {
                    return
                  }
              
              
              Severity: Major
              Found in src/modules/updater/waifu.js and 2 other locations - About 4 hrs to fix
              src/modules/updater/checkpoints.js on lines 72..93
              src/modules/updater/dreampower.js on lines 141..162

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

              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 3 locations. Consider refactoring.
              Open

                sendNotification() {
                  if (!requirements.power.installed) {
                    return
                  }
              
              
              Severity: Major
              Found in src/modules/updater/checkpoints.js and 2 other locations - About 4 hrs to fix
              src/modules/updater/dreampower.js on lines 141..162
              src/modules/updater/waifu.js on lines 137..158

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

              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 title() {
                  switch (this.id) {
                    case STEP.CORRECT:
                      return 'Corrected'
              
              
              Severity: Major
              Found in src/modules/nudify/photo-mask.js and 1 other location - About 4 hrs to fix
              src/modules/nudify/photo-mask.js on lines 204..236

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

              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

              const handler = {
                get(target, property, receiver) {
                  try {
                    if (property in target) {
                      return target[property]
              Severity: Major
              Found in src/electron/src/modules/settings.js and 1 other location - About 4 hrs to fix
              src/modules/system/settings.js on lines 96..115

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

              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

              const handler = {
                get(target, property, receiver) {
                  try {
                    if (property in target) {
                      return target[property]
              Severity: Major
              Found in src/modules/system/settings.js and 1 other location - About 4 hrs to fix
              src/electron/src/modules/settings.js on lines 703..722

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

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