Showing 183 of 2,044 total issues
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(io, store) {
io.on('connection', function(socket) {
socket.on(CHECK_FOR_CALL, function(data) {
var callInProgress = Object.keys(io.nsps['/'].adapter.rooms[data.room] || {}).length
if (callInProgress) socket.emit(CALL_IN_PROGRESS)
- Create a ticketCreate a ticket
Function add_direction_form
has a Cognitive Complexity of 10 (exceeds 5 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>')
- 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 showImagePreview
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
showImagePreview: function() {
var file = $('#user_image')[0].files[0]
var reader = new window.FileReader()
- 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 createTopicLocally
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
createTopicLocally: function() {
var self = Topic
if (Create.newTopic.name === '') {
GlobalUI.notifyUser('Please enter a topic title...')
- Create a ticketCreate a ticket
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { currentUser, onInviteClick } = this.props
return <div>
<img className="sidebarAccountImage" src={currentUser.get('image')} width="48" height="48" />
<h3 className="accountHeader">{currentUser.get('name')}</h3>
- Create a ticketCreate a ticket
Function Reflection
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Reflection(img, reflHeight, opacity) {
var reflection, cntx, imageWidth = img.width, imageHeight = img.width, gradient, parent;
parent = $(img.parentNode);
- Create a ticketCreate a ticket
Function removeSelectedNodes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
removeSelectedNodes: function() { // refers to removing topics permanently from a map
if (Active.Topic) {
// hideNode will handle synapses as well
var nodeids = _.map(Selected.Nodes, function(node) {
return node.id
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (e.touches || (e.button === 0 && !e.altKey && !e.ctrlKey && (e.buttons === 0 || e.buttons === 1 || e.buttons === undefined))) {
const width = Visualize.mGraph.canvas.getSize().width
const height = Visualize.mGraph.canvas.getSize().height
const xPix = Util.coordsToPixels(Visualize.mGraph, pos).x
const yPix = Util.coordsToPixels(Visualize.mGraph, pos).y
- Create a ticketCreate a ticket
Function onMouseMoveHandler
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
onMouseMoveHandler: function(_node, eventInfo, e) {
const self = JIT
if (Visualize.mGraph.busy) return
- 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 render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render () {
const { topic, map, filterData, allForFiltering, visibleForFiltering, toggleMetacode,
toggleMapper, toggleSynapse, filterAllMetacodes,
filterAllMappers, filterAllSynapses } = this.props
const style = {
- 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 updateTopicPositions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
updateTopicPositions: function(node, pos) {
const len = Selected.Nodes.length
// this is used to send nodes that are moving to
// other realtime collaborators on the same map
const positionsToSend = {}
- 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 synapseAdded
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
synapseAdded: event => {
// we receive contentless models from the server
// containing only the information we need to determine whether the active mapper
// can view this synapse and the two topics it connects,
// then if we determine it can, we make a call for the full model
- 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 comparator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
comparator: function(a, b) {
a = a.get(this.sortBy)
b = b.get(this.sortBy)
var temp
if (this.sortBy === 'name') {
- 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 deleteEdge
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
deleteEdge: function(edge) {
if (!Active.Map) return
var authorized = 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
Method follow
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def follow(entity, user, reason)
return unless user
return if (reason == 'created' || reason == 'contributed') && !should_auto_follow(entity, user, reason)
- 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
Method user_metacodes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def user_metacodes
@m = current_user.settings.metacodes
set = metacodeset
@metacodes = if set && set == 'Most'
Metacode.where(id: current_user.most_used_metacodes).to_a
- 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 renderMidArrow
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
renderMidArrow: function(from, to, dim, swap, canvas, placement, newSynapse) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (n.id === 1) {
lowX = n.getPos().x
lowY = n.getPos().y
highX = n.getPos().x
highY = n.getPos().y
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (n.getPos().y > highY) highY = n.getPos().y
- Create a ticketCreate a ticket
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (this.props.authorizedToEdit) {
return (
<span className="title">
<RIETextArea value={this.props.name}
- 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"