ThinkDeepTech/thinkdeep

View on GitHub

Showing 44 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

        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

                  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

                    DeepAnalyzerPageSummary has 25 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    export default class DeepAnalyzerPageSummary extends LitElement {
                      /**
                       * Lit component property definitions.
                       */
                      static get properties() {
                    Severity: Minor
                    Found in packages/deep-economic-analyzer/deep-analyzer-page-summary.js - About 2 hrs to fix

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

                      const startApolloServer = async () => {
                        await attachExitHandler(async () => {
                          await mongoClient.close();
                        });
                      
                      
                      Severity: Major
                      Found in packages/deep-microservice-configuration/src/index.js - About 2 hrs to fix

                        Function startApolloServer has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const startApolloServer = async () => {
                          const validateAndAppendPermissions = jwt({
                            secret: jwks.expressJwtSecret({
                              cache: true,
                              rateLimit: true,
                        Severity: Minor
                        Found in packages/deep-microservice-subscription/src/index.js - About 2 hrs 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

                        File collection-service.js has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import {
                          EconomicEntityFactory,
                          EconomicEntityType,
                          validEconomicEntities,
                        } from '@thinkdeep/model';
                        Severity: Minor
                        Found in packages/deep-microservice-collection/src/collection-service.js - About 2 hrs to fix

                          Function execute has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            async execute() {
                              try {
                                this._obj = await this._k8sClient.create(`
                                              apiVersion: "batch/v1"
                                              kind: "Job"
                          Severity: Minor
                          Found in packages/deep-microservice-collection/src/command/k8s-job.js - About 1 hr to fix

                            Function initApolloClient has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const initApolloClient = async (user) => {
                              const authHeaders = (_user) => {
                                return {
                                  authorization: _user?.accessToken ? `Bearer ${_user.accessToken}` : '',
                                  me: _user?.idToken ? _user.idToken : '',
                            Severity: Minor
                            Found in packages/deep-economic-analyzer/graphql/client.js - About 1 hr to fix

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

                                static get styles() {
                                  return [
                                    css`
                                      :host {
                                        display: grid;
                              Severity: Minor
                              Found in packages/deep-footer/deep-footer.js - About 1 hr to fix

                                Function listen has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  async listen() {
                                    this._logger.info(`Starting apollo server.`);
                                    await this._apolloServer.start();
                                
                                    this._expressApp.disable('x-powered-by');
                                Severity: Minor
                                Found in packages/deep-microservice-analysis/src/microservice.js - About 1 hr to fix

                                  Function _commands has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    _commands(economicEntity) {
                                      if (!validEconomicEntities([economicEntity])) {
                                        throw new Error(
                                          `Economic entity was invalid. Received: ${economicEntity.toString()}`
                                        );
                                  Severity: Minor
                                  Found in packages/deep-microservice-collection/src/collection-service.js - About 1 hr to fix

                                    Function _addSentiment has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      async _addSentiment(economicEntity, utcDateTime, data) {
                                        if (!validEconomicEntities([economicEntity])) {
                                          throw new Error(
                                            `Invalid economic entity received:\n${JSON.stringify(economicEntity)}`
                                          );
                                    Severity: Minor
                                    Found in packages/deep-microservice-analysis/src/datasource/neo4j-store.js - About 1 hr to fix

                                      Function _computeSentiment has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        async _computeSentiment(economicEntity, datas) {
                                          if (!validEconomicEntities([economicEntity])) {
                                            throw new Error(`An invalid economic entity was received.`);
                                          }
                                      
                                      
                                      Severity: Minor
                                      Found in packages/deep-microservice-analysis/src/analysis-service.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language