hypery2k/nativescript-fabric

View on GitHub

Showing 44 of 102 total issues

File postinstall.js has 2310 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/******/ (function(modules) { // webpackBootstrap
/******/     // The module cache
/******/     var installedModules = {};
/******/
/******/     // The require function
Severity: Major
Found in src/lib/postinstall.js - About 6 days to fix

    Function exports has 149 lines of code (exceeds 25 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: Major
    Found in demo-angular/webpack.config.js - About 5 hrs to fix

      File postinstall.js has 410 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var fs = require('fs');
      var path = require('path');
      var prompt = require('prompt-lite');
      
      const FABRIC_GRADLE_TOOLS = '1.+'
      Severity: Minor
      Found in publish/scripts/postinstall.js - About 5 hrs to fix

        Function getInput has 140 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        prompt.getInput = function (prop, callback) {
          var schema = prop.schema || prop,
              propName = prop.path && prop.path.join(':') || prop,
              storedSchema = prompt.properties[propName.toLowerCase()],
              delim = prompt.delimiter,
        Severity: Major
        Found in src/lib/postinstall.js - About 5 hrs to fix

          Function exports has 131 lines of code (exceeds 25 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: Major
          Found in demo/webpack.config.js - About 5 hrs to fix

            Function validateProperty has 117 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function validateProperty(object, value, property, schema, options, errors) {
                var format,
                    valid,
                    spec,
                    type;
            Severity: Major
            Found in src/lib/postinstall.js - About 4 hrs to fix

              Function writeFabricServiceGradleHook has 107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function writeFabricServiceGradleHook(config) {
                  console.log("Install Fabric-build-gradle hook.");
                  try {
                      if (!fs.existsSync(path.join(appRoot, "hooks"))) {
                          fs.mkdirSync(path.join(appRoot, "hooks"));
              Severity: Major
              Found in src/lib/postinstall.js - About 4 hrs to fix

                Function writeFabricServiceGradleHook has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function writeFabricServiceGradleHook(config) {
                    console.log("Install Fabric-build-gradle hook.");
                    try {
                        if (!fs.existsSync(path.join(appRoot, "hooks"))) {
                            fs.mkdirSync(path.join(appRoot, "hooks"));
                Severity: Major
                Found in publish/scripts/postinstall.js - About 4 hrs to fix

                  Function get has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  prompt.get = function (schema, callback) {
                    //
                    // Transforms a full JSON-schema into an array describing path and sub-schemas.
                    // Used for iteration purposes.
                    //
                  Severity: Major
                  Found in src/lib/postinstall.js - About 3 hrs to fix

                    Function zalgo has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function zalgo(text, options) {
                      var soul = {
                        "up" : [
                          '̍', '̎', '̄', '̅',
                          '̿', '̑', '̆', '̐',
                    Severity: Major
                    Found in src/lib/postinstall.js - About 3 hrs to fix

                      Function read has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function read (opts, cb) {
                        if (opts.num) {
                          throw new Error('read() no longer accepts a char number limit')
                        }
                      
                      
                      Severity: Major
                      Found in src/lib/postinstall.js - About 3 hrs to fix

                        Function iterate has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function iterate(schema, get, done) {
                            var iterator = [],
                                result = {};
                        
                            if (typeof schema === 'string') {
                        Severity: Major
                        Found in src/lib/postinstall.js - About 3 hrs to fix

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

                          function writeXcodeData(config) {
                          
                              console.log("Install Fabric-build-xcode hook.");
                          
                              try {
                          Severity: Major
                          Found in publish/scripts/postinstall.js - About 2 hrs to fix

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

                            function writeXcodeData(config) {
                            
                                console.log("Install Fabric-build-xcode hook.");
                            
                                try {
                            Severity: Major
                            Found in src/lib/postinstall.js - About 2 hrs to fix

                              Function auto has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  async.auto = function (tasks, callback) {
                                      callback = callback || function () {};
                                      var keys = _keys(tasks);
                                      if (!keys.length) {
                                          return callback(null);
                              Severity: Major
                              Found in src/lib/postinstall.js - About 2 hrs to fix

                                Function stylize has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function stylize(str, style) {
                                
                                  var styles;
                                
                                  if (exports.mode === 'console') {
                                Severity: Major
                                Found in src/lib/postinstall.js - About 2 hrs to fix

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

                                      async.queue = function (worker, concurrency) {
                                          var workers = 0;
                                          var q = {
                                              tasks: [],
                                              concurrency: concurrency,
                                  Severity: Minor
                                  Found in src/lib/postinstall.js - About 1 hr to fix

                                    Function validateObject has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      function validateObject(object, schema, options, errors) {
                                        var props, allProps = Object.keys(object),
                                            visitedProps = [];
                                    
                                        // see 5.2
                                    Severity: Minor
                                    Found in src/lib/postinstall.js - About 1 hr to fix

                                      Function heComes has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function heComes(text, options) {
                                          var result = '', counts, l;
                                          options = options || {};
                                          options["up"] = options["up"] || true;
                                          options["mid"] = options["mid"] || true;
                                      Severity: Minor
                                      Found in src/lib/postinstall.js - About 1 hr to fix

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

                                          logError(error: any, msg?: string): void {
                                            if (this.initDone) {
                                              try {
                                                if (!error.android) {
                                                  if (!!msg) {
                                        Severity: Minor
                                        Found in src/fabric.android.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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language