Showing 1,485 of 3,294 total issues
Function _mergePanes
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _mergePanes() {
if (_panes.hasOwnProperty(SECOND_PANE)) {
var firstPane = _panes[FIRST_PANE],
secondPane = _panes[SECOND_PANE],
Function _keydownHook
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _keydownHook(event) {
var keyCode;
// (page) up, (page) down, enter and tab key are handled by the list
if (event.type === "keydown") {
Function setSelected
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ProjectModel.prototype.setSelected = function (path, doNotOpen) {
path = _getPathFromFSObject(path);
// Directories are not selectable
if (!_pathIsFile(path)) {
Function _initialLayout
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _initialLayout(forceRefresh) {
var panes = Object.keys(_panes),
size = 100 / panes.length;
_.forEach(_panes, function (pane) {
Function DOMUpdater
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DOMUpdater(previousDOM, editor, changeList) {
var text, startOffset = 0, startOffsetPos;
this.isIncremental = false;
Function positionHint
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function positionHint(xpos, ypos, ybot) {
var hintWidth = $hintContainer.width(),
hintHeight = $hintContainer.height(),
top = ypos - hintHeight - POINTER_TOP_OFFSET,
left = xpos,
Function finish
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
finish: function( type ) {
if ( type !== false ) {
type = type || "fx";
}
return this.each(function() {
Function __iteratorUncached
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
if (reverse) {
return this.cacheResult().__iterator(type, reverse);
}
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
Function interposeFactory
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function interposeFactory(iterable, separator) {
var interposedSequence = makeSequence(iterable);
interposedSequence.size = iterable.size && iterable.size * 2 -1;
interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
var iterations = 0;
Function ModalBar
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ModalBar(template, autoClose, animate) {
if (animate === undefined) {
animate = true;
}
Function _handleKeyDown
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
QuickSearchField.prototype._handleKeyDown = function (event) {
if (event.keyCode === KeyEvent.DOM_VK_RETURN) {
// Enter should always act on the latest results. If input has changed and we're still waiting for
// new results, just flag the 'commit' for later
if (this._displayedQuery === this.$input.val()) {
Function _handleItemSelect
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
QuickNavigateDialog.prototype._handleItemSelect = function (selectedItem, query) {
var doClose = true,
self = this;
Function showSearchHints
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FindBar.prototype.showSearchHints = function () {
var self = this;
var searchFieldInput = self.$("#find-what");
this.searchField = new QuickSearchField(searchFieldInput, {
verticalAdjust: searchFieldInput.offset().top > 0 ? 0 : this._modalBar.getRoot().outerHeight(),
Function searchAndShowResults
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function searchAndShowResults(queryInfo, scope, filter, replaceText, candidateFilesPromise) {
return FindInFiles.doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise)
.done(function (zeroFilesToken) {
// Done searching all files: show results
if (FindInFiles.searchModel.hasResults()) {
Function ScriptAgent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
define(function ScriptAgent(require, exports, module) {
"use strict";
var Inspector = require("LiveDevelopment/Inspector/Inspector");
var DOMAgent = require("LiveDevelopment/Agents/DOMAgent");
- 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
Method typedef
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def typedef(domain, info)
return "[" + typedef(domain, info['items']) + "]" if info['items']
if info["$ref"]
ref = info["$ref"]
ref = domain + "." + ref unless ref =~ /\./
- 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 getJumptoDef
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getJumptoDef(fileInfo, offset) {
var request = buildRequest(fileInfo, "definition", offset);
// request.query.typeOnly = true; // FIXME: tern doesn't work exactly right yet.
try {
Function _translateKeyboardEvent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _translateKeyboardEvent(event) {
var hasMacCtrl = (brackets.platform === "mac") ? (event.ctrlKey) : false,
hasCtrl = (brackets.platform !== "mac") ? (event.ctrlKey) : (event.metaKey),
hasAlt = (event.altKey),
hasShift = (event.shiftKey),
Function _updateCursorInfo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _updateCursorInfo(event, editor) {
editor = editor || EditorManager.getActiveEditor();
// compute columns, account for tab size
var cursor = editor.getCursorPos(true);
Function _setImplementation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _setImplementation(multibrowser) {
if (multibrowser) {
// set implemenation
LiveDevImpl = MultiBrowserLiveDev;
// update styles for UI status