Showing 284 of 423 total issues
Function patchDisplay
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function patchDisplay(cm, updateNumbersFrom, dims) {
var display = cm.display, lineNumbers = cm.options.lineNumbers
var container = display.lineDiv, cur = container.firstChild
function rm(node) {
Consider simplifying this complex logical expression. Open
Open
if (context.line >= cm.display.viewFrom) { // Visible
var oldStyles = line.styles
var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null
var highlighted = highlightLine(cm, line, context, true)
if (resetState) { context.state = resetState }
Consider simplifying this complex logical expression. Open
Open
if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
(sp.to == null || sp.to != span.from) &&
(sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
lineIsHiddenInner(doc, line, sp)) { return true }
Consider simplifying this complex logical expression. Open
Open
if (this.contextMenuPending || !cm.state.focused ||
(hasSelection(input) && !prevInput && !this.composing) ||
cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
{ return false }
Function runMode
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
var flattenSpans = mode.flattenSpans
if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }
var curStart = 0, curStyle = null
var stream = new StringStream(text, cm.options.tabSize, context), style
Function addChangeToHistory
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addChangeToHistory(doc, change, selAfter, opId) {
var hist = doc.history
hist.undone.length = 0
var time = +new Date, cur
var last
Function nodeAndOffsetInLineMap
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function nodeAndOffsetInLineMap(map, ch, bias) {
var node, start, end, collapse, mStart, mEnd
// First, search the line map for the text node corresponding to,
// or closest to, the target character.
for (var i = 0; i < map.length; i += 3) {
Function iconName
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
iconName(name) {
switch (name) {
case "fas fa-terminal":
return "terminal"
case "fab fa-discord":
Function leftButtonStartDrag
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function leftButtonStartDrag(cm, event, pos, behavior) {
var display = cm.display, moved = false
var dragEnd = operation(cm, function (e) {
if (webkit) { display.scroller.draggable = false }
cm.state.draggingText = false
Function poll
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
TextareaInput.prototype.poll = function () {
var this$1 = this;
var cm = this.cm, input = this.textarea, prevInput = this.prevInput
// Since this is called a *lot*, try to bail out as cheaply as
Function parseError
has 13 return statements (exceeds 4 allowed). Open
Open
func parseError(f *failures.Failure) string {
if f.Method == "checkin" {
return fmt.Sprintf("Checkin is Offline")
}
err := strings.Contains(f.Issue, "connection reset by peer")
Function top
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
states.top = function(type, stream, state) {
if (type == "{") {
return pushContext(state, stream, "block");
} else if (type == "}" && state.context.prev) {
return popContext(state);
Function settingsImportHandler
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func settingsImportHandler(w http.ResponseWriter, r *http.Request) {
data, err := ioutil.ReadAll(r.Body)
if err != nil {
sendErrorJson(err, w, r)
return
Function top
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
states.top = function(type, stream, state) {
if (type == "{") {
return pushContext(state, stream, "block");
} else if (type == "}" && state.context.prev) {
return popContext(state);
Function addWidget
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addWidget: function(pos, node, scroll, vert, horiz) {
var display = this.display
pos = cursorCoords(this, clipPos(this.doc, pos))
var top = pos.bottom, left = pos.left
node.style.position = "absolute"
Function ParseQueries
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func ParseQueries(r *http.Request, o isObject) (*GroupQuery, error) {
fields := parseGet(r)
grouping := fields.Get("group")
startField := utils.ToInt(fields.Get("start"))
endField := utils.ToInt(fields.Get("end"))
Function LoadConfigForm
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func LoadConfigForm(r *http.Request) (*DbConfig, error) {
if err := r.ParseForm(); err != nil {
return nil, err
}
g := r.PostForm.Get
Function update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NativeScrollbars.prototype.update = function (measure) {
var needsH = measure.scrollWidth > measure.clientWidth + 1
var needsV = measure.scrollHeight > measure.clientHeight + 1
var sWidth = measure.nativeBarWidth
Function CheckTcp
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func CheckTcp(s *Service, record bool) (*Service, error) {
defer s.updateLastCheck()
timer := prometheus.NewTimer(metrics.ServiceTimer(s.Name))
defer timer.ObserveDuration()
Function processSetupHandler
has 11 return statements (exceeds 4 allowed). Open
Open
func processSetupHandler(w http.ResponseWriter, r *http.Request) {
var err error
if core.App.Setup {
sendErrorJson(errors.New("Statping has already been setup"), w, r)
return