JonSn0w/Hyde

View on GitHub

Showing 30 of 2,194 total issues

File main.js has 399 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * HYDE - markdown editor
 * Copyright (c) 2017 Brett Stevenson <bstevensondev@gmail.com
 *
 * This program is free software: you can redistribute it and/or modify
Severity: Minor
Found in main.js - About 5 hrs to fix

    File settings.js has 377 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const config = require('./js/config');
    var menu = $('#appMenu'),
            toolbar = $('#toolbar'),
            leftFade = $('#leftFade'),
            dragArea = $('#draggable'),
    Severity: Minor
    Found in js/settings.js - About 5 hrs to fix

      File bootstrap-notify.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
      * Project: Bootstrap Notify = v3.1.5
      * Description: Turns standard Bootstrap alerts into "Growl-like" notifications.
      * Author: Mouse0270 aka Robert McIntosh
      * License: MIT License
      Severity: Minor
      Found in js/bootstrap/bootstrap-notify.js - About 4 hrs to fix

        File app.js has 328 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        
        const electron = require('electron');
        const remote = electron.remote;
        const dialog = electron.remote.dialog;
        const shell = electron.shell;
        Severity: Minor
        Found in js/app.js - About 3 hrs to fix

          File format.js has 322 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          
          function toggleFormat(type) {
            'use strict';
            let modifiers;
            if(type === 'strong')
          Severity: Minor
          Found in js/format.js - About 3 hrs to fix

            Function parseExpression has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            function parseExpression(raw, delimit, delimitEscaped, mathMode, finalPass) {
              finalPass = finalPass || false;
              var lines = raw.split('\n');
              var output = '';
            
            
            Severity: Minor
            Found in js/parseTex.js - About 3 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 getState has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            function getState(cm, pos) {
              pos = pos || cm.getCursor('start');
              var stat = cm.getTokenAt(pos);
              if(!stat.type) return {};
              var types = stat.type.split(' ');
            Severity: Minor
            Found in js/format.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 _toggleHeading has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            function _toggleHeading(direction) {
              var startPoint = cm.getCursor('start'),
                  endPoint = cm.getCursor('end');
              for(var i = startPoint.line; i <= endPoint.line; i++) {
                var text = cm.getLine(i);
            Severity: Minor
            Found in js/format.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 init has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    init: function () {
                        var self = this;
            
                        this.buildNotify();
                        if(this.settings.content.icon) {
            Severity: Major
            Found in js/bootstrap/bootstrap-notify.js - About 2 hrs to fix

              Function placement has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      placement: function () {
                          var self = this,
                          offsetAmt = this.settings.offset.y,
                          css = {
                              display: 'inline-block',
              Severity: Major
              Found in js/bootstrap/bootstrap-notify.js - About 2 hrs to fix

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

                window.onload = () => {
                    let themeColor = $('.cm-s-'+theme).css('background-color');
                    adaptTheme(themeColor, Color(themeColor).luminosity());
                    createModals();
                    fillEmojiModal();
                Severity: Minor
                Found in js/app.js - About 1 hr to fix

                  Function formatHead has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var formatHead = () => {
                      var textPanel = $('#textPanel'),
                              menuToggle = $('#menuToggle');
                      if(process.platfrom === 'darwin') {
                          preview.css('paddingTop', '25px');
                  Severity: Minor
                  Found in js/settings.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 update has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                  update: function (command, update) {
                                      var commands = {};
                                      if(typeof command === 'string') {
                                          commands[command] = update;
                                      } else {
                  Severity: Minor
                  Found in js/bootstrap/bootstrap-notify.js - About 1 hr to fix

                    Function toggleState has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function toggleState(type, modifiers) {
                      if(modifiers.length === 0) return;
                      let startPoint = cm.getCursor('start');
                      let endPoint = cm.getCursor('end');
                      // get word at cursor if there's no selection
                    Severity: Minor
                    Found in js/format.js - About 1 hr to fix

                      Function parseExpression has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function parseExpression(raw, delimit, delimitEscaped, mathMode, finalPass) {
                        finalPass = finalPass || false;
                        var lines = raw.split('\n');
                        var output = '';
                      
                      
                      Severity: Minor
                      Found in js/parseTex.js - About 1 hr to fix

                        Function getState has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function getState(cm, pos) {
                          pos = pos || cm.getCursor('start');
                          var stat = cm.getTokenAt(pos);
                          if(!stat.type) return {};
                          var types = stat.type.split(' ');
                        Severity: Minor
                        Found in js/format.js - About 1 hr to fix

                          Function formatHead has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          var formatHead = () => {
                              var textPanel = $('#textPanel'),
                                      menuToggle = $('#menuToggle');
                              if(process.platfrom === 'darwin') {
                                  preview.css('paddingTop', '25px');
                          Severity: Minor
                          Found in js/settings.js - About 1 hr to fix

                            Function createNotification has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function createNotification(text, type) {
                                var head, icon;
                                if(type === 'success') {
                                    head = '<strong>Success </strong>';
                                    icon = 'fa fa-check-circle';
                            Severity: Minor
                            Found in js/notify.js - About 1 hr to fix

                              Function handleSquirrelEvent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                handleSquirrelEvent: function() {
                                  if(process.argv.length === 1) {
                                    return false;
                                  }
                              
                              
                              Severity: Minor
                              Found in js/installer/setupEvents.js - About 1 hr to fix

                                Function Notify has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function Notify(element, content, options) {
                                        // Setup Content of Notify
                                        var contentObj = {
                                            content: {
                                                message: typeof content === 'object' ? content.message : content,
                                Severity: Minor
                                Found in js/bootstrap/bootstrap-notify.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language