hypery2k/nativescript-fabric

View on GitHub

Showing 102 of 102 total issues

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

function writeGradleFile() {
    if (!fs.existsSync(directories.android)) {
        fs.mkdirSync(directories.android);
    }
    try {
Severity: Major
Found in src/lib/postinstall.js and 1 other location - About 4 hrs to fix
publish/scripts/postinstall.js on lines 322..360

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

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

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

              function askAndroidPrompt() {
                  prompt.get({
                      name: 'using_android',
                      description: 'Are you using Android (y/n)',
                      default: 'y'
              Severity: Major
              Found in publish/scripts/postinstall.js and 1 other location - About 3 hrs to fix
              src/lib/postinstall.js on lines 2926..2943

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

              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

              function askAndroidPrompt() {
                  prompt.get({
                      name: 'using_android',
                      description: 'Are you using Android (y/n)',
                      default: 'y'
              Severity: Major
              Found in src/lib/postinstall.js and 1 other location - About 3 hrs to fix
              publish/scripts/postinstall.js on lines 128..145

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

              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

              function promptQuestions() {
                  prompt.get([{
                      name: 'api_key',
                      description: 'Your Fabric API Key',
                      default: ''
              Severity: Major
              Found in publish/scripts/postinstall.js and 1 other location - About 3 hrs to fix
              src/lib/postinstall.js on lines 2954..2971

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

              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

              function promptQuestions() {
                  prompt.get([{
                      name: 'api_key',
                      description: 'Your Fabric API Key',
                      default: ''
              Severity: Major
              Found in src/lib/postinstall.js and 1 other location - About 3 hrs to fix
              publish/scripts/postinstall.js on lines 156..173

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

              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 (uglify) {
                      config.plugins.push(new webpack.LoaderOptionsPlugin({ minimize: true }));
              
                      // Work around an Android issue by setting compress = false
                      const compress = platform !== "android";
              Severity: Major
              Found in demo/webpack.config.js and 1 other location - About 3 hrs to fix
              demo-angular/webpack.config.js on lines 190..201

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

              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 (uglify) {
                      config.plugins.push(new webpack.LoaderOptionsPlugin({ minimize: true }));
              
                      // Work around an Android issue by setting compress = false
                      const compress = platform !== "android";
              Severity: Major
              Found in demo-angular/webpack.config.js and 1 other location - About 3 hrs to fix
              demo/webpack.config.js on lines 167..178

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

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

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

                function askSaveConfigPrompt() {
                    prompt.get({
                        name: 'save_config',
                        description: 'Do you want to save the selected configuration. Reinstalling the dependency will reuse the setup from: ' + pluginConfigFile + '. CI will be easier. (y/n)',
                        default: 'y'
                Severity: Major
                Found in publish/scripts/postinstall.js and 1 other location - About 2 hrs to fix
                src/lib/postinstall.js on lines 3069..3082

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

                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

                function askSaveConfigPrompt() {
                    prompt.get({
                        name: 'save_config',
                        description: 'Do you want to save the selected configuration. Reinstalling the dependency will reuse the setup from: ' + pluginConfigFile + '. CI will be easier. (y/n)',
                        default: 'y'
                Severity: Major
                Found in src/lib/postinstall.js and 1 other location - About 2 hrs to fix
                publish/scripts/postinstall.js on lines 271..284

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

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

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

                      function askiOSPrompt() {
                          prompt.get({
                              name: 'using_ios',
                              description: 'Are you using iOS (y/n)',
                              default: 'y'
                      Severity: Major
                      Found in publish/scripts/postinstall.js and 1 other location - About 2 hrs to fix
                      src/lib/postinstall.js on lines 2902..2915

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language