Inlife/nexrender

View on GitHub

Showing 51 of 75 total issues

File commandLineRenderer-2022.jsx has 778 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module.exports = /*syntax:js*/ `// Command line renderer for After Effects. (nexrender-patch-v1.0.4)

// This function constructs an AECommandLineRenderer object.
// One and only one of these will be created to perform rendering tasks
// at the end of this file.
Severity: Major
Found in packages/nexrender-core/src/assets/commandLineRenderer-2022.jsx - About 1 day to fix

    File commandLineRenderer-default.jsx has 697 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module.exports = /*syntax:js*/ `// Command line renderer for After Effects. (nexrender-patch-v1.0.3)
    
    // This function constructs an AECommandLineRenderer object.
    // One and only one of these will be created to perform rendering tasks
    // at the end of this file.
    Severity: Major
    Found in packages/nexrender-core/src/assets/commandLineRenderer-default.jsx - About 1 day to fix

      Function createWorker has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
      Open

      const createWorker = () => {
          let emptyReturns = 0;
          let active = false;
          let settingsRef = null;
      
      
      Severity: Minor
      Found in packages/nexrender-worker/src/instance.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

      Function exports has 237 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = (job, settings) => {
          settings.logger.log(`[${job.uid}] rendering job...`);
      
          // create container for our parameters
          let params = [];
      Severity: Major
      Found in packages/nexrender-core/src/tasks/render.js - About 1 day to fix

        Function exports has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = (job, settings) => {
            settings.logger.log(`[${job.uid}] rendering job...`);
        
            // create container for our parameters
            let params = [];
        Severity: Minor
        Found in packages/nexrender-core/src/tasks/render.js - About 7 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 createWorker has 142 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const createWorker = () => {
            let emptyReturns = 0;
            let active = false;
            let settingsRef = null;
        
        
        Severity: Major
        Found in packages/nexrender-worker/src/instance.js - About 5 hrs to fix

          Function track has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

          const track = async (settings, event, properties = {}) => {
              // if (isRemote) console.log('tracking', event, properties, settings)
          
              if (settings.noAnalytics === true) return;
          
          
          Severity: Minor
          Found in packages/nexrender-core/src/helpers/analytics.js - About 5 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 download has 105 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const download = (job, settings, asset) => {
              if (asset.type == 'data') return Promise.resolve();
          
              // eslint-disable-next-line
              const uri = global.URL ? new URL(asset.src) : url.parse(asset.src)
          Severity: Major
          Found in packages/nexrender-core/src/tasks/download.js - About 4 hrs to fix

            Function download has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
            Open

            const download = (job, settings, asset) => {
                if (asset.type == 'data') return Promise.resolve();
            
                // eslint-disable-next-line
                const uri = global.URL ? new URL(asset.src) : url.parse(asset.src)
            Severity: Minor
            Found in packages/nexrender-core/src/tasks/download.js - About 4 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 createClient has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            const createClient = ({ host, secret, polling, headers, name }) => {
                if (localFetch.default) {
                    localFetch = localFetch.default
                }
            
            
            Severity: Minor
            Found in packages/nexrender-api/src/index.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

            Function start has 97 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                const start = async (host, secret, settings, headers) => {
                    settings = init(Object.assign({
                        process: 'nexrender-worker',
                        stopOnError: false,
                        logger: console,
            Severity: Major
            Found in packages/nexrender-worker/src/instance.js - About 3 hrs to fix

              Function exports has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = (settings) => {
                  const targetScript  = 'commandLineRenderer.jsx';
              
                  const patched      = getContentForPatch(settings.binary)
                  const afterEffects = path.dirname(settings.binary)
              Severity: Minor
              Found in packages/nexrender-core/src/helpers/patch.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

              Function track has 78 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const track = async (settings, event, properties = {}) => {
                  // if (isRemote) console.log('tracking', event, properties, settings)
              
                  if (settings.noAnalytics === true) return;
              
              
              Severity: Major
              Found in packages/nexrender-core/src/helpers/analytics.js - About 3 hrs to fix

                Function init has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const init = (settings) => {
                    settings = Object.assign({}, settings);
                    settings.logger = settings.logger || console;
                    settings.track = (...args) => track(settings, ...args);
                    settings.trackCombined = (event, params) => track(settings, event, { combined: true, ...params });
                Severity: Major
                Found in packages/nexrender-core/src/index.js - About 2 hrs to fix

                  Function exports has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = (settings) => {
                      const targetScript  = 'commandLineRenderer.jsx';
                  
                      const patched      = getContentForPatch(settings.binary)
                      const afterEffects = path.dirname(settings.binary)
                  Severity: Major
                  Found in packages/nexrender-core/src/helpers/patch.js - About 2 hrs to fix

                    Function exports has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = (job, settings, { input, provider, params, ...options }, type) => {
                        let onProgress;
                        let onComplete;
                    
                        if (type != 'postrender') {
                    Severity: Minor
                    Found in packages/nexrender-action-upload/index.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 upload has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const upload = (job, settings, src, params, onProgress, onComplete) => {
                        const file = fs.createReadStream(src);
                    
                        if (!params.endpoint && !params.region) {
                            return Promise.reject(new Error('S3 region or endpoint not provided.'))
                    Severity: Major
                    Found in packages/nexrender-provider-s3/src/index.js - About 2 hrs to fix

                      File render.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      const fs = require('fs')
                      const path = require('path')
                      const {spawn} = require('child_process')
                      const {expandEnvironmentVariables, checkForWSL} = require('../helpers/path')
                      
                      
                      Severity: Minor
                      Found in packages/nexrender-core/src/tasks/render.js - About 2 hrs to fix

                        Function upload has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const upload = (job, settings, src, params) => {
                            if (!params.bucket) {
                                return Promise.reject(new Error('GCS bucket not provided.'))
                            }
                            if (!params.item) {
                        Severity: Minor
                        Found in packages/nexrender-provider-gs/src/index.js - About 1 hr to fix

                          Function getBinary has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const getBinary = (job, settings) => {
                              return new Promise((resolve, reject) => {
                                  const {version} = pkg['ffmpeg-static']
                                  const filename = `ffmpeg-${version}${process.platform == 'win32' ? '.exe' : ''}`
                                  const fileurl = `https://github.com/eugeneware/ffmpeg-static/releases/download/${version}/${process.platform}-x64`
                          Severity: Minor
                          Found in packages/nexrender-action-encode/index.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language