src/JSUtils/Session.js
File Session.js
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Copyright (c) 2013 - present Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Function getHints
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Session.prototype.getHints = function (query, matcher) {
if (query === undefined) {
query = "";
}
Function getParameterHint
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Session.prototype.getParameterHint = function () {
var fnHint = this.fnType,
cursor = this.getCursor(),
token = this.getToken(this.functionCallPos),
start = {line: this.functionCallPos.line, ch: token.start},
Function getFunctionInfo
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Session.prototype.getFunctionInfo = function () {
var inFunctionCall = false,
cursor = this.getCursor(),
functionCallPos,
token = this.getToken(cursor),
Function filterWithQueryAndMatcher
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function filterWithQueryAndMatcher(hints, matcher) {
var matchResults = $.map(hints, function (hint) {
var searchResult = matcher.match(hint.value, query);
if (searchResult) {
searchResult.value = hint.value;
Function matchResults
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var matchResults = $.map(hints, function (hint) {
var searchResult = matcher.match(hint.value, query);
if (searchResult) {
searchResult.value = hint.value;
searchResult.guess = hint.guess;
Avoid deeply nested control flow statements. Open
Open
} else if (i + 1 === n) {
// look for a comma after the node.end. This will tell us we
// are on the next argument, even there is no text, and therefore no node,
// for the next argument.
text = fragment.substring(node.end, offset);
Avoid deeply nested control flow statements. Open
Open
if (text.indexOf(",") >= (offset - lastEnd)) {
// comma is after the offset so the current arg is the
// previous arg node.
i--;
} else if (i === 0 && text.indexOf("(") !== -1) {
Avoid too many return
statements within this function. Open
Open
return 0;