Showing 27 of 27 total issues

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

module.exports = function(grunt) {
  grunt.initConfig({
    'download-atom-shell': {
      version: '0.21.2',
      outputDir: '../atom_shell',
Severity: Major
Found in src/Gruntfile.js - About 7 hrs to fix

    Function NotesAPI has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var NotesAPI = (function() {
    
      // Private API
      var api = {
        findNote: function(filename, cb) {
    Severity: Major
    Found in src/browser/apis/notes_api.js - About 3 hrs to fix

      JotzBrowser has 27 functions (exceeds 20 allowed). Consider refactoring.
      Open

      var JotzBrowser = Backbone.Model.extend({
        setupReporters: function() {
          require('crash-reporter').start();
        },
        setConfigs: function() {
      Severity: Minor
      Found in src/browser/jotz_browser.js - About 3 hrs to fix

        Function GlobalUtils has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var GlobalUtils = (function() {
        
          // Private
          function S4() {
            return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
        Severity: Major
        Found in src/browser/utils/global.js - About 2 hrs to fix

          Function NotebooksAPI has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var NotebooksAPI = (function() {
          
            // Private API
            var api = {
              getNotebooks: function(cb) {
          Severity: Major
          Found in src/browser/apis/notebooks_api.js - About 2 hrs to fix

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

                getAuthData: function(cb) {
                  jsf.readFile(api.getAuthDataPath(), function(err, authData) {
                    if (!err) {
                      cb(authData);
                    } else {
            Severity: Major
            Found in src/browser/utils/global.js and 2 other locations - About 2 hrs to fix
            src/browser/utils/global.js on lines 48..56
            src/browser/utils/global.js on lines 60..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 81.

            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

                getNotebooksFileData: function(cb) {
                  jsf.readFile(api.getNotebooksPath(), function(err, notebooks) {
                    if (!err) {
                      cb(notebooks);
                    } else {
            Severity: Major
            Found in src/browser/utils/global.js and 2 other locations - About 2 hrs to fix
            src/browser/utils/global.js on lines 27..35
            src/browser/utils/global.js on lines 60..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 81.

            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

                getNotesDirData: function(cb) {
                  fs.readdir(api.getNotesDirPath(), function(err, noteFilenames) {
                    if (!err) {
                      cb(noteFilenames);
                    } else {
            Severity: Major
            Found in src/browser/utils/global.js and 2 other locations - About 2 hrs to fix
            src/browser/utils/global.js on lines 27..35
            src/browser/utils/global.js on lines 48..56

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

            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 NotebooksAPI has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            var NotebooksAPI = (function() {
            
              // Private API
              var api = {
                getNotebooks: function(cb) {
            Severity: Minor
            Found in src/browser/apis/notebooks_api.js - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function AuthAPI has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var AuthAPI = (function() {
              var OAuthBrowser = Backbone.Model.extend({
                initialize: function(options) {
                  this.setInitialState(options);
                  this.bindMtds();
            Severity: Major
            Found in src/browser/apis/auth_api.js - About 2 hrs to fix

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

                        <NotesList
                          notes={this.props.notes}
                          changeNote={this.props.changeNote}
                          filterNbId={this.props.openNotebookId}
                          filterQuery={this.props.filterQuery}
              Severity: Major
              Found in src/renderer/components/content/note_browser/notebooks.js and 1 other location - About 1 hr to fix
              src/renderer/components/content/content.js on lines 33..38

              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

                  return <Editor
                    note={this.props.currentNote}
                    notes={this.props.notes}
                    notebooks={this.props.notebooks}
                    changeNote={this.props.changeNote}
              Severity: Major
              Found in src/renderer/components/content/content.js and 1 other location - About 1 hr to fix
              src/renderer/components/content/note_browser/notebooks.js on lines 26..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 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 GlobalUtils has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              var GlobalUtils = (function() {
              
                // Private
                function S4() {
                  return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
              Severity: Minor
              Found in src/browser/utils/global.js - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                render: function() {
                  return (
                    <div>
                      <h1>Notebooks</h1>
                      <ul>
              Severity: Major
              Found in src/renderer/components/content/note_browser/notebooks.js and 1 other location - About 1 hr to fix
              src/renderer/components/content/note_browser/notes_list.js on lines 45..54

              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

                render: function() {
                  return (
                    <div>
                      <h1>Hooray for the NotesList!!!</h1>
                      <ul>
              Severity: Major
              Found in src/renderer/components/content/note_browser/notes_list.js and 1 other location - About 1 hr to fix
              src/renderer/components/content/note_browser/notebooks.js on lines 54..63

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

                render: function() {
                  return (
                    <div>
                      <div className='side-container'>
                        <SideMenu
              Severity: Minor
              Found in src/renderer/components/jotz.js - About 1 hr to fix

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

                  render: function() {
                    var deleteBtn = null;
                    var noteTitle = '';
                    if (this.state.note && this.state.note._id) {
                      deleteBtn = <button className="btn" onClick={this.deleteNote}>Delete</button>;
                Severity: Minor
                Found in src/renderer/components/content/editor/editor.js - About 1 hr to fix

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

                    render: function() {
                      var menuItems = this.props.menuItems.map(function(menuItem) {
                        return (
                          <MenuItem
                            active={this.props.currentView === menuItem.category}
                  Severity: Minor
                  Found in src/renderer/components/side_menu/side_menu.js - About 1 hr to fix

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

                      it('renders a Content', function() {
                        var welcomeText = TestUtils.findRenderedDOMComponentWithTag(ContentElement, 'h1');
                        expect(welcomeText.getDOMNode().textContent).toEqual('This is the main content area');
                      });
                    Severity: Major
                    Found in src/__tests__/components/content-test.js and 1 other location - About 1 hr to fix
                    src/__tests__/components/top-bar-test.js on lines 10..13

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

                    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

                      it('renders a TopBar', function() {
                        var welcomeText = TestUtils.findRenderedDOMComponentWithTag(TopBarElement, 'h1');
                        expect(welcomeText.getDOMNode().textContent).toEqual('Hello this is the top bar.');
                      });
                    Severity: Major
                    Found in src/__tests__/components/top-bar-test.js and 1 other location - About 1 hr to fix
                    src/__tests__/components/content-test.js on lines 13..16

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

                    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