nooline/nooline

View on GitHub

Showing 48 of 48 total issues

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

  if (typeof module !== 'undefined') {

    module.exports = Snippets;
    return module.exports;

Severity: Major
Found in common/js/nooline/collections/snippets.js and 1 other location - About 4 hrs to fix
common/js/nooline/collections/content-categories.js on lines 46..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 126.

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 (typeof module !== 'undefined') {

    module.exports = ContentCategories;
    return module.exports;

Severity: Major
Found in common/js/nooline/collections/content-categories.js and 1 other location - About 4 hrs to fix
common/js/nooline/collections/snippets.js on lines 57..76

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

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

  if (typeof module !== 'undefined') {

    module.exports = CategoryView;
    return module.exports;

Severity: Major
Found in common/js/nooline/views/category-view.js and 2 other locations - About 4 hrs to fix
common/js/nooline/models/category.js on lines 68..87
common/js/nooline/models/content-snippet.js on lines 94..113

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

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

    if (typeof module !== 'undefined') {

      module.exports = ContentSnippet;
      return module.exports;

Severity: Major
Found in common/js/nooline/models/content-snippet.js and 2 other locations - About 4 hrs to fix
common/js/nooline/models/category.js on lines 68..87
common/js/nooline/views/category-view.js on lines 47..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 125.

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

  if (typeof module !== 'undefined') {

    module.exports = Category;
    return module.exports;

Severity: Major
Found in common/js/nooline/models/category.js and 2 other locations - About 4 hrs to fix
common/js/nooline/models/content-snippet.js on lines 94..113
common/js/nooline/views/category-view.js on lines 47..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 125.

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

  N.Views.ContentSnippetView.prototype.enableEditing = function () {

    var buttonTag = '<button></button>';
    var panelTag = '<div></div>';
    var panelTextTag = '<span></span>';
Severity: Major
Found in common/js/nooline/views/content-snippet-view/enable-editing.js - About 3 hrs to fix

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

define('common/js/nooline/models/content-snippet/enable-editing',
  [],
  function () {

  var N = this.Nooline;
Severity: Major
Found in common/js/nooline/models/content-snippet/enable-editing.js and 1 other location - About 2 hrs to fix
common/js/nooline/models/content-snippet/disable-editing.js on lines 2..24

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

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

define('common/js/nooline/models/content-snippet/disable-editing',
  [],
  function () {

  var N = this.Nooline;
Severity: Major
Found in common/js/nooline/models/content-snippet/disable-editing.js and 1 other location - About 2 hrs to fix
common/js/nooline/models/content-snippet/enable-editing.js on lines 2..24

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

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

  N.showLoginPanel = function showLoginPanel (e) {

    var $loginButton = $(e.target);
    var $panel = $('<section id="main-login" class="login hidden"></section>');

Severity: Major
Found in common/js/nooline/show-login-panel.js - About 2 hrs to fix

Function matchLogin has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function matchLogin (data, info) {
  
  var errorLogin = require('./error-login');
  var crypto = require('crypto-js/core');
  var startSession = require('./start-session');
Severity: Major
Found in controllers/match-login.js - About 2 hrs to fix

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

  fs.readFile(bootstrapSettings, 'utf8', function loadBoostrap (error, data) {
    if (error) {
      throw error;
    }

Severity: Major
Found in routes/bootstrap.js and 1 other location - About 1 hr to fix
routes/bootstrap.js on lines 52..65

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

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

  fs.readFile(controls, 'utf8', function loadControls (error, data) {
    if (error) {
      throw error;
    }

Severity: Major
Found in routes/bootstrap.js and 1 other location - About 1 hr to fix
routes/bootstrap.js on lines 35..47

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

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

;(function start() {

  /**
   * @constructor Nooline
   * The base constructor which we decorate with various modules, governing
Severity: Minor
Found in common/js/nooline/start.js - About 1 hr to fix

Function loadSnippets has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  N.Models.Category.prototype.loadSnippets = function (error, data, index) {
    var error404;
    var ContentSnippet;
    var snippet;

Severity: Minor
Found in common/js/nooline/models/category/load-snippets.js - About 1 hr to fix

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

  N.Views.ContentSnippetView.prototype.bindEvents = function (element) {

    var _this = this;

    _this.setElement(element);
Severity: Minor
Found in common/js/nooline/views/content-snippet-view/bind-events.js - About 1 hr to fix

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

define('common/js/nooline/views/content-snippet-view/stop-editing',
  [],
  function () {

  var N = this.Nooline;
common/js/nooline/views/content-snippet-view/commit-changes.js on lines 2..26
common/js/nooline/views/content-snippet-view/start-editing.js on lines 2..23

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

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

define('common/js/nooline/views/content-snippet-view/commit-changes',
  [],
  function () {

  var N = this.Nooline;
common/js/nooline/views/content-snippet-view/start-editing.js on lines 2..23
common/js/nooline/views/content-snippet-view/stop-editing.js on lines 2..24

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

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

define('common/js/nooline/views/content-snippet-view/start-editing',
  [],
  function () {

  var N = this.Nooline;
common/js/nooline/views/content-snippet-view/commit-changes.js on lines 2..26
common/js/nooline/views/content-snippet-view/stop-editing.js on lines 2..24

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

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

  function Nooline () {
    requirejs.config({
      baseUrl: '/',
      shim: {
        'node_modules/backbone/backbone': {
Severity: Minor
Found in common/js/nooline/start.js - About 1 hr to fix

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

  N.buildControls = function buildControls (data) {

    var allSnippets = N.contentCategories.findAllContent();
    var permissions = {};

Severity: Minor
Found in common/js/nooline/build-controls.js - About 1 hr to fix
Severity
Category
Status
Source
Language