Showing 1,485 of 3,294 total issues
Function _watchOrUnwatchEntry
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FileSystem.prototype._watchOrUnwatchEntry = function (entry, watchedRoot, callback, shouldWatch) {
var impl = this._impl,
recursiveWatch = impl.recursiveWatch,
commandName = shouldWatch ? "watchPath" : "unwatchPath",
filterGlobs = watchedRoot.filterGlobs;
Function handleFSEvent
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ProjectModel.prototype.handleFSEvent = function (entry, added, removed) {
this._resetCache();
if (!entry) {
this.refresh();
Function _getSearchMatches
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _getSearchMatches(contents, queryExpr) {
// Quick exit if not found or if we hit the limit
if (searchModel.foundMaximum || contents.search(queryExpr) === -1) {
return [];
}
Function setInlineContent
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
InlineTextEditor.prototype.setInlineContent = function (doc, startLine, endLine) {
var self = this;
// Destroy the previous editor if we had one and clear out the filename info.
if (this.editor) {
Function openLine
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function openLine(editor, direction) {
editor = editor || EditorManager.getFocusedEditor();
if (!editor) {
return;
}
Function extractAndValidateFiles
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function extractAndValidateFiles(zipPath, extractDir, options, callback) {
var unzipper = new DecompressZip(zipPath);
unzipper.on("error", function (err) {
// General error to report for problems reading the file
callback(null, {
Function performCleanup
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function performCleanup(requester, filesToCache, notifyBack) {
var currentRequester = requester || "";
function filterFilesAndNotify(files, filesToCacheArr, notifyBackToBrackets) {
files.forEach(function (file) {
var fileExt = path.extname(path.basename(file));
Function _determineDate
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_determineDate: function(inst, date, defaultDate) {
var offsetNumeric = function(offset) {
var date = new Date();
date.setDate(date.getDate() + offset);
return date;
Function init
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init(domainManager) {
if (!domainManager.hasDomain("AutoUpdate")) {
domainManager.registerDomain("AutoUpdate", {
major: 0,
minor: 1
Function _createFileEntries
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _createFileEntries($mrofList) {
var data, fileEntry, $link, $newItem;
// Iterate over the MROF list and create the pop over UI items
// If we are in split view we might want to show the panes corresponding to the entries
Function _toggle
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_toggle: function( event, eventData ) {
var that = this,
toShow = eventData.newPanel,
toHide = eventData.oldPanel;
Function statement
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function statement(noindent) {
var i = indent, r, s = scope, t = nexttoken;
if (t.id === ";") {
advance(";");
Function CHILD
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CHILD: function( elem, match ) {
var first, last,
doneName, parent, cache,
count, diff,
type = match[1],
Function data
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
data: function( key, value ) {
var parts, part, attr, name, l,
elem = this[0],
i = 0,
data = null;
Function render
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
var fullname = this.props.name,
extension = LanguageManager.getCompoundFileExtension(fullname),
name = _getName(fullname, extension);
Function buildFragment
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildFragment: function( elems, context, scripts, selection ) {
var elem, tmp, tag, wrap, contains, j,
fragment = context.createDocumentFragment(),
nodes = [],
i = 0,
Function hashJSObj
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function hashJSObj(obj) {
var hash;
if (usingWeakMap) {
hash = weakMap.get(obj);
if (hash !== undefined) {
Function RemoteAgent
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
define(function RemoteAgent(require, exports, module) {
"use strict";
var LiveDevelopment = require("LiveDevelopment/LiveDevelopment"),
EventDispatcher = require("utils/EventDispatcher"),
- 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 JSDocumentModule
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
define(function JSDocumentModule(require, exports, module) {
"use strict";
var EventDispatcher = require("utils/EventDispatcher"),
Inspector = require("LiveDevelopment/Inspector/Inspector"),
- 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 getFragmentAround
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getFragmentAround(session, start) {
var minIndent = null,
minLine = null,
endLine,
cm = session.editor._codeMirror,