Showing 183 of 2,044 total issues
File JIT.js
has 1330 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global $, Image */
import _ from 'lodash'
import clipboard from 'clipboard-js'
- Create a ticketCreate a ticket
Function onDragMoveTopicHandler
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
Open
onDragMoveTopicHandler: function(node, eventInfo, e) {
var self = JIT
var authorized = Active.Map && Active.Map.authorizeToEdit(Active.Mapper)
- Read upRead up
- Create a ticketCreate a ticket
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 Controller
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Controller = function(container, images, options)
{
var items = [], funcSin = Math.sin, funcCos = Math.cos, ctx=this;
this.controlTimer = 0;
this.stopped = false;
- Create a ticketCreate a ticket
Function onDragMoveTopicHandler
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onDragMoveTopicHandler: function(node, eventInfo, e) {
var self = JIT
var authorized = Active.Map && Active.Map.authorizeToEdit(Active.Mapper)
- Create a ticketCreate a ticket
File index.js
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global $ */
import SimpleWebRTC from 'simplewebrtc'
import SocketIoConnection from 'simplewebrtc/socketioconnection'
- Create a ticketCreate a ticket
Function startTypeahead
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
startTypeahead: function() {
var self = Search
var mapheader = Active.Mapper ? '<div class="searchMapsHeader searchHeader"><h3 class="search-heading">Maps</h3><input type="checkbox" class="limitToMe" id="limitMapsToMe"></input><label for="limitMapsToMe" class="limitToMeLabel">added by me</label><div class="minimizeResults minimizeMapResults"></div><div class="clearfloat"></div></div>' : '<div class="searchMapsHeader searchHeader"><h3 class="search-heading">Maps</h3><div class="minimizeResults minimizeMapResults"></div><div class="clearfloat"></div></div>'
var topicheader = Active.Mapper ? '<div class="searchTopicsHeader searchHeader"><h3 class="search-heading">Topics</h3><input type="checkbox" class="limitToMe" id="limitTopicsToMe"></input><label for="limitTopicsToMe" class="limitToMeLabel">added by me</label><div class="minimizeResults minimizeTopicResults"></div><div class="clearfloat"></div></div>' : '<div class="searchTopicsHeader searchHeader"><h3 class="search-heading">Topics</h3><div class="minimizeResults minimizeTopicResults"></div><div class="clearfloat"></div></div>'
- Create a ticketCreate a ticket
File Import.js
has 380 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global $ */
import parse from 'csv-parse'
import _ from 'lodash'
- Create a ticketCreate a ticket
File Control.js
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import _ from 'lodash'
import outdent from 'outdent'
import Active from './Active'
import DataModel from './DataModel'
- Create a ticketCreate a ticket
Function init
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function() {
var self = this
$(document).on('keydown', function(e) {
if (!(Active.Map || Active.Topic)) return
- Create a ticketCreate a ticket
File Create.js
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global $, Hogan, Bloodhound */
import DataModel from './DataModel'
import Map from './Map'
import Mouse from './Mouse'
- Create a ticketCreate a ticket
File index.js
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global $ */
import outdent from 'outdent'
import { find as _find } from 'lodash'
import { browserHistory } from 'react-router'
- Create a ticketCreate a ticket
File Topic.js
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global $ */
import $jit from '../patched/JIT'
import Active from './Active'
- Create a ticketCreate a ticket
Function parseTabbedString
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parseTabbedString: function(text) {
var self = Import
// determine line ending and split lines
var delim = '\n'
- Create a ticketCreate a ticket
Function selectWithBox
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
selectWithBox: function(e) {
const self = this
let sX = Mouse.boxStartCoordinates.x
let sY = Mouse.boxStartCoordinates.y
let eX = Mouse.boxEndCoordinates.x
- Create a ticketCreate a ticket
JIT
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
Open
const JIT = {
tempInit: false,
tempNode: null,
tempNode2: null,
mouseDownPix: {},
- Create a ticketCreate a ticket
Function renderTopic
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderTopic: function(mapping, topic, createNewInDB, permitCreateSynapseAfter, opts = {}) {
var nodeOnViz, tempPos
var newnode = topic.createNode()
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
Open
if ((sX < x && x < eX && sY < y && y < eY) ||
(sX > x && x > eX && sY > y && y > eY) ||
(sX > x && x > eX && sY < y && y < eY) ||
(sX < x && x < eX && sY > y && y > eY)) {
if (e.shiftKey) {
- Create a ticketCreate a ticket
File InfoBox.js
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global $, Hogan, Bloodhound, Countable */
import outdent from 'outdent'
import { browserHistory } from 'react-router'
- Create a ticketCreate a ticket
Function arrange
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
arrange: function(layout, centerNode) {
// first option for layout to implement is 'grid', will do an evenly spaced grid with its center at the 0,0 origin
if (layout === 'grid') {
const numNodes = _.size(Visualize.mGraph.graph.nodes) // this will always be an integer, the # of nodes on your graph visualization
const numColumns = Math.floor(Math.sqrt(numNodes)) // the number of columns to make an even grid
- Create a ticketCreate a ticket
Method send_for_follows
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.send_for_follows(follows, entity, event_type, event)
return if follows.empty?
settings = get_settings_for_event(entity, event_type, event)
# we'll prbly want to put the body into the actual loop so we can pass the current user in as a local
body = renderer.render(template: settings[:template], locals: { entity: entity, event: event }, layout: false)
- Read upRead up
- Create a ticketCreate a ticket
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"