henrikrudstrom/oce-wrap

View on GitHub

Showing 33 of 52 total issues

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

module.exports = function(gulp) {
  const fs = require('fs');
  const run = require('gulp-run');
  const path = require('path');
  const mkdirp = require('mkdirp');
Severity: Major
Found in tasks/gyp.js - About 5 hrs to fix

    Function dependencyReader has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

    function dependencyReader(mods) {
      var cache = {};
    
      // return the type names that class member depends on
      function memberDepends(mem) {
    Severity: Minor
    Found in src/dependencies.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 exports has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(gulp) {
      const path = require('path');
      const fs = require('fs');
      const mkdirp = require('mkdirp');
      const async = require('async');
    Severity: Major
    Found in tasks/swig.js - About 3 hrs to fix

      Function dependencyReader has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function dependencyReader(mods) {
        var cache = {};
      
        // return the type names that class member depends on
        function memberDepends(mem) {
      Severity: Major
      Found in src/dependencies.js - About 2 hrs to fix

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

        module.exports = function(gulp) {
          const runSequence = require('run-sequence').use(gulp);
          const rename = require('gulp-rename');
        
          require('./parse.js')(gulp);
        Severity: Major
        Found in tasks/main.js - About 2 hrs to fix

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

          module.exports = function(gulp) {
            const render = require('../src/render.js');
            const settings = require('../src/settings.js');
            const testLib = require('../src/testLib');
          
          
          Severity: Major
          Found in tasks/test.js - About 2 hrs to fix

            Function moduleQuery has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            function moduleQuery(mods) {
              if (typeof mods === 'string') {
                mods = glob.sync(`${mods}/*.json`).map(file =>
                  JSON.parse(fs.readFileSync(file))
                );
            Severity: Minor
            Found in src/modules.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 exports has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(gulp) {
              const fs = require('fs');
              const path = require('path');
              const mkdirp = require('mkdirp');
              const yargs = require('yargs');
            Severity: Major
            Found in tasks/parse.js - About 2 hrs to fix

              Function moduleQuery has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function moduleQuery(mods) {
                if (typeof mods === 'string') {
                  mods = glob.sync(`${mods}/*.json`).map(file =>
                    JSON.parse(fs.readFileSync(file))
                  );
              Severity: Minor
              Found in src/modules.js - About 1 hr to fix

                Function classDepends has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function classDepends(cls, options, visited) {
                    options = options || {};
                    var firstCall = false;
                    if (visited === undefined) {
                      firstCall = true;
                Severity: Minor
                Found in src/dependencies.js - About 1 hr to fix

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

                  module.exports = function(gulp) {
                    const fs = require('fs');
                    const run = require('gulp-run');
                    const path = require('path');
                    const mkdirp = require('mkdirp');
                  Severity: Minor
                  Found in tasks/gyp.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 processInclude has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function processInclude(decl, parent) {
                    var newDecl;
                    if (decl.declarations) {
                      newDecl = new Conf(decl, parent.name);
                      newDecl.key = decl.name; //TODO: get rid of .key
                  Severity: Minor
                  Found in src/conf.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 renderHeaders has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function renderHeaders(decl) {
                    const modules = require('../modules.js')();
                    var reader = require('../dependencies.js')(modules);
                  
                    if (decl.declType !== 'module') return false;
                  Severity: Minor
                  Found in src/features/headers.js - About 1 hr to fix

                    Function includeAsStatic has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function includeAsStatic(expr, template, valueFunc, returnType) {
                      var clsName = expr.split('(')[0];
                      var cls = headers.get(clsName);
                    
                      if (!returnType) {
                    Severity: Minor
                    Found in src/features/asStatic.js - About 1 hr to fix

                      Function renderArgouts has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function renderArgouts(decl) {
                        if (!decl.arguments)
                          return false;
                      
                        var argouts = decl.origArguments.filter(arg => arg.outArg);
                      Severity: Minor
                      Found in src/features/argout.js - About 1 hr to fix

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

                        function property(getter, setter, name) {
                          this.pushQuery(4, getter, (getMethod) => {
                            if (getMethod.declType === 'constructor') return false;
                            if (typeof setter === 'string') {
                              var setterStr = setter;
                        Severity: Minor
                        Found in src/features/property.js - About 1 hr to fix

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

                          function processInclude(decl, parent) {
                            var newDecl;
                            if (decl.declarations) {
                              newDecl = new Conf(decl, parent.name);
                              newDecl.key = decl.name; //TODO: get rid of .key
                          Severity: Minor
                          Found in src/conf.js - About 1 hr to fix

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

                            function renderObjectOutmap(decl, fullSig) {
                              var values = decl.origArguments.filter(arg => arg.outArg);
                            
                              var assignArgs = values
                                .map((arg, index) => {
                            Severity: Minor
                            Found in src/features/argout.js - About 1 hr to fix

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

                              function initialize(settings) {
                                var fileSettings = {};
                                if (fs.existsSync('settings.json'))
                                  fileSettings = JSON.parse(fs.readFileSync('settings.json'));
                              
                              
                              Severity: Minor
                              Found in src/settings.js - About 1 hr to fix

                                Function renderModuleSwig has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function renderModuleSwig(decl, parts) {
                                  if (decl.declType !== 'module')
                                    return false;
                                
                                  function includeIfExists(name) {
                                Severity: Minor
                                Found in src/features/module.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language