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
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'),
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
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;
File format.js
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
function toggleFormat(type) {
'use strict';
let modifiers;
if(type === 'strong')
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 = '';
- Read upRead up
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(' ');
- Read upRead up
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);
- Read upRead up
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) {
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',
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();
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');
- Read upRead up
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 {
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
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 = '';
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(' ');
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');
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';
Function handleSquirrelEvent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleSquirrelEvent: function() {
if(process.argv.length === 1) {
return false;
}
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,