Laverna/laverna

View on GitHub

Showing 111 of 111 total issues

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

    executeAction = function(module, args) {
        if (!module) {
            return;
        }

Severity: Major
Found in app/scripts/apps/notes/appNote.js and 1 other location - About 3 hrs to fix
app/scripts/apps/notebooks/appNotebooks.js on lines 70..87

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

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

        _send: function(msg, data) {

            // Generate a unique ID for the worker's promise
            var promiseId = ((1 + Math.random()) * 0x10000);
            this.promises[promiseId] = Q.defer();
Severity: Major
Found in app/scripts/modules/markdown/libs/markdown.js and 1 other location - About 3 hrs to fix
app/scripts/classes/sjcl.worker.js on lines 79..92

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

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

        _send: function(msg, data) {

            // Generate a unique ID for the worker's promise
            var promiseId = ((1 + Math.random()) * 0x10000);
            this.promises[promiseId] = Q.defer();
Severity: Major
Found in app/scripts/classes/sjcl.worker.js and 1 other location - About 3 hrs to fix
app/scripts/modules/markdown/libs/markdown.js on lines 94..107

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

        _emit: function(msg, data) {
            var self = this;

            // Worker is ready
            if (!this.workerPromise.promise.isPending()) {
Severity: Major
Found in app/scripts/classes/sjcl.worker.js and 1 other location - About 3 hrs to fix
app/scripts/modules/markdown/libs/markdown.js on lines 80..92

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

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

        _emit: function(msg, data) {
            var self = this;

            // Worker is ready
            if (!this.workerPromise.promise.isPending()) {
Severity: Major
Found in app/scripts/modules/markdown/libs/markdown.js and 1 other location - About 3 hrs to fix
app/scripts/classes/sjcl.worker.js on lines 65..77

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

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

module.exports = function(gulp, plugins) {
    return function() {
        var options = {base: './app/bower_components/'};

        return merge.apply(merge, [
Severity: Major
Found in gulps/copy.js - About 2 hrs to fix

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

    module.exports = function(gulp, plugins) {
        return function() {
            return gulp.src('./app/scripts/main.js')
            // Require.js optimizer
            .pipe(plugins.requirejsOptimize({
    Severity: Major
    Found in gulps/require.js - About 2 hrs to fix

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

      module.exports = function(gulp, plug, pkg) {
      
          /**
           * Use livereload server when debugging.
           */
      Severity: Major
      Found in gulps/mobile.js - About 2 hrs to fix

        File configs.js has 270 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * Copyright (C) 2015 Laverna project Authors.
         *
         * This Source Code Form is subject to the terms of the Mozilla Public
         * License, v. 2.0. If a copy of the MPL was not distributed with this
        Severity: Minor
        Found in app/scripts/collections/modules/configs.js - About 2 hrs to fix

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

                  reply: function() {
                      return {
                          'save'            : this.saveModel,
                          'save:collection' : this.saveCollection,
                          'save:raw'        : this.saveRaw,
          Severity: Major
          Found in app/scripts/collections/modules/module.js and 1 other location - About 2 hrs to fix
          app/scripts/collections/modules/configs.js on lines 44..55

          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 2 locations. Consider refactoring.
          Open

                  reply: function() {
                      return {
                          'save:object'    : this.saveObject,
                          'save:objects'   : this.saveObjects,
                          'create:profile' : this.createProfile,
          Severity: Major
          Found in app/scripts/collections/modules/configs.js and 1 other location - About 2 hrs to fix
          app/scripts/collections/modules/module.js on lines 51..62

          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 2 locations. Consider refactoring.
          Open

                          promises.push(function() {
                              return Q.all([
                                  Radio.request(module, 'fetch', {encrypt: true}),
                                  adapter.getAll(module)
                              ])
          Severity: Major
          Found in app/scripts/modules/dropbox/classes/sync.js and 1 other location - About 1 hr to fix
          app/scripts/modules/fs/classes/sync.js on lines 58..66

          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

                      _.each(['notes', 'notebooks', 'tags'], function(module) {
                          return Q.all([
                              Radio.request(module, 'fetch', {encrypt: true}),
                              FS.getList(module)
                          ])
          Severity: Major
          Found in app/scripts/modules/fs/classes/sync.js and 1 other location - About 1 hr to fix
          app/scripts/modules/dropbox/classes/sync.js on lines 208..216

          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

                          destroy: function(type, obj) {
                              obj.id = obj.id.toString();
                              return prClient.remove(this.profile + '/' + type + '/' + obj.id);
                          },
          Severity: Major
          Found in app/scripts/modules/remotestorage/classes/module.js and 1 other location - About 1 hr to fix
          app/scripts/modules/remotestorage/classes/module.js on lines 151..154

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

          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

                          getById: function(type, obj) {
                              obj.id = obj.id.toString();
                              return prClient.getObject(this.profile + '/' + type + '/' + obj.id);
                          }
          Severity: Major
          Found in app/scripts/modules/remotestorage/classes/module.js and 1 other location - About 1 hr to fix
          app/scripts/modules/remotestorage/classes/module.js on lines 142..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 69.

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

                  initEditor: function() {
                      this.editor = CodeMirror.fromTextArea(document.getElementById('editor--input'), {
                          mode          : {
                              name        : 'gfm',
                              gitHubSpice : false
          Severity: Minor
          Found in app/scripts/modules/codemirror/controller.js - About 1 hr to fix

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

                    changeScrollTop: function(view, scrollTop) {
                        this.uiBody.scrollTop(
                            scrollTop -
                            this.uiBody.offset().top +
                            this.uiBody.scrollTop() - 100
            app/scripts/apps/notes/list/views/noteSidebar.js on lines 155..161

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

            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

                    changeScrollTop: function(view, scrollTop) {
                        this.$scroll.scrollTop(
                            scrollTop -
                            this.$scroll.offset().top +
                            this.$scroll.scrollTop() - 100
            Severity: Major
            Found in app/scripts/apps/notes/list/views/noteSidebar.js and 1 other location - About 1 hr to fix
            app/scripts/apps/notebooks/list/behaviors/compositeBehavior.js on lines 62..68

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

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

            module.exports = function(gulp, plugins, pkg) {
                return function() {
                    var platforms = [
                        'darwin-x64',
                        // 'linux-arm',
            Severity: Minor
            Found in gulps/electron.js - About 1 hr to fix

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

                      configure: function() {
                          this.md
                          .use(sanitizer)
                          .use(imsize)
                          .use(math, {
              Severity: Minor
              Found in app/scripts/modules/markdown/libs/markdown-it.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language