arrowjs/ArrowjsCore

View on GitHub

Showing 80 of 80 total issues

Function arrayMethod has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        let arrayMethod = Object.keys(componentRouteSetting[path_name]).filter(function (method) {
            if (componentRouteSetting[path_name][method].name) {
                arrow._arrRoutes[componentRouteSetting[path_name][method].name] = path.normalize(prefix + routePath);
            }
            //handle function
Severity: Major
Found in libs/ArrowApplication.js - About 2 hrs to fix

    Function parseConfig_Structure has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function parseConfig_Structure(obj, key, level) {
        let newObj = {};
        let wrapArray = [];
        if (_.isArray(obj)) {
            wrapArray = obj;
    Severity: Major
    Found in libs/buildStructure.js - About 2 hrs to fix

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

          try {
              fs.accessSync(__base + 'config/passport.js');
          } catch (err) {
              /* istanbul ignore else */
              if (err.code === 'ENOENT') {
      Severity: Major
      Found in libs/global_function.js and 2 other locations - About 2 hrs to fix
      libs/global_function.js on lines 361..370
      libs/global_function.js on lines 373..382

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

      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

          try {
              fs.accessSync(__base + 'config/express.js');
          } catch (err) {
              /* istanbul ignore else */
              if (err.code === 'ENOENT') {
      Severity: Major
      Found in libs/global_function.js and 2 other locations - About 2 hrs to fix
      libs/global_function.js on lines 361..370
      libs/global_function.js on lines 385..394

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

      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

          try {
              fs.accessSync(__base + 'config/session.js');
          } catch (err) {
              /* istanbul ignore else */
              if (err.code === 'ENOENT') {
      Severity: Major
      Found in libs/global_function.js and 2 other locations - About 2 hrs to fix
      libs/global_function.js on lines 373..382
      libs/global_function.js on lines 385..394

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

      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

                          if (func.async) {
                              env.addGlobal(func.name, function () {
                                  var argsAsArray = Array.prototype.slice.call(arguments);
                                  return func.handler.bind.apply(func.handler, [null].concat(argsAsArray))
                              })
      Severity: Major
      Found in libs/global_function.js and 1 other location - About 2 hrs to fix
      libs/global_function.js on lines 136..143

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

      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

                          if (func.async) {
                              env.addGlobal(func.name, function () {
                                  var argsAsArray = Array.prototype.slice.call(arguments);
                                  return func.handler.bind.apply(func.handler, [null].concat(argsAsArray))
                              })
      Severity: Major
      Found in libs/global_function.js and 1 other location - About 2 hrs to fix
      libs/global_function.js on lines 109..116

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

      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

                      if (miniPath[0] === path.sep) {
                          normalizePath = path.normalize(application.arrFolder + path.sep + miniPath);
                      } else {
                          normalizePath = path.normalize(fatherPath + path.sep + miniPath)
                      }
      Severity: Major
      Found in manager/helper/getListFile.js and 1 other location - About 2 hrs to fix
      manager/helper/getListFolder.js on lines 21..25

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

      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

                      if (miniPath[0] === path.sep) {
                          normalizePath = path.normalize(application.arrFolder + path.sep + miniPath);
                      } else {
                          normalizePath = path.normalize(fatherPath + path.sep + miniPath)
                      }
      Severity: Major
      Found in manager/helper/getListFolder.js and 1 other location - About 2 hrs to fix
      manager/helper/getListFile.js on lines 21..25

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

      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

              if (application._config.viewExtension && view.indexOf(application._config.viewExtension) === -1 && view.indexOf(".") === -1) {
                  view += "." + application._config.viewExtension;
              }
      Severity: Major
      Found in libs/ArrowApplication.js and 1 other location - About 2 hrs to fix
      libs/ArrowApplication.js on lines 277..279

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

      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

                          if (application._config.viewExtension && view.indexOf(application._config.viewExtension) === -1 && view.indexOf(".") === -1) {
                              view += "." + application._config.viewExtension;
                          }
      Severity: Major
      Found in libs/ArrowApplication.js and 1 other location - About 2 hrs to fix
      libs/ArrowApplication.js on lines 708..710

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

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

      exports.getAllFunction = function (env, viewSetting, app) {
          let self = this;
          let basePath = path.resolve(__dirname, '..', 'templateExtends/function');
          let baseFunctionLinks = self.getGlobbedFiles(path.normalize(basePath + "/*.js"));
          baseFunctionLinks.map(function (link) {
      Severity: Minor
      Found in libs/global_function.js - About 2 hrs to fix

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

        function handlePath(pathInfo, attribute, level) {
            /* istanbul ignore else */
            if (pathInfo) {
                let singleton = handleSingleton(pathInfo.singleton);
                let folderName = handleFolder(pathInfo.folder);
        Severity: Minor
        Found in libs/buildStructure.js - About 1 hr to fix

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

              getViewFiles(componentName, name) {
                  let self = this;
                  let privateName = "_" + self.name;
                  /* istanbul ignore next */
                  let extension = self._app._config.viewExtension || "html";
          Severity: Minor
          Found in manager/SystemManager.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

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

                              arrayPart = arrayPart.map(function (key) {
                                  if (key[0] === ":") {
                                      key = key.replace(":", "");
                                      return application.getConfig(key);
                                  } else {
          Severity: Major
          Found in libs/ArrowApplication.js and 1 other location - About 1 hr to fix
          libs/ArrowApplication.js on lines 903..910

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

          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

                      arrayPart = arrayPart.map(function (key) {
                          if (key[0] === ":") {
                              key = key.replace(":", "");
                              return app.getConfig(key);
                          } else {
          Severity: Major
          Found in libs/ArrowApplication.js and 1 other location - About 1 hr to fix
          libs/ArrowApplication.js on lines 282..289

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

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

          module.exports = function actionAttribute(setting, fatherPath, component, application) {
              application.actions = application.actions || {};
              application.actions[component.name] = {};
              let files = getListFile(setting, fatherPath, application);
              if (files.type === "single") {
          Severity: Minor
          Found in manager/handleAttribute/action.js - About 1 hr to fix

            Function constructor has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                constructor(setting) {
                    //if NODE_ENV does not exist, use development by default
                    /* istanbul ignore next */
                    process.env.NODE_ENV = process.env.NODE_ENV || 'development';
            
            
            Severity: Minor
            Found in libs/ArrowApplication.js - About 1 hr to fix

              Function handleRole has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              function handleRole(application, permissions, componentName, key) {
                  let arrayPermissions = [];
                  if (_.isArray(permissions)) {
                      arrayPermissions = permissions
                  } else {
              Severity: Minor
              Found in libs/ArrowApplication.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 getAllCustomFilter has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports.getAllCustomFilter = function (env, viewSetting, app) {
                  let self = this;
              
                  let basePath = path.resolve(__dirname, '..', 'templateExtends/filter');
                  let baseFilterLinks = self.getGlobbedFiles(path.normalize(basePath + "/*.js"));
              Severity: Minor
              Found in libs/global_function.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language