hypery2k/nativescript-fabric

View on GitHub

Showing 44 of 102 total issues

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

module.exports = function(config) {
    config.set({

        // base path that will be used to resolve all patterns (eg. files, exclude)
        basePath: '',
Severity: Minor
Found in demo/karma.conf.js - About 1 hr to fix

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

        async.forEachLimit = function (arr, limit, iterator, callback) {
            callback = callback || function () {};
            if (!arr.length || limit <= 0) {
                return callback();
            }
    Severity: Minor
    Found in src/lib/postinstall.js - About 1 hr to fix

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

      function writeGradleFile() {
          if (!fs.existsSync(directories.android)) {
              fs.mkdirSync(directories.android);
          }
          try {
      Severity: Minor
      Found in src/lib/postinstall.js - About 1 hr to fix

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

        module.exports = function(config) {
          config.set({
        
            // base path that will be used to resolve all patterns (eg. files, exclude)
            basePath: '',
        Severity: Minor
        Found in demo-angular/karma.conf.js - About 1 hr to fix

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

          function writeGradleFile() {
              if (!fs.existsSync(directories.android)) {
                  fs.mkdirSync(directories.android);
              }
              try {
          Severity: Minor
          Found in publish/scripts/postinstall.js - About 1 hr to fix

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

              init(): void {
                try {
                  if (application.android) {
                    console.info('Fabric: Starting configuring Android platform');
                    application.android.on('activityStarted', activityEventData => {
            Severity: Minor
            Found in src/fabric.android.ts - About 1 hr to fix

              Function logError has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                logError(error: any, msg?: string): void {
                  if (this.initDone) {
                    try {
                      if (!!msg) {
                        Crashlytics.sharedInstance().setObjectValueForKey('' + msg, "msg");
              Severity: Minor
              Found in src/fabric.ios.ts - 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 addProperties has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              prompt.addProperties = function (obj, properties, callback) {
                properties = properties.filter(function (prop) {
                  return typeof obj[prop] === 'undefined';
                });
              
              
              Severity: Minor
              Found in src/lib/postinstall.js - About 1 hr to fix

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

                    async.memoize = function (fn, hasher) {
                        var memo = {};
                        var queues = {};
                        hasher = hasher || function (x) {
                            return x;
                Severity: Minor
                Found in src/lib/postinstall.js - About 1 hr to fix

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

                      async.parallel = function (tasks, callback) {
                          callback = callback || function () {};
                          if (tasks.constructor === Array) {
                              async.map(tasks, function (fn, callback) {
                                  if (fn) {
                  Severity: Minor
                  Found in src/lib/postinstall.js - About 1 hr to fix

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

                        async.series = function (tasks, callback) {
                            callback = callback || function () {};
                            if (tasks.constructor === Array) {
                                async.mapSeries(tasks, function (fn, callback) {
                                    if (fn) {
                    Severity: Minor
                    Found in src/lib/postinstall.js - About 1 hr to fix

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

                      function applyTheme(theme) {
                      
                        //
                        // Remark: This is a list of methods that exist
                        // on String that you should not overwrite.
                      Severity: Minor
                      Found in src/lib/postinstall.js - About 1 hr to fix

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

                              get(branch, function assembler(err, line) {
                                if (err) {
                                  return next(err);
                                }
                        
                        
                        Severity: Minor
                        Found in src/lib/postinstall.js - About 1 hr to fix

                          Function convert has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function convert(schema) {
                            var newProps = Object.keys(validate.messages),
                                newSchema = false,
                                key;
                          
                          
                          Severity: Minor
                          Found in src/lib/postinstall.js - About 1 hr to fix

                            Function waterfall has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                async.waterfall = function (tasks, callback) {
                                    callback = callback || function () {};
                                    if (!tasks.length) {
                                        return callback();
                                    }
                            Severity: Minor
                            Found in src/lib/postinstall.js - About 1 hr to fix

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

                              module.exports = env => {
                                  const platform = env && (env.android && "android" || env.ios && "ios");
                                  if (!platform) {
                                      throw new Error("You need to provide a target platform!");
                                  }
                              Severity: Minor
                              Found in demo-angular/webpack.config.js - About 55 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 validateProperty has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                function validateProperty(object, value, property, schema, options, errors) {
                              Severity: Minor
                              Found in src/lib/postinstall.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                            if (length) {
                                              if (tmp.length + 1 < length) {
                                                isValid = false;
                                                wait = true;
                                              }
                                Severity: Major
                                Found in src/lib/postinstall.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                              if (object.hasOwnProperty(k)) {
                                                visitedProps.push(k);
                                                if (re.exec(k) !== null) {
                                                  validateProperty(object, object[k], p, props[p], options, errors);
                                                }
                                  Severity: Major
                                  Found in src/lib/postinstall.js - About 45 mins to fix

                                    Function _performValidation has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    prompt._performValidation = function (name, prop, against, schema, line, callback) {
                                    Severity: Minor
                                    Found in src/lib/postinstall.js - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language