Showing 183 of 2,044 total issues
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.props.authorizedToEdit) {
return (
<span className="title">
<RIETextArea value={this.props.name}
- Create a ticketCreate a ticket
Method update
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
@user = User.find(current_user.id)
if user_params[:password] == '' && user_params[:password_confirmation] == ''
# not trying to change the password
- Create a ticketCreate a ticket
Function handleURL
has 37 lines of code (exceeds 25 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 })
}
- Create a ticketCreate a ticket
Function add_perms_form
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
add_perms_form: function(synapse) {
// permissions - if owner, also allow permission editing
$('#editSynLowerBar').append('<div class="mapPerm ' + synapse.get('permission').substring(0, 2) + '"></div>')
// ability to change permission
- Create a ticketCreate a ticket
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { currentUser, signInPage, unreadNotificationsCount,
notifications, fetchNotifications, openInviteLightbox,
markAsRead, markAsUnread } = this.props
const { accountBoxOpen, notificationsBoxOpen } = this.state
- Create a ticketCreate a ticket
Function getNextCoord
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
getNextCoord: function(opts = {}) {
var self = AutoLayout
var nextX = self.nextX
var nextY = self.nextY
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
'render': function(node, canvas) {
const pos = node.pos.getc(true)
const dim = node.getData('dim')
const topic = node.getData('topic')
const metacode = topic ? topic.getMetacode() : 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"
Further reading
Method should_auto_follow
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def should_auto_follow(entity, user, reason)
follow = Follow.where(followed: entity, user: user).first
return false if follow && follow.muted
if entity.class == Topic
return user.settings.follow_topic_on_created == '1' if reason == 'created'
- 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 getNextCoord
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
getNextCoord: function(opts = {}) {
var self = AutoLayout
var nextX = self.nextX
var nextY = self.nextY
- Create a ticketCreate a ticket
Function canvasClickHandler
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
canvasClickHandler: function(canvasLoc, e) {
// grab the location and timestamp of the click
const storedTime = Mouse.lastCanvasClick
const now = Date.now() // not compatible with IE8 FYI
Mouse.lastCanvasClick = now
- Create a ticketCreate a ticket
Function createSynapseLocally
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
createSynapseLocally: function() {
var self = Synapse
let topic1
let topic2
let node1
- Create a ticketCreate a ticket
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { children, toast, unreadNotificationsCount, openInviteLightbox,
mobile, mobileTitle, mobileTitleWidth, mobileTitleClick, location,
map, userRequested, requestAnswered, requestApproved, serverData,
onRequestAccess, notifications, fetchNotifications,
- Create a ticketCreate a ticket
Function add_desc_form
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
add_desc_form: function(synapse) {
var dataNil = 'Click to add description.'
// TODO make it so that this would work even in sandbox mode,
// currently with Best_in_place it won't
- Create a ticketCreate a ticket
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { currentUser, map, topic, canEditMap, filterBoxHtml, onFilterClick, onImportClick, onForkClick,
filterData, allForFiltering, visibleForFiltering, toggleMetacode, toggleMapper, toggleSynapse,
filterAllMetacodes, filterAllMappers, filterAllSynapses } = this.props
const { filterBoxOpen } = this.state
- Create a ticketCreate a ticket
Function showImagePreview
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
showImagePreview: function() {
var file = $('#user_image')[0].files[0]
var reader = new window.FileReader()
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (fromNodeX >= minBoxX && fromNodeX <= maxBoxX && fromNodeY >= minBoxY && fromNodeY <= maxBoxY && toNodeX >= minBoxX && toNodeX <= maxBoxX && toNodeY >= minBoxY && toNodeY <= maxBoxY) {
selectTest = true
}
- 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 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 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 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"