Showing 183 of 2,044 total issues
Function init
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function() {
$('#topic_name').keyup(function(e) {
const ESC = 27
if (e.keyCode === ESC) {
- Create a ticketCreate a ticket
ChatView
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
const ChatView = {
isOpen: false,
unreadMessages: 0,
messages: new Backbone.Collection(),
conversationLive: false,
- Create a ticketCreate a ticket
Function onDragEndTopicHandler
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
onDragEndTopicHandler: function(node, eventInfo, e) {
const self = JIT
const midpoint = {}
let pixelPos
let mapping
- 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 edgeRender
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
edgeRender: function(adj, canvas) {
// get nodes cartesian coordinates
const pos = adj.nodeFrom.pos.getc(true)
const posChild = adj.nodeTo.pos.getc(true)
- 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 reducer
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const reducer = (state = { connectedPeople: {}, liveMaps: {} }, action) => {
const { type, payload } = action
const { connectedPeople, liveMaps } = state
const map = payload && liveMaps[payload.mapid]
const mapWillEmpty = map && Object.keys(map).length === 1
- 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 onDragEndTopicHandler
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
onDragEndTopicHandler: function(node, eventInfo, e) {
const self = JIT
const midpoint = {}
let pixelPos
let mapping
- Create a ticketCreate a ticket
Function updateMetacodeSet
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateMetacodeSet: function(set, index, custom) {
if (custom && Create.newSelectedMetacodes.length === 0) {
window.alert('Please select at least one metacode to use!')
return false
}
- Create a ticketCreate a ticket
Control
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
const Control = {
selectNode: function(node, e) {
var filtered = node.getData('alpha') === 0
if (filtered || Selected.Nodes.indexOf(node) !== -1) return
- Create a ticketCreate a ticket
Function makeRoutes
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function makeRoutes (currentUser) {
const homeComponent = currentUser && currentUser.id ? Maps : nullComponent
return <Route path="/" component={App} >
<IndexRoute component={homeComponent} />
<Route path="explore">
- Create a ticketCreate a ticket
Function updateAll
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.updateAll = function()
{
var minScale = options.minScale; // This is the smallest scale applied to the furthest item.
var smallRange = (1-minScale) * 0.5;
var w,h,x,y,scale,item,sinVal;
- Create a ticketCreate a ticket
Class MapPolicy
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class MapPolicy < ApplicationPolicy
class Scope < Scope
def resolve
visible = %w[public commons]
return scope.where(permission: visible) unless user
- Create a ticketCreate a ticket
Function attachEventListeners
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
attachEventListeners: function() {
var self = InfoBox
$('.mapInfoBox').click(function(event) {
event.stopPropagation()
})
- Create a ticketCreate a ticket
Function fetchSiblings
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchSiblings: function(nodes, metacodeId) {
var self = this
var node = Array.isArray(nodes) ? nodes[0] : nodes
- Create a ticketCreate a ticket
File ReactApp.js
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global $ */
import React from 'react'
import ReactDOM from 'react-dom'
import { Router, browserHistory } from 'react-router'
- Create a ticketCreate a ticket
Function renderSynapse
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
renderSynapse: function(mapping, synapse, node1, node2, createNewInDB) {
var edgeOnViz
var newedge = synapse.createEdge(mapping)
- 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 selectNodeOnClickHandler
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
selectNodeOnClickHandler: function(node, e) {
if (Visualize.mGraph.busy) return
const self = JIT
- Create a ticketCreate a ticket
Function updateFilters
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateFilters: function(collection, propertyToCheck, correlatedModel, filtersToUse, listToModify) {
var self = Filter
var newList = []
var removed = []
var added = []
- Create a ticketCreate a ticket
Method topics
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def topics
term = params[:term]
user = params[:user] ? params[:user] : false
if term.present? && term.downcase[0..3] != 'map:' &&
- Create a ticketCreate a ticket
Function add_direction_form
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
add_direction_form: function(synapse) {
// directionality checkboxes
$('#editSynLowerBar').append('<div id="edit_synapse_left"></div>')
$('#editSynLowerBar').append('<div id="edit_synapse_right"></div>')
- Create a ticketCreate a ticket
Function exports
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(io, store) {
io.on('connection', function(socket) {
// this will ping everyone on a map that there's a person just joined the map
socket.on(JOIN_MAP, function(data) {
socket.mapid = data.mapid
- Create a ticketCreate a ticket