Showing 6,140 of 6,140 total issues

File conversationQueries.test.ts has 2025 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as moment from 'moment';
import * as sinon from 'sinon';
import { IntegrationsAPI } from '../data/dataSources';
import { graphqlRequest } from '../db/connection';
import {
Severity: Major
Found in api/src/__tests__/conversationQueries.test.ts - About 5 days to fix

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

        commands: {
            source: {
                modes: {
                    wysiwyg: 1,
                    source: 1
    Severity: Major
    Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 4 days to fix
    ui/public/ckeditor/plugins/codemirror/plugin.js on lines 547..647

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

    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

                    CKEDITOR.plugins.sourcearea.commands = {
                        source: {
                            modes: {
                                wysiwyg: 1,
                                source: 1
    Severity: Major
    Found in ui/public/ckeditor/plugins/codemirror/plugin.js and 1 other location - About 4 days to fix
    ui/public/ckeditor/plugins/codemirror/plugin.js on lines 1195..1296

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

    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 factories.ts has 1745 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { dateType } from 'aws-sdk/clients/sts'; // tslint:disable-line
    import * as faker from 'faker';
    import * as Random from 'meteor-random';
    import * as momentTz from 'moment-timezone';
    import { FIELDS_GROUPS_CONTENT_TYPES } from '../data/constants';
    Severity: Major
    Found in api/src/db/factories.ts - About 4 days to fix

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

      export default {
        async companies(deal: IDealDocument) {
          const companyIds = await Conformities.savedConformity({
            mainType: 'deal',
            mainTypeId: deal._id,
      Severity: Major
      Found in api/src/data/resolvers/deals.ts and 1 other location - About 4 days to fix
      ui/src/modules/knowledgeBase/components/article/styles.ts on lines 5..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 788.

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

              init: function (editor) {
                  var rootPath = this.path,
                      defaultConfig = {
                          autoCloseBrackets: true,
                          autoCloseTags: true,
      Severity: Major
      Found in ui/public/ckeditor/plugins/codemirror/plugin.js - About 4 days to fix

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

        asyncModule(async () => {
          const dimensions = [
            {
              field: `status`,
              sql: 'status',
        Severity: Major
        Found in dashboard-api/schema/LeadsFields.js and 2 other locations - About 4 days to fix
        dashboard-api/schema/CustomerFields.js on lines 11..134
        dashboard-api/schema/VisitorProperties.js on lines 11..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 773.

        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

        asyncModule(async () => {
          const dimensions = [
            {
              field: `status`,
              sql: 'status',
        Severity: Major
        Found in dashboard-api/schema/CustomerFields.js and 2 other locations - About 4 days to fix
        dashboard-api/schema/LeadsFields.js on lines 11..134
        dashboard-api/schema/VisitorProperties.js on lines 11..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 773.

        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

        asyncModule(async () => {
          const dimensions = [
            {
              field: `status`,
              sql: 'status',
        Severity: Major
        Found in dashboard-api/schema/VisitorProperties.js and 2 other locations - About 4 days to fix
        dashboard-api/schema/CustomerFields.js on lines 11..134
        dashboard-api/schema/LeadsFields.js on lines 11..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 773.

        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 widgetMutations.test.ts has 1603 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import * as faker from 'faker';
        import * as Random from 'meteor-random';
        import * as sinon from 'sinon';
        import { MESSAGE_KINDS } from '../data/constants';
        import { IntegrationsAPI } from '../data/dataSources';
        Severity: Major
        Found in api/src/__tests__/widgetMutations.test.ts - About 4 days to fix

          File permission.ts has 1459 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          export const moduleObjects = {
            brands: {
              name: 'brands',
              description: 'Brands',
              actions: [
          Severity: Major
          Found in api/src/data/permissions/actions/permission.ts - About 3 days to fix

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

            export const hours = [
              { value: '12:00 AM', label: '12:00 AM' },
              { value: '12:30 AM', label: '12:30 AM' },
              { value: '1:00 AM', label: '1:00 AM' },
              { value: '1:30 AM', label: '1:30 AM' },
            Severity: Major
            Found in ui/src/modules/settings/integrations/constants.ts and 1 other location - About 3 days to fix
            ui/src/modules/knowledgeBase/icons.constant.ts on lines 1..51

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

            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

            export const icons = [
              { value: 'alarm', label: 'alarm' },
              { value: 'briefcase', label: 'briefcase' },
              { value: 'earthgrid', label: 'earthgrid' },
              { value: 'compass', label: 'compass' },
            Severity: Major
            Found in ui/src/modules/knowledgeBase/icons.constant.ts and 1 other location - About 3 days to fix
            ui/src/modules/settings/integrations/constants.ts on lines 16..66

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

            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 logUtils.ts has 1310 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {
              putCreateLog as putCreateLogC,
              putDeleteLog as putDeleteLogC,
              putUpdateLog as putUpdateLogC
            } from 'erxes-api-utils';
            Severity: Major
            Found in api/src/data/logUtils.ts - About 3 days to fix

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

              class dbStore {
                constructor() {
              
                  this.url = process.env.MONGO_URL
                  this.db = null
              Severity: Major
              Found in api/src/db-migrate-store.js and 2 other locations - About 3 days to fix
              integrations/db-migrate-store.js on lines 6..64
              logger/db-migrate-store.js on lines 6..64

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

              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

              class dbStore {
                constructor() {
              
                  this.url = process.env.MONGO_URL
                  this.db = null
              Severity: Major
              Found in integrations/db-migrate-store.js and 2 other locations - About 3 days to fix
              api/src/db-migrate-store.js on lines 6..64
              logger/db-migrate-store.js on lines 6..64

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

              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

              class dbStore {
                constructor() {
              
                  this.url = process.env.MONGO_URL;
                  this.db = null;
              Severity: Major
              Found in logger/db-migrate-store.js and 2 other locations - About 3 days to fix
              api/src/db-migrate-store.js on lines 6..64
              integrations/db-migrate-store.js on lines 6..64

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

              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 2 locations. Consider refactoring.
              Open

              CKEDITOR.plugins.add('formInsert', {
                requires: ['richcombo'],
                init: function(editor) {
                  // init the default config
                  var defaultConfig = {
              Severity: Major
              Found in ui/public/ckeditor/plugins/formInsert/plugin.js and 1 other location - About 3 days to fix
              ui/public/ckeditor/plugins/plugin.js on lines 1..73

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

              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 2 locations. Consider refactoring.
              Open

              CKEDITOR.plugins.add('formInsert', {
                requires: ['richcombo'],
                init: function(editor) {
                  // init the default config
                  var defaultConfig = {
              Severity: Major
              Found in ui/public/ckeditor/plugins/plugin.js and 1 other location - About 3 days to fix
              ui/public/ckeditor/plugins/formInsert/plugin.js on lines 1..73

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

              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

              class GmailContainer extends React.Component<FinalProps, State> {
                constructor(props: FinalProps) {
                  super(props);
              
                  this.state = { email: '', accountId: '' };
              Severity: Major
              Found in ui/src/modules/settings/integrations/containers/gmail/Form.tsx and 1 other location - About 2 days to fix
              ui/src/modules/settings/integrations/containers/twitter/Twitter.tsx on lines 24..95

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

              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