bokuweb/tsukiakari

View on GitHub

Showing 103 of 103 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    const t = new T({
      consumer_key: global.consumerKey,
      consumer_secret: global.consumerSecret,
      access_token: account.accessToken,
      access_token_secret: account.accessTokenSecret,
Severity: Major
Found in src/browser/src/filter-stream.js and 1 other location - About 1 hr to fix
src/browser/src/user-stream.js on lines 6..12

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  render() {
    const { id, title, icon, subTitle, results } = this.props.column;
    return (
      <div className={b()}>
        <div className={b('wrapper', { title: true })}>
Severity: Minor
Found in src/renderer/src/components/timeline-box.js - About 1 hr to fix

    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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

          shouldComponentUpdate(nextProps: Props, nextState: State): bool {
            return !isEqual(this.props, nextProps) || !isEqual(this.state, nextState);
          }
        Severity: Major
        Found in src/renderer/src/components/tweet-window.js and 2 other locations - About 1 hr to fix
        src/renderer/src/components/account-list.js on lines 20..22
        src/renderer/src/components/add-column-menu.js on lines 105..107

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 55.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

          shouldComponentUpdate(nextProps: Props, nextState: State): bool {
            return !isEqual(this.props, nextProps) || !isEqual(this.state, nextState);
          }
        Severity: Major
        Found in src/renderer/src/components/add-column-menu.js and 2 other locations - About 1 hr to fix
        src/renderer/src/components/account-list.js on lines 20..22
        src/renderer/src/components/tweet-window.js on lines 138..140

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 55.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

          shouldComponentUpdate(nextProps: Props, nextState: State): bool {
            return !isEqual(this.props, nextProps) || !isEqual(this.state, nextState);
          }
        Severity: Major
        Found in src/renderer/src/components/account-list.js and 2 other locations - About 1 hr to fix
        src/renderer/src/components/add-column-menu.js on lines 105..107
        src/renderer/src/components/tweet-window.js on lines 138..140

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 55.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          onAddColumnClick() {
            if (this.props.isAddColumnMenuOpen) {
              this.props.closeAddColumnMenu();
            } else {
              this.props.openAddColumnMenu();
        Severity: Major
        Found in src/renderer/src/components/sidemenu.js and 2 other locations - About 1 hr to fix
        src/renderer/src/components/sidemenu.js on lines 25..31
        src/renderer/src/components/thin-sidemenu.js on lines 19..25

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 55.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          onTweetButtonClick() {
            if (this.props.isTweetWindowOpen) {
              this.props.closeTweetWindow();
            } else {
              this.props.openTweetWindow();
        Severity: Major
        Found in src/renderer/src/components/sidemenu.js and 2 other locations - About 1 hr to fix
        src/renderer/src/components/sidemenu.js on lines 17..23
        src/renderer/src/components/thin-sidemenu.js on lines 19..25

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 55.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          onAddColumnClick() {
            if (this.props.isAddColumnMenuOpen) {
              this.props.closeAddColumnMenu();
            } else {
              this.props.openAddColumnMenu();
        Severity: Major
        Found in src/renderer/src/components/thin-sidemenu.js and 2 other locations - About 1 hr to fix
        src/renderer/src/components/sidemenu.js on lines 17..23
        src/renderer/src/components/sidemenu.js on lines 25..31

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 55.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        function mapStateToProps(state) {
          return {
            accounts: state.accounts.accounts,
            columns: state.tweets.columns,
            timeline: state.tweets.timeline,
        Severity: Minor
        Found in src/renderer/src/containers/contents.js and 1 other location - About 50 mins to fix
        src/renderer/src/containers/lightbox.js on lines 6..12

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 52.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        function mapStateToProps(state) {
          return {
            images: state.lightbox.images,
            currentImage: state.lightbox.currentImage,
            isOpen: state.lightbox.isLightBoxOpen,
        Severity: Minor
        Found in src/renderer/src/containers/lightbox.js and 1 other location - About 50 mins to fix
        src/renderer/src/containers/contents.js on lines 7..13

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 52.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        function mapDispatchToProps(dispatch: Dispatch): Object {
          return {
            post: bindActionCreators(tweets.postTweet, dispatch),
            close: bindActionCreators(sidemenu.closeTweetWindow, dispatch),
            uploadMedia: bindActionCreators(tweets.uploadMedia, dispatch),
        Severity: Minor
        Found in src/renderer/src/containers/tweet-window.js and 1 other location - About 45 mins to fix
        src/renderer/src/containers/lightbox.js on lines 14..20

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 50.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          constructor(props) {
            super(props);
            this.state = { destroyTooltip: false };
            this.removeAccount = ::this.removeAccount;
          }
        Severity: Major
        Found in src/renderer/src/components/account.js and 2 other locations - About 45 mins to fix
        src/renderer/src/components/accounts.js on lines 12..16
        src/renderer/src/components/tweetitem.js on lines 26..30

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 50.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          constructor(props) {
            super(props);
            this.state = { destroyTooltip: false };
            this.onAddRequest = ::this.onAddRequest;
          }
        Severity: Major
        Found in src/renderer/src/components/accounts.js and 2 other locations - About 45 mins to fix
        src/renderer/src/components/account.js on lines 9..13
        src/renderer/src/components/tweetitem.js on lines 26..30

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 50.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            shouldComponentUpdate(nextProps) {
                return this.props.paused !== nextProps.paused ||
                       this.props.togglePlay !== nextProps.togglePlay;
            },
        Severity: Minor
        Found in src/renderer/stylesheets/components/controls/play/Play.js and 1 other location - About 45 mins to fix
        src/renderer/stylesheets/components/controls/time/Time.js on lines 17..20

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 50.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          declare type ForkEffect<C, Fn, Args> = $npm$ReduxSaga$IOEffect & {
            FORK: {
              context: C,
              fn: Fn,
              args: Args,
        Severity: Major
        Found in flow-typed/npm/redux-saga_v0.11.x.js and 2 other locations - About 45 mins to fix
        flow-typed/npm/redux-saga_v0.11.x.js on lines 177..183
        flow-typed/npm/redux-saga_v0.11.x.js on lines 193..199

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 50.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        function mapDispatchToProps(dispatch) {
          return {
            onClose: bindActionCreators(lightbox.closeLightBox, dispatch),
            onClickNext: bindActionCreators(lightbox.showNextImage, dispatch),
            onClickPrev: bindActionCreators(lightbox.showPrevImage, dispatch),
        Severity: Minor
        Found in src/renderer/src/containers/lightbox.js and 1 other location - About 45 mins to fix
        src/renderer/src/containers/tweet-window.js on lines 20..26

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 50.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language