Showing 45 of 77 total issues
Function droppable
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
export const droppable = (el, options = {}) => {
const {strict, type, effect, dataTransferProperty, ondragenter, ondragover, ondragleave, ondrop} = {
type: 'application/json',
effect: 'move',
dataTransferProperty: 'files',
Function loadOptionsFromConfig
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const loadOptionsFromConfig = (config, appName, windowId) => {
const matchStringOrRegex = (str, matcher) => matcher instanceof RegExp
? !!str.match(matcher)
: str === matcher;
- 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 _launch
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_launch(name, metadata, args, options) {
const _ = this.core.make('osjs/locale').translate;
const canLaunch = createPackageAvailabilityCheck(this.core);
const dialog = e => {
- 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 createWindow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
createWindow(options = {}) {
const found = this.windows.find(w => w.id === options.id);
if (found) {
const msg = this.core.make('osjs/locale')
.translate('ERR_WINDOW_ID_EXISTS', options.id);
- 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 render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const onclick = () => this.destroy();
const renderCustom = () => {
const view = state => h('div', {
- 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 browserLocale
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const browserLocale = (nav = {}) => {
const browserLanguage = nav.userLanguage || nav.language || '';
const get = l => prefixMap[l] ? prefixMap[l] : (l.match(/_/)
? l
: (l ? `${l}_${l.toUpperCase()}` : ''));
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const create = (core, $element) => {
const _ = core.make('osjs/locale').translate;
const fs = core.make('osjs/fs');
const {icon} = core.make('osjs/theme');
const view = createView(core, fs, icon, _);
- 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 renderCallback
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const renderCallback = (win, callback) => {
if (typeof callback === 'function') {
if (win.attributes.shadowDOM) {
try {
const mode = typeof win.attributes.shadowDOM === '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
Avoid deeply nested control flow statements. Open
if (tagName === 'TEXTAREA') {
handleTabOnTextarea(e);
}
Function applyBackgroundStyles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const applyBackgroundStyles = (core, background) => {
const {$root} = core;
const styles = {
backgroundRepeat: 'no-repeat',
- 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 createFields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const createFields = (props, fields, disabled) => {
const children = f => {
if (f.tagName === 'select' && f.choices) {
return f.choices.map(c => h('option', {
current: c.current ? 'current' : undefined,
- 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 createSoundsContract
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
createSoundsContract() {
const {soundResource, soundsEnabled} = resourceResolver(this.core);
return {
resource: soundResource,
- 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 createGlobalApi
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
createGlobalApi() {
const globalBlacklist = this.core.config('providers.globalBlacklist', []);
const globalWhitelist = this.core.config('providers.globalWhitelist', []);
const make = (name, ...args) => {
- 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 applySettings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
applySettings(settings) {
const lockSettings = this.core.config('desktop.lock');
const defaultSettings = this.core.config('desktop.settings');
let newSettings;
- 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 open
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
open(file, options = {}) {
if (file.mime === 'osjs/application') {
return this.run(file.path.split('/').pop());
}
- 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 resizeFit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
resizeFit(container) {
container = container || this.$content.firstChild;
if (container) {
const rect = this.core.has('osjs/desktop')
- 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 resizer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const resizer = (win, handle) => {
const clamp = clamper(win);
const {position, dimension} = win.state;
const directions = handle.getAttribute('data-direction').split('');
const going = dir => directions.indexOf(dir) !== -1;
- 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 get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
get(ns, key, defaultValue) {
if (typeof ns === 'undefined') {
return {...this.settings};
} else if (typeof this.settings[ns] === 'undefined') {
return key ? defaultValue : defaultValue || {};
- 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 dblclick
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
dblclick(ev, win) {
if (this.lastAction) {
return;
}
- 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 iconClick
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
iconClick(ev, win) {
const {minimized, maximized} = win.state;
const {minimizable, maximizable, closeable} = win.attributes;
const _ = this.core.make('osjs/locale').translate;
- 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"