michahell/pinbored-nwjs

View on GitHub

Showing 282 of 282 total issues

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

      var request = this.endpoint + 'posts/recent' + this.format + argAmount + argTags + 
      this.token.replace('user', Usersessionservice.user).replace('apikey', Usersessionservice.apikey);
Severity: Major
Found in App/scripts/services/pinboardservice.js and 1 other location - About 1 hr to fix
App/scripts/services/pinboardservice.js on lines 427..428

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

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

      var request = this.endpoint + 'tags/rename' + this.format + old + neww +
      this.token.replace('user', Usersessionservice.user).replace('apikey', Usersessionservice.apikey);
Severity: Major
Found in App/scripts/services/pinboardservice.js and 1 other location - About 1 hr to fix
App/scripts/services/pinboardservice.js on lines 251..252

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

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

        $scope.filter.tags.splice($scope.filter.tags.indexOf($scope.filter.tags[$scope.filter.tags.length-1]), 1);
Severity: Major
Found in App/scripts/controllers/behaviours/searchableview.js and 1 other location - About 1 hr to fix
App/scripts/controllers/tagitem.js on lines 36..40

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

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

        $scope.status.newFoldTags.splice(
          $scope.status.newFoldTags.indexOf(
            $scope.status.newFoldTags[$scope.status.newFoldTags.length - 1]
          ), 
        1);
Severity: Major
Found in App/scripts/controllers/tagitem.js and 1 other location - About 1 hr to fix
App/scripts/controllers/behaviours/searchableview.js on lines 85..85

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

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

    this.selectionRecursiveDelete = function(selection) {
      var total = selection.length;
      var deleted = 0;

      console.log('bookmarks to delete: ' + total);
Severity: Minor
Found in App/scripts/services/bookmarkservice.js - About 1 hr to fix

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

      $scope.data.items = _.reject($scope.data.items, function(bm) {
        return bm.data.href === deletedBookmark.data.href;
      });
Severity: Major
Found in App/scripts/controllers/behaviours/searchableview.js and 1 other location - About 1 hr to fix
App/scripts/controllers/behaviours/searchableview.js on lines 150..152

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

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

      $scope.data.filteredList = _.reject($scope.data.filteredList, function(bm) {
        return bm.data.href === deletedBookmark.data.href;
      });
Severity: Major
Found in App/scripts/controllers/behaviours/searchableview.js and 1 other location - About 1 hr to fix
App/scripts/controllers/behaviours/searchableview.js on lines 147..149

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

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

        var req = https.get(requestString).on('response', function(res) {
          
          var data = '';
          var trackProgress = false;

Severity: Minor
Found in App/scripts/services/pinboardservice.js - About 1 hr to fix

Function login has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $scope.login = function(username, password) {
      $scope.model.busy = true;

      if(!_.isEmpty(username) && !_.isEmpty(password)) {
        Pinboardservice.checkConnection()
Severity: Minor
Found in App/scripts/controllers/login.js - About 1 hr to fix

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

    var cut = new gui.MenuItem({label: cutLabel || 'Cut', click: function() {
        document.execCommand('cut');
        console.log('Menu:', 'cutted to clipboard');
      }
    });
Severity: Major
Found in App/scripts/config/config-node-nwjs.js and 2 other locations - About 1 hr to fix
App/scripts/config/config-node-nwjs.js on lines 21..25
App/scripts/config/config-node-nwjs.js on lines 27..31

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

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

    var copy = new gui.MenuItem({label: copyLabel || 'Copy' , click: function() {
        document.execCommand('copy');
        console.log('Menu:', 'copied to clipboard');
      }
    });
Severity: Major
Found in App/scripts/config/config-node-nwjs.js and 2 other locations - About 1 hr to fix
App/scripts/config/config-node-nwjs.js on lines 15..19
App/scripts/config/config-node-nwjs.js on lines 27..31

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

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

    var paste = new gui.MenuItem({label: pasteLabel || 'Paste', click: function() {
        document.execCommand('paste');
        console.log('Menu:', 'pasted to textarea');
      }
    });
Severity: Major
Found in App/scripts/config/config-node-nwjs.js and 2 other locations - About 1 hr to fix
App/scripts/config/config-node-nwjs.js on lines 15..19
App/scripts/config/config-node-nwjs.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 58.

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

    this.selectionStaleCheck = function(selection) {
      var total = selection.length;
      var checked = 0;
      console.log('bookmarks to stale check: ' + total);

Severity: Minor
Found in App/scripts/services/bookmarkservice.js - About 1 hr to fix

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

    this.selectionDeleteAllTags = function(selection) {
      var total = selection.length;
      var updated = 0;
      console.log('bookmarks to delete all tags from: ' + total);

Severity: Minor
Found in App/scripts/services/bookmarkservice.js - About 1 hr to fix

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

    $scope.createTags = function(tagdata) {
      var deferred = $q.defer();
      var tagID = 0;

      for (var tag in tagdata) {
Severity: Minor
Found in App/scripts/controllers/tags.js - About 1 hr to fix

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

      } else if(option === 'rename') {
        if($scope.status.hidden.rename === true) { 
          $scope.openTagOptions('rename') 
        } else {
          $scope.closeTagOptions();
Severity: Minor
Found in App/scripts/controllers/tagitem.js and 1 other location - About 50 mins to fix
App/scripts/controllers/tagitem.js on lines 73..85

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

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

      if(option === 'fold') {
        if($scope.status.hidden.fold === true) {
          $scope.openTagOptions('fold') 
        } else {
          $scope.closeTagOptions();
Severity: Minor
Found in App/scripts/controllers/tagitem.js and 1 other location - About 50 mins to fix
App/scripts/controllers/tagitem.js on lines 79..85

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

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

Avoid deeply nested control flow statements.
Open

            for(var m=0; m<searchTags.length; m++) {
              
              var searchTag2 = searchTags[m];
              var bookmarkTags2 = item2.data.tags.split(' ');
              for(var n=0; n<bookmarkTags2.length; n++) {
Severity: Major
Found in App/scripts/filters/bookmarktagsfilter.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              if(matches === false) {
                var searchTag = searchTags[j];
                var bookmarkTags = item.data.tags.split(' ');
                for(var k=0; k<bookmarkTags.length; k++) {
                  if(bookmarkTags[k] === searchTag.text) {
Severity: Major
Found in App/scripts/filters/bookmarktagsfilter.js - About 45 mins to fix

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

    $scope.loadTagItems = function(query) {
      // return filtered parent scope' tagNames with query (which is user input)
      return $filter('filter')($scope.data.tagNames, query) || [];
    };
Severity: Minor
Found in App/scripts/controllers/behaviours/searchableview.js and 1 other location - About 35 mins to fix
App/scripts/controllers/tags.js on lines 68..71

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

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