Showing 90 of 251 total issues
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { edit, isCreateNew } = this.props;
return (
<HeaderWrapper>
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { snippet, theme } = this.props;
return (
<Router>
Function responseHandler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const responseHandler = (error, result, dispatch, action) => {
if (error) {
if (error.response && error.response.headers['x-github-otp']) {
setNotification({
title: 'Two factor authentication',
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (isElectron) {
const { ipcRenderer } = require('electron');
ipcRenderer.on('token', (event, token) => {
- 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 BaseSettings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const BaseSettings = ({ changeSettings }) => {
const updateSettings = (key, value, isTheme, isBoolean = false) => {
changeSettings(key, value, isTheme, isBoolean);
if (isBoolean) {
setBooleanSetting(key);
- 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 SnippetsSettings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const SnippetsSettings = ({ changeSettings }) => {
const updateSettings = (key, value, isBoolean = false) => {
changeSettings(key, value, false, isBoolean);
if (isBoolean) {
setBooleanSetting(key);
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { file, username, snippetId, edit, toggleCollapse, theme } = this.props;
const openOnWebUrl = `${getSnippetUrl('/gist')}/${username}/${snippetId}#file-${file.filename}`;
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
Avoid too many return
statements within this function. Open
return 'untagged';
Avoid too many return
statements within this function. Open
return flow([
set(['filter', 'text'], ''),
set(['filter', 'tags'], tag),
set(['filter', 'language'], ''),
set(['filter', 'status'], ''),
Avoid too many return
statements within this function. Open
return flow([
set('edit', {}),
set(['snippets', action.payload.id], snippetStructure(action.payload, state.starred))
])(state);
Avoid too many return
statements within this function. Open
return state;
Avoid too many return
statements within this function. Open
return filter({ truncated: true }, sortedSnippets);
Avoid too many return
statements within this function. Open
return flow([
set(['edit', 'description'], description),
set(['edit', 'files'], keyBy('uuid', preparedFiles))
])(state);
Avoid too many return
statements within this function. Open
return set(['edit', 'files', action.payload.uuid, 'delete'], true, state);
Avoid too many return
statements within this function. Open
return snippets;
Avoid too many return
statements within this function. Open
return set(['filter', 'tags'], without([action.payload.tag], state.filter.tags), state);
Avoid too many return
statements within this function. Open
return set(
['snippets', action.payload.id],
snippetStructure(action.payload, state.starred),
state
);
Avoid too many return
statements within this function. Open
return flow([
set(['filter', 'text'], ''),
set(['filter', 'tags'], []),
set(['filter', 'language'], ''),
set(['filter', 'status'], action.payload.status),
Avoid too many return
statements within this function. Open
return flow([
set(['starred'], concat([action.meta.id], state.starred)),
set(['snippets', action.meta.id, 'star'], true)
])(state);
Avoid too many return
statements within this function. Open
return set('snippets.edit', false, state);