Showing 309 of 2,044 total issues
Function fork
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
fork: function() {
GlobalUI.openLightbox('forkmap')
let nodesData = ''
let synapsesData = ''
- Create a ticketCreate a ticket
Function init
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function(serverData) {
var self = DataModel
// workaround circular import problem
if (!self.MapCollection.model) self.MapCollection.model = Map
- Create a ticketCreate a ticket
Function createTopicWithParameters
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
createTopicWithParameters: function(name, metacodeName, permission, desc,
link, xloc, yloc, importId, opts = {}) {
var self = Import
$(document).trigger(Map.events.editedByActiveMapper)
var metacode = DataModel.Metacodes.where({name: metacodeName})[0] || null
- Create a ticketCreate a ticket
Function add_drop_down
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
add_drop_down: function(edge, synapse) {
var list, i, synapses, l, desc
synapses = edge.getData('synapses')
l = synapses.length
- 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 mapperLeftCall
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const mapperLeftCall = self => id => {
var mapper = self.mappersOnMap[id]
if (mapper) {
if (self.inConversation) {
var username = mapper.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 arrange
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. 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
- 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 handleURL
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
handleURL: function(url, opts = {}) {
let coords = opts.coords
if (!coords || coords.x === undefined || coords.y === undefined) {
coords = AutoLayout.getNextCoord({ mappings: DataModel.Mappings })
}
- 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 updateFromPath
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
updateFromPath: function(path) {
const self = ExploreMaps
const [_unused, generalSection, specificSection, id] = path.split('/')
if (generalSection === 'explore') {
- 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 exports
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(io, stunservers, state) {
io.on('connection', function(socket) {
socket.resources = {
screen: false,
video: 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 add_drop_down
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
add_drop_down: function(edge, synapse) {
var list, i, synapses, l, desc
synapses = edge.getData('synapses')
l = synapses.length
- Create a ticketCreate a ticket
Function initSearchOptions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
initSearchOptions: function() {
var self = Search
function toggleResultSet(set) {
var s = $('.tt-dataset-' + set + ' .tt-suggestion, .tt-dataset-' + set + ' .resultnoresult')
- Create a ticketCreate a ticket
Function handleCSV
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleCSV: function(text, parserOpts = {}) {
const self = Import
const topicsRegex = /("?Topics"?[, \t"]*)([\s\S]*)/mi
const synapsesRegex = /("?Synapses"?[, \t"]*)([\s\S]*)/mi
- Create a ticketCreate a ticket
Method embed_dat
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.embed_dat
embeddable.each_pair do |key, opts|
is_plural = key.to_s.pluralize == key.to_s
id_key = key.to_s.singularize + (is_plural ? '_ids' : '_id')
serializer = opts.delete(:serializer) || "Api::V2::#{key.to_s.singularize.camelize}Serializer".constantize
- Create a ticketCreate a ticket
Function updateSelectedPermissions
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateSelectedPermissions: function(permission) {
var edge, synapse, node, topic
GlobalUI.notifyUser('Working...')
- Create a ticketCreate a ticket
Function renderMidArrow
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderMidArrow: function(from, to, dim, swap, canvas, placement, newSynapse) {
const ctx = canvas.getCtx()
// invert edge direction
if (swap) {
const tmp = from
- Create a ticketCreate a ticket
Function onClick
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
onClick: function(node, eventInfo, e) {
// remove the rightclickmenu
ContextMenu.reset(ReactApp.render)
if (Mouse.boxStartCoordinates) {
- Create a ticketCreate a ticket
Function importSynapses
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
importSynapses: function(parsedSynapses) {
var self = Import
parsedSynapses.forEach(function(synapse) {
// only createSynapseWithParameters once both topics are persisted
- Create a ticketCreate a ticket
Function selectEdgeOnClickHandler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
selectEdgeOnClickHandler: function(adj, e) {
if (Visualize.mGraph.busy) return
const self = JIT
var synapseText = adj.data.$synapses[0].attributes.desc
- Create a ticketCreate a ticket
Function zoomToBox
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
zoomToBox: function(event) {
const sX = Mouse.boxStartCoordinates.x
const sY = Mouse.boxStartCoordinates.y
const eX = Mouse.boxEndCoordinates.x
const eY = Mouse.boxEndCoordinates.y
- Create a ticketCreate a ticket
Function VideoView
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var VideoView = function(video, $parent, id, isMyself, config) {
var self = this
this.$parent = $parent // mapView
- Create a ticketCreate a ticket