ThinkDeepTech/thinkdeep

View on GitHub

Showing 104 of 104 total issues

File deep-analyzer-page-summary.js has 498 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  ApolloMutationController,
  ApolloQueryController,
  ApolloSubscriptionController,
} from '@apollo-elements/core';
Severity: Minor
Found in packages/deep-economic-analyzer/deep-analyzer-page-summary.js - About 7 hrs to fix

    Function startApolloServer has 181 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const startApolloServer = async () => {
      const validateAndAppendPermissions = jwt({
        secret: jwks.expressJwtSecret({
          cache: true,
          rateLimit: true,
    Severity: Major
    Found in packages/deep-microservice-subscription/src/index.js - About 7 hrs to fix

      Function startApolloServer has 143 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const startApolloServer = async () => {
        const commander = new Commander(logger);
      
        const kafka = new Kafka({
          clientId: 'deep-microservice-collection',
      Severity: Major
      Found in packages/deep-microservice-collection/src/index.js - About 5 hrs to fix

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

          const server = new ApolloServer({
            schema: buildSubgraphSchema([{typeDefs, resolvers}]),
            dataSources: () => ({collectionService}),
            context: ({req}) => {
              const permissions = req.headers.permissions
        Severity: Major
        Found in packages/deep-microservice-collection/src/index.js and 1 other location - About 4 hrs to fix
        packages/deep-microservice-analysis/src/index.js on lines 46..58

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

        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

          const apolloServer = new ApolloServer({
            schema: buildSubgraphSchema([{typeDefs, resolvers}]),
            dataSources: () => ({analysisService}),
            context: ({req}) => {
              const permissions = req.headers.permissions
        Severity: Major
        Found in packages/deep-microservice-analysis/src/index.js and 1 other location - About 4 hrs to fix
        packages/deep-microservice-collection/src/index.js on lines 132..144

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

        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

          const extractMe = jwt({
            secret: jwks.expressJwtSecret({
              cache: true,
              rateLimit: true,
              jwksRequestsPerMinute: 5,
        Severity: Major
        Found in packages/deep-microservice-gateway/src/index.js and 1 other location - About 4 hrs to fix
        packages/deep-microservice-subscription/src/index.js on lines 43..60

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

        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

          const validateAndAppendMe = jwt({
            secret: jwks.expressJwtSecret({
              cache: true,
              rateLimit: true,
              jwksRequestsPerMinute: 5,
        Severity: Major
        Found in packages/deep-microservice-subscription/src/index.js and 1 other location - About 4 hrs to fix
        packages/deep-microservice-gateway/src/index.js on lines 73..90

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

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

        const startGatewayService = async () => {
          const gateway = new ApolloGateway({
            serviceList: [
              {
                name: 'analysis',
        Severity: Major
        Found in packages/deep-microservice-gateway/src/index.js - About 4 hrs to fix

          Function styles has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            static get styles() {
              const INPUT_RADIUS = 3;
              const INPUT_WIDTH = 90;
              return css`
                :host {
          Severity: Major
          Found in packages/deep-economic-analyzer/deep-analyzer-page-summary.js - About 4 hrs to fix

            Function constructor has 88 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor() {
                super();
            
                this.sentimentDatas = [];
            
            
            Severity: Major
            Found in packages/deep-economic-analyzer/deep-analyzer-page-summary.js - About 3 hrs to fix

              Function constructor has 86 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                constructor(
                  tweetStore,
                  economicEntityMemo,
                  commander,
                  admin,
              Severity: Major
              Found in packages/deep-microservice-collection/src/collection-service.js - About 3 hrs to fix

                Function styles has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  static get styles() {
                    return css`
                      :host {
                        display: block;
                        position: relative;
                Severity: Major
                Found in packages/deep-economic-analyzer/deep-analyzer-page-home.js - About 3 hrs to fix

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

                  const loggingPlugin = {
                    // Fires whenever a GraphQL request is received from a client.
                    async requestDidStart(requestContext) {
                      logger.debug(`Request Started. Query: ${requestContext.request.query}`);
                  
                  
                  Severity: Major
                  Found in packages/deep-microservice-collection/src/logging-plugin.js and 3 other locations - About 3 hrs to fix
                  packages/deep-microservice-analysis/src/logging-plugin.js on lines 5..24
                  packages/deep-microservice-configuration/src/logging-plugin.js on lines 5..24
                  packages/deep-microservice-subscription/src/logging-plugin.js on lines 5..24

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

                  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

                    static _webSites(subjects) {
                      if (!Array.isArray(subjects)) {
                        throw new Error(`${JSON.stringify(subjects)} is not a valid array.`);
                      }
                  
                  
                  Severity: Major
                  Found in packages/model/src/web-site-factory.js and 2 other locations - About 3 hrs to fix
                  packages/model/src/economic-entity-factory.js on lines 44..55
                  packages/model/src/economic-sector-factory.js on lines 38..49

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

                  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

                    static _economicEntities(subjects) {
                      if (!Array.isArray(subjects)) {
                        throw new Error(`${JSON.stringify(subjects)} is not a valid array.`);
                      }
                  
                  
                  Severity: Major
                  Found in packages/model/src/economic-entity-factory.js and 2 other locations - About 3 hrs to fix
                  packages/model/src/economic-sector-factory.js on lines 38..49
                  packages/model/src/web-site-factory.js on lines 41..52

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

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

                  const loggingPlugin = {
                    // Fires whenever a GraphQL request is received from a client.
                    async requestDidStart(requestContext) {
                      logger.debug(`Request Started. Query: ${requestContext.request.query}`);
                  
                  
                  packages/deep-microservice-analysis/src/logging-plugin.js on lines 5..24
                  packages/deep-microservice-collection/src/logging-plugin.js on lines 5..24
                  packages/deep-microservice-subscription/src/logging-plugin.js on lines 5..24

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

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

                  const loggingPlugin = {
                    // Fires whenever a GraphQL request is received from a client.
                    async requestDidStart(requestContext) {
                      logger.debug(`Request Started. Query: ${requestContext.request.query}`);
                  
                  
                  packages/deep-microservice-analysis/src/logging-plugin.js on lines 5..24
                  packages/deep-microservice-collection/src/logging-plugin.js on lines 5..24
                  packages/deep-microservice-configuration/src/logging-plugin.js on lines 5..24

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

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

                  const loggingPlugin = {
                    // Fires whenever a GraphQL request is received from a client.
                    async requestDidStart(requestContext) {
                      logger.debug(`Request Started. Query: ${requestContext.request.query}`);
                  
                  
                  Severity: Major
                  Found in packages/deep-microservice-analysis/src/logging-plugin.js and 3 other locations - About 3 hrs to fix
                  packages/deep-microservice-collection/src/logging-plugin.js on lines 5..24
                  packages/deep-microservice-configuration/src/logging-plugin.js on lines 5..24
                  packages/deep-microservice-subscription/src/logging-plugin.js on lines 5..24

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

                  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

                    static _economicSectors(subjects) {
                      if (!Array.isArray(subjects)) {
                        throw new Error(`${JSON.stringify(subjects)} is not a valid array.`);
                      }
                  
                  
                  Severity: Major
                  Found in packages/model/src/economic-sector-factory.js and 2 other locations - About 3 hrs to fix
                  packages/model/src/economic-entity-factory.js on lines 44..55
                  packages/model/src/web-site-factory.js on lines 41..52

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

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

                    async execute() {
                      try {
                        const alreadyExists = await this._k8sClient.exists(
                          'cronjob',
                          this._options.name,
                  Severity: Major
                  Found in packages/deep-microservice-collection/src/command/k8s-cron-job.js - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language