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

            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

              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

              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

                    Function NotesAPI has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var NotesAPI = (function() {
                    
                      // Private API
                      var api = {
                        findNote: function(filename, cb) {
                    Severity: Minor
                    Found in src/browser/apis/notes_api.js - About 55 mins 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

                    Severity
                    Category
                    Status
                    Source
                    Language