Showing 1,485 of 3,294 total issues
Function _setDirectoryOpen
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _setDirectoryOpen(treeData, path, open) {
var objectPath = _filePathToObjectPath(treeData, path),
directory = treeData.getIn(objectPath);
if (!objectPath) {
Function registerHandlersAndDomains
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function registerHandlersAndDomains(ws, port) {
// Called if we succeed at the final setup
function success() {
self._ws.onclose = function () {
if (self._autoReconnect) {
Function _sendData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _sendData(fileSize) {
var subType = "";
if(fileSize/1024 <= 1) {
Function on
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var on = function (events, fn) {
var eventsList = events.split(/\s+/).map(splitNs),
i;
if (!fn) {
Function style
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
Function getTagInfo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getTagInfo(editor, pos) {
var ctx, offset, tagAttrs, tagAttrValue;
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
offset = TokenUtils.offsetInToken(ctx);
Function findBlocks
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function findBlocks(editor, modeName) {
// Start scanning from beginning of file
var ctx = TokenUtils.getInitialContext(editor._codeMirror, {line: 0, ch: 0}),
blocks = [],
currentBlock = null,
Function removeClass
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
removeClass: function( value ) {
var classes, elem, cur, clazz, j, finalValue,
proceed = arguments.length === 0 || typeof value === "string" && value,
i = 0,
len = this.length;
Function load
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
Function popUpHint
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function popUpHint(editor, explicit, onCursorActivity) {
var request = null;
var $deferredPopUp = $.Deferred();
var sessionProvider = null;
Function addClass
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addClass: function( value ) {
var classes, elem, cur, clazz, j, finalValue,
proceed = typeof value === "string" && value,
i = 0,
len = this.length;
Function createFilterPicker
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createFilterPicker(context) {
function itemRenderer(item, index) {
if (index < FIRST_FILTER_INDEX) {
// Prefix the two filter commands with 'recent-filter-name' so that
Function _doOpenWithOptionalPath
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _doOpenWithOptionalPath(fullPath, silent, paneId, options) {
var result;
paneId = paneId || MainViewManager.ACTIVE_PANE;
if (!fullPath) {
// Create placeholder deferred
Function parsePersonString
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
function parsePersonString(obj) {
if (typeof (obj) === "string") {
var parts = _personRegex.exec(obj);
// No regex match, so we just synthesize an object with an opaque name string
- Read upRead up
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 QuickOpenPlugin
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function QuickOpenPlugin(name, languageIds, done, search, match, itemFocus, itemSelect, resultsFormatter, matcherOptions, label) {
Function removeMenu
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function removeMenu(id) {
var menu,
commandID = "";
if (!id) {
Function _onActiveEditorChange
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _onActiveEditorChange(event, current, previous) {
if (previous) {
previous.off(".statusbar");
previous.document.off(".statusbar");
previous.document.releaseRef();
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 onClose
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onClose: function () {
var body = window.document.getElementsByTagName("body")[0],
overlay = window.document.createElement("div"),
background = window.document.createElement("div"),
status = window.document.createElement("div");
Function positionPreview
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function positionPreview(editor, xpos, ypos, ybot) {
var previewWidth = $previewContainer.outerWidth(),
top = ypos - $previewContainer.outerHeight() - POINTER_HEIGHT,
left = xpos - previewWidth / 2,
elementRect = {