Showing 63 of 446 total issues
Function waitForAudio
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const waitForAudio = setInterval(() => {
if (document.querySelectorAll(audioSelector).length > 0) {
clearInterval(waitForAudio);
// DEV: We do this here so that we can set the output device before hooking the context
Function postMessage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
postMessage: (obj) => {
if (extensionId === GOOGLE_MINI_PLAYER_EXT_ID) {
if (obj.type === PING) {
onMessage.call({ type: PONG, sentFrom: 'bg' });
} else if (obj.type === TRIGGER_CONNECT) {
Function _save
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const _save = () => {
if (!mini) {
if (mainWindow.isFullScreen()) {
Settings.set('fullscreen', true);
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 connect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
connect: (extensionId) => {
const createChannel = (label) => { // eslint-disable-line
const fns = [];
return {
addListener: (...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 set
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
set(key, value) {
if (this.coupled) {
const valChanged = this.data[key] !== value;
this.data[key] = value;
if (this._hooks[key] && valChanged) {
- 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 _registerHotkeyIfSet
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const _registerHotkeyIfSet = (accelerator, action) => {
if (accelerator) {
try {
const success = globalShortcut.register(accelerator, () => {
if (action === 'showLyrics') {
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (process.platform === this.props.platform) {
if (!this.props.versionRange) return this.props.children;
if (osVersion === null) {
- 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 fetchLyrics
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const fetchLyrics = (track, artist) =>
fetchLyricsPage(track, artist)
.then((url) =>
new Promise((resolve, reject) => {
request(url, (err, resp) => {
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
const muiTheme = generateTheme(this.state.theme, this.state.themeColor, this.state.themeType);
const fadedBackground = {};
if (this.state.theme && this.state.themeType === 'FULL') {
- 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 receiverFn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const receiverFn = (receivers) =>
new Promise((resolve, reject) => {
let dialog = document.createElement('paper-dialog');
trigID++;
const body = document.getElementsByTagName('body')[0];
- 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 installSidebarButton
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function installSidebarButton(translationKey, type, icon, index, href, fn) {
Function showToast
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
window.showToast = function (text, dismissable, buttonText, buttonColor, buttonEventFunction, postCreationFunction) { // eslint-disable-line
Function _load
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_load(retryCount = 5) {
let userSettings;
try {
userSettings = JSON.parse(fs.readFileSync(this.PATH, 'utf8'));
} catch (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 _save
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_save() {
if (Settings.get('enableJSON_API', true)) {
try {
fs.writeFileSync(this.PATH, JSON.stringify(this.data, null, 4));
} catch (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 constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor(...args) {
super(...args);
this.once = true;
const service = Settings.get('service');
- 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 generateGulpLinuxDistroTask
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const generateGulpLinuxDistroTask = (prefix, name, arch) => {
gulp.task(`${prefix}:linux:${arch}`, [`package:linux:${arch}`], (done) => {
const tool = require(`electron-installer-${name}`);
const defaults = {
- 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 too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return true;
Function waitForExternal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const waitForExternal = setInterval(() => {
if (serviceReady()) {
clearInterval(waitForExternal);
if (service === 'youtube-music') {
- 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 setContextMenu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const setContextMenu = (track) => {
const contextMenu = Menu.buildFromTemplate([
{
label: 'Service',
enabled: false,
- 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"