chaskiq/chaskiq

View on GitHub

Showing 1,174 of 1,174 total issues

Method configure_hook has 814 lines of code (exceeds 50 allowed). Consider refactoring.
Open

    def self.configure_hook(kind:, ctx:)
      definitions = [

        {
          id: "aaokokaaaaaa",
Severity: Major
Found in app/services/message_apis/ui_catalog/presenter.rb - About 3 days to fix

    File messenger.tsx has 1722 lines of code (exceeds 1000 allowed). Consider refactoring.
    Open

    import React, { Component } from 'react';
    import ReactDOM from 'react-dom';
    import { setCookie, getCookie, deleteCookie } from './cookies';
    
    // import styled from '@emotion/styled'
    Severity: Major
    Found in app/javascript/packages/messenger/src/client_messenger/messenger.tsx - About 2 days to fix

      File icons.tsx has 1697 lines of code (exceeds 1000 allowed). Consider refactoring.
      Open

      import React from 'react';
      
      // import tw from 'tailwind.macro'
      import tw from 'twin.macro';
      import styled from '@emotion/styled';
      Severity: Major
      Found in app/javascript/packages/components/src/components/icons.tsx - About 2 days to fix

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

                      {
                        name: 'External Profiles',
                        component: (
                          <div>
                            <ul>
        Severity: Major
        Found in app/javascript/packages/components/src/components/UserData.tsx and 1 other location - About 2 days to fix
        app/javascript/packages/components/src/components/UserProfileCard.tsx on lines 175..231

        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 391.

        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

                  {
                    name: 'External Profiles',
                    component: (
                      <div>
                        <ul>
        app/javascript/packages/components/src/components/UserData.tsx on lines 216..274

        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 391.

        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

        File editor.tsx has 1613 lines of code (exceeds 1000 allowed). Consider refactoring.
        Open

        import React, { Component, useState, useEffect } from 'react';
        import { withRouter } from 'react-router-dom';
        import { connect } from 'react-redux';
        import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
        import styled from '@emotion/styled';
        Severity: Major
        Found in app/javascript/src/pages/bots/editor.tsx - About 2 days to fix

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

          function IdleSessionClosedMessenger({
            kind,
            option,
            handleChangeNumber,
            state,
          Severity: Major
          Found in app/javascript/src/pages/settings/InboundSettings.tsx and 1 other location - About 2 days to fix
          app/javascript/src/pages/settings/InboundSettings.tsx on lines 72..123

          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 364.

          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 RepliesClosedConversationsControls({
            kind,
            option,
            handleChangeNumber,
            state,
          Severity: Major
          Found in app/javascript/src/pages/settings/InboundSettings.tsx and 1 other location - About 2 days to fix
          app/javascript/src/pages/settings/InboundSettings.tsx on lines 125..176

          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 364.

          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 Conversation has 396 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          export function Conversation(props) {
            const wait_for_input = React.useRef(null);
            const {
              value: {
                kind,

            Function render has 389 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

              render() {
                const palette = this.themePalette();
                return (
                  <ThemeProvider
                    theme={{
            Severity: Major
            Found in app/javascript/packages/messenger/src/client_messenger/messenger.tsx - About 1 day to fix

              Function RtcView has 381 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              export function RtcView(props) {
                const currentUser = props.current_user.email;
                const localVideo = React.useRef(null);
                const remoteVideoContainer = React.useRef(null);
              
              
              Severity: Major
              Found in app/javascript/packages/components/src/components/rtc.tsx - About 1 day to fix

                File mutations.ts has 1504 lines of code (exceeds 1000 allowed). Consider refactoring.
                Open

                import { appFragment, appUserFragment } from './fragments';
                
                export const UPDATE_APP = `
                  mutation AppsUpdate($appKey: String!, $appParams: Any!){
                    appsUpdate(appKey: $appKey, appParams: $appParams){
                Severity: Major
                Found in app/javascript/packages/store/src/graphql/mutations.ts - About 1 day to fix

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

                        {action === 'edit' && (
                          <FormDialog
                            open={true}
                            handleClose={closeModal}
                            actionButton={I18n.t('settings.team.edit.action_button')}
                  Severity: Major
                  Found in app/javascript/src/pages/Team.tsx and 1 other location - About 1 day to fix
                  app/javascript/src/pages/Team.tsx on lines 943..980

                  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 291.

                  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

                        {action === 'new' && (
                          <FormDialog
                            open={true}
                            handleClose={closeModal}
                            actionButton={I18n.t('settings.team.new.action_button')}
                  Severity: Major
                  Found in app/javascript/src/pages/Team.tsx and 1 other location - About 1 day to fix
                  app/javascript/src/pages/Team.tsx on lines 982..1019

                  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 291.

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

                  export function Conversation(props) {
                    const wait_for_input = React.useRef(null);
                    const {
                      value: {
                        kind,

                  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 Teams has 310 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  const Teams = function (props) {
                    const [teams, setTeams] = React.useState({ collection: [], loading: false });
                    const [action, setAction] = React.useState(null);
                    const [team, setTeam] = React.useState(null);
                    const [errors, setErrors] = React.useState({});
                  Severity: Major
                  Found in app/javascript/src/pages/Team.tsx - About 1 day to fix

                    Function render has 280 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                      render() {
                        if (!this.props.app_user) {
                          return (
                            <div className="flex p-2 justify-center">
                              <CircularProgress />
                    Severity: Major
                    Found in app/javascript/src/pages/Profile.tsx - About 1 day to fix

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

                                {!quickReply && (
                                  <div
                                    style={{ maxHeight: '16rem' }}
                                    className="mt-2 bg-white shadow overflow-hidden sm:rounded-md overflow-y-auto"
                                  >
                      Severity: Major
                      Found in app/javascript/src/pages/conversations/quickRepliesPanel.tsx and 1 other location - About 1 day to fix
                      app/javascript/src/pages/conversations/triggersPanel.tsx on lines 133..167

                      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 238.

                      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

                                {!botTask && (
                                  <div
                                    style={{ maxHeight: '16rem' }}
                                    className="mt-2 bg-white shadow overflow-hidden sm:rounded-md overflow-y-auto"
                                  >
                      Severity: Major
                      Found in app/javascript/src/pages/conversations/triggersPanel.tsx and 1 other location - About 1 day to fix
                      app/javascript/src/pages/conversations/quickRepliesPanel.tsx on lines 202..236

                      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 238.

                      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

                        search = (page = null) => {
                          this.setState({ searching: true });
                          // jwt or predicates from segment
                          // console.log(this.state.jwt)
                          const data = this.state.jwt
                      Severity: Major
                      Found in app/javascript/src/pages/Campaigns.tsx and 1 other location - About 1 day to fix
                      app/javascript/src/pages/bots/segment.tsx on lines 102..134

                      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 236.

                      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