Showing 49 of 211 total issues
Avoid too many return
statements within this function. Open
return "icon icon-file-pdf";
Avoid too many return
statements within this function. Open
return { index, filename: nextSifterResult.items[index].id };
Avoid too many return
statements within this function. Open
return "icon icon-file-text";
Avoid too many return
statements within this function. Open
return "icon icon-file-binary";
Function save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
save(notes: Notes) {
const cachePath = path.join(this._dir, CACHE_FILENAME);
if (this._skipSave) {
try {
- 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 findFirstRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const findFirstRow = (content: string, searchRegexp?: RegExp) => {
if (searchRegexp) {
const searchMatch = content.match(searchRegexp);
if (searchMatch) {
// $FlowFixMe str.match returns an array according to flow core definitions (v0.78)
- 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 componentDidMount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
componentDidMount() {
this._disposables = new Disposables();
this._focusInputSubject = new Subject();
this._focusInputSubscription = this._focusInputSubject
- 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 setSortConfigs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function setSortConfigs(
sortField: string,
lastSort?: SortSearchOptions
) {
if (!lastSort) {
- 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 componentDidMount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
componentDidMount() {
this._resizeSubscription = fromEvent(window, "resize")
.pipe(debounceTime(50))
.subscribe(() => {
if (this._node) {
- 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"