private-dreamnet/dreamtime

View on GitHub

Showing 75 of 149 total issues

Avoid too many return statements within this function.
Open

    return
Severity: Major
Found in src/middleware/wizard.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return true
    Severity: Major
    Found in src/modules/system/requirements.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return 'auto-rescale'
      Severity: Major
      Found in src/modules/nudify/photo.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return true
        Severity: Major
        Found in src/modules/system/requirements.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return this.photo.masks.nude.exists
          Severity: Major
          Found in src/modules/nudify/photo-mask.js - About 30 mins to fix

            Function constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              constructor(input, options = {}) {
                if (isString(input)) {
                  super(input)
                } else if (isError(input)) {
                  super(input.message)
            Severity: Minor
            Found in src/electron/src/modules/app-error.js - About 25 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 getCropPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

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

              get _hasCheckpoints() {
                const dirpath = getCheckpointsPath()
            
                if (!fs.existsSync(dirpath)) {
                  return false
            Severity: Minor
            Found in src/modules/system/requirements.js - About 25 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 handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              static handle(error, level = 'error') {
                let appError = error
            
                if (!(error instanceof AppError)) {
                  let exception
            Severity: Minor
            Found in src/electron/src/modules/app-error.js - About 25 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 setupPreferences has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              setupPreferences() {
                this.preferences = cloneDeep(this.photo.preferences)
            
                const { mode } = this.preferences
            
            
            Severity: Minor
            Found in src/modules/nudify/photo-run.js - About 25 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 _getDownloadUrls has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              _getDownloadUrls() {
                let urls
                let asset
            
                try {
            Severity: Minor
            Found in src/modules/updater/base.js - About 25 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 handleError has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export function handleError(error) {
              if (error instanceof LogEvent) {
                consola.log(error.level, ...error.args).show()
                return true
              }
            Severity: Minor
            Found in src/modules/consola/errors.js - About 25 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 getTempPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

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

              _loadDefault() {
                const { v4: uuid } = require('uuid')
                const hasGPU = process.platform === 'darwin' ? false : system.graphics.length > 0
            
                this.payload = {
            Severity: Minor
            Found in src/electron/src/modules/settings.js - About 25 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

            Severity
            Category
            Status
            Source
            Language