Showing 49 of 211 total issues
Function selectedNoteReducer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function selectedNoteReducer(
state: ?SelectedNote = null,
action: Action,
nextSifterResult: SifterResult
) {
- 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 loadingReducer
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function loadingReducer(
state: LoadingState = defaults,
action: Action,
notes: Notes,
fileReadFails: FileReadFails
Function _renderInline
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderInline() {
switch (this.props.loading.status) {
case "readDir":
return (
<div className="block">
Function writeNVtagsEpic
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function writeNVtagsEpic(
action$: rxjs$Observable<Action>,
state$: reduxRxjs$StateObservable<State>
) {
if (NVtags.unsupportedError) {
Function rootReducer
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function rootReducer(state: State | void, action: Action) {
if (!state) state = ({}: any); // just to be compliant with createStore
const fileReadFails = fileReadFailsReducer(state.fileReadFails, action);
const notes = notesReducer(state.notes, action);
const sifterResult = sifterResultReducer(state.sifterResult, action, notes);
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.props.loading.status !== "done") {
return (
<Loading
loading={this.props.loading}
Function readFilesAsObservable
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function readFilesAsObservable(
fileReadersArray: IFileReader[],
rawFile: RawFile,
dir: string
) {
Function previewEditor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const previewEditor = (): PreviewEditor => {
const editor: PreviewEditor = (atom.workspace.buildTextEditor({
// autoHeight is necessay for scrolling to work as expected.
// It's also done internally when opening a new text editor:
// https://github.com/atom/atom/blob/3e97867f3e3ffd1b04a3b25978a40eb1d377f52f/src/workspace.js#L1266
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div
ref={this._list}
onScroll={this._onScroll.bind(this)}
Function newEventPatternHandlers
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function newEventPatternHandlers(dir: string) {
let watcher;
let onWatcherDidError;
const addHandler = handler => {
Function newEventPatternHandlers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function newEventPatternHandlers(dir: string) {
let watcher;
let onWatcherDidError;
const addHandler = handler => {
- 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 _preview
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_preview(note: Note, searchMatch?: SearchMatch): Object {
const str = note.content;
let content;
if (str) {
- 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 renderContent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function renderContent(content: CellContent, i?: number) {
if (typeof content === "string") {
return content;
} else if (content instanceof Array) {
return content.map(renderContent);
- 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 loadingReducer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function loadingReducer(
state: LoadingState = defaults,
action: Action,
notes: Notes,
fileReadFails: FileReadFails
- 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 scrollTopReducer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
state: number = 0,
action: Action,
listHeight: number,
rowHeight: number,
nextSelectedNote: ?SelectedNote
Function fileReadFailsReducer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function fileReadFailsReducer(
state: FileReadFails = {},
action: Action
) {
let filename;
- 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(panel: atom$Panel) {
this._disposable = atom.commands.add(
"atom-workspace",
"textual-velocity:toggle-atom-window",
() => {
- 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 _defaultFileIcons
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_defaultFileIcons(path: string, note: Note) {
// from https://github.com/atom/tree-view/blob/9dcc89fc0c8505528f393b5ebdd93616a8adbd68/lib/default-file-icons.coffee
if (fs.isSymbolicLinkSync(path)) {
return "icon icon-file-symlink-file";
} else if (fs.isReadmePath(path)) {
- 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 scrollTopReducer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function scrollTopReducer(
state: number = 0,
action: Action,
listHeight: number,
rowHeight: number,
- 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 add
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
add(...values) {
// until https://github.com/eslint/eslint/issues/12117 is resolved:
// eslint-disable-next-line no-unused-vars
for (let val of values) {
if (!Disposable.isDisposable(val)) {
- 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"