bokuweb/tsukiakari

View on GitHub

Showing 27 of 103 total issues

Function ADD_COLUMN has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  ADD_COLUMN: (state, action) => {
    const { account, type, params } = action.payload;
    const id = uuid.v4();
    const title = type; // TODO: If mixed columns, custom timeline
    const icon = iconSelector[type];
Severity: Minor
Found in src/renderer/src/reducers/tweets.js - About 1 hr to fix

    Function renderControls has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        renderControls() {
            var extendedProps = Object.assign({
                // The public methods that all controls should be able to
                // use.
                togglePlay: this.togglePlay,
    Severity: Minor
    Found in src/renderer/stylesheets/components/video/Video.js - About 1 hr to fix

      Function subscribe has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      const subscribe = (account: Account) => (
        eventChannel((emit: EmitterFn) => {
          ipcRenderer.on('filterstream-tweet', (_: any, tweet: Tweet, queries: Array<string>) => {
            log.debug('Recieve serach tweet.');
            window.requestIdleCallback(() => {
      Severity: Minor
      Found in src/renderer/src/sagas/filter-stream.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 postTweet has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export const postTweet = (account, status, replyTweet) => (dispatch, getState) => {
        if (status === '') return;
        const media = getState().tweetWindow.media;
        const mediaIds = media.map(m => m.id).join(',');
        const { accessToken, accessTokenSecret } = account;
      Severity: Minor
      Found in src/renderer/src/actions/tweets.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 RECIEVE_TWEET has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        RECIEVE_TWEET: (state, action) => {
          // TODO: refactor
          let results;
          const { account: { id_str }, tweet, type, q } = action.payload;
          const key = type === 'Search' ? `${q}:${type}` : `${id_str}:${type}`;
      Severity: Minor
      Found in src/renderer/src/reducers/tweets.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 DELETE_COLUMN has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        DELETE_COLUMN: (state, action) => {
          const { id, type, params } = action.payload;
          const queries = [...state.filterQueries];
          console.log(params.q);
          if (type === 'Search') {
      Severity: Minor
      Found in src/renderer/src/reducers/tweets.js - About 25 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 watchMediaUpload has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      function* watchMediaUpload() {
        while (true) {
          const { payload: { account, files } } = yield take('UPLOAD_MEDIA');
          const { accessToken, accessTokenSecret } = account;
          const twitter = new T(accessToken, accessTokenSecret);
      Severity: Minor
      Found in src/renderer/src/sagas/tweets.js - About 25 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