viddo/atom-textual-velocity

View on GitHub

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
) {
Severity: Minor
Found in lib/reducers/selectedNoteReducer.js - About 1 hr to fix

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 _renderInline has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _renderInline() {
    switch (this.props.loading.status) {
      case "readDir":
        return (
          <div className="block">
Severity: Minor
Found in lib/react/presentationals/Loading.js - About 1 hr to fix

    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
    Severity: Minor
    Found in lib/reducers/loadingReducer.js - About 1 hr to fix

      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) {
      Severity: Minor
      Found in lib/epics/writeNVtagsEpic.js - About 1 hr to fix

        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);
        Severity: Minor
        Found in lib/reducers/index.js - About 1 hr to fix

          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}
          Severity: Minor
          Found in lib/react/containers/App.js - About 1 hr to fix

            Function readFilesAsObservable has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function readFilesAsObservable(
              fileReadersArray: IFileReader[],
              rawFile: RawFile,
              dir: string
            ) {
            Severity: Minor
            Found in lib/epics/fileReadsEpic.js - About 1 hr to fix

              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
              Severity: Minor
              Found in lib/previewEditor.js - About 1 hr to fix

              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)}
              Severity: Minor
              Found in lib/react/presentationals/ScrollableList.js - About 1 hr to fix

                Function newEventPatternHandlers has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function newEventPatternHandlers(dir: string) {
                  let watcher;
                  let onWatcherDidError;
                
                  const addHandler = handler => {
                Severity: Minor
                Found in lib/epics/pathWatcherEpic.js - About 1 hr to fix

                  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) {
                  Severity: Minor
                  Found in lib/columns/SummaryColumn.js - About 55 mins to fix

                  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 newEventPatternHandlers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function newEventPatternHandlers(dir: string) {
                    let watcher;
                    let onWatcherDidError;
                  
                    const addHandler = handler => {
                  Severity: Minor
                  Found in lib/epics/pathWatcherEpic.js - About 55 mins to fix

                  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
                  Severity: Minor
                  Found in lib/reducers/loadingReducer.js - About 45 mins to fix

                  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);
                  Severity: Minor
                  Found in lib/react/presentationals/Cell.js - About 45 mins to fix

                  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
                  Severity: Minor
                  Found in lib/reducers/scrollTopReducer.js - About 35 mins to fix

                    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)) {
                    Severity: Minor
                    Found in lib/Disposables.js - About 35 mins to fix

                    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 fileReadFailsReducer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function fileReadFailsReducer(
                      state: FileReadFails = {},
                      action: Action
                    ) {
                      let filename;
                    Severity: Minor
                    Found in lib/reducers/fileReadFailsReducer.js - About 35 mins to fix

                    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",
                          () => {
                    Severity: Minor
                    Found in lib/ToggleAtomWindow.js - About 35 mins to fix

                    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,
                    Severity: Minor
                    Found in lib/reducers/scrollTopReducer.js - About 35 mins to fix

                    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)) {
                    Severity: Minor
                    Found in lib/columns/FileIconColumn.js - About 35 mins to fix

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language