ThinkDeepTech/thinkdeep

View on GitHub

Showing 44 of 104 total issues

Function _handleTweetsFetched has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async _handleTweetsFetched(utcDateTime, economicEntity, tweets) {
    if (!validDate(utcDateTime)) {
      throw new Error(`${utcDateTime} is an invalid date.`);
    }

Severity: Minor
Found in packages/deep-microservice-collection/src/collection-service.js - About 1 hr to fix

    Function validateAndFetchPermissionsAndMe has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const validateAndFetchPermissionsAndMe = async (connectionParams, extra) => {
        if (!extra?.request) {
          throw new Error('The request object was not valid.');
        }
    
    
    Severity: Minor
    Found in packages/deep-microservice-subscription/src/index.js - About 1 hr to fix

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

        constructor() {
          super();
      
          this.configuration = {observedEconomicEntities: []};
      
      
      Severity: Minor
      Found in packages/deep-economic-analyzer/deep-site-configuration.js - About 1 hr to fix

        Function _selectionInputs has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _selectionInputs(siteConfiguration) {
            return html`
              <div class="input selection">
                <mwc-select
                  id="business"
        Severity: Minor
        Found in packages/deep-economic-analyzer/deep-analyzer-page-summary.js - About 1 hr to fix

          Function connect has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async connect() {
              this._logger.info(`Connecting to analysis service support systems.`);
          
              await attachExitHandler(async () => {
                this._logger.info('Cleaning up kafka connections.');
          Severity: Minor
          Found in packages/deep-microservice-analysis/src/analysis-service.js - About 1 hr to fix

            Function readMostRecentSentiment has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async readMostRecentSentiment(economicEntity) {
                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 _validSentimentDatas has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                _validSentimentDatas(datas) {
                  if (!Array.isArray(datas) || datas.length <= 0) {
                    return false;
                  }
              
              
              Severity: Minor
              Found in packages/deep-microservice-analysis/src/analysis-service.js - About 1 hr 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

              Function _webSites has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                async _webSites(
                  subject,
                  searchEngine = DDG,
                  reqLib = axios,
                  robotsTxtParser = robotsParser
              Severity: Minor
              Found in packages/data-collector/src/data-scraper.js - About 1 hr 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

              Function startGatewayService has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              const startGatewayService = async () => {
                const gateway = new ApolloGateway({
                  serviceList: [
                    {
                      name: 'analysis',
              Severity: Minor
              Found in packages/deep-microservice-gateway/src/index.js - About 1 hr 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

              Function _webSites has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async _webSites(
                  subject,
                  searchEngine = DDG,
                  reqLib = axios,
                  robotsTxtParser = robotsParser
              Severity: Minor
              Found in packages/data-collector/src/data-scraper.js - About 1 hr to fix

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

                  render() {
                    return html`
                      <div class="grid">
                        <h1 class="slogan">${translate('translations:headline')}</h1>
                        <div class="features">
                Severity: Minor
                Found in packages/deep-economic-analyzer/deep-analyzer-page-home.js - About 1 hr to fix

                  Function readSentiments has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    async readSentiments(economicEntity, startDate, endDate) {
                      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 initAuth has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const initAuth = async (options) => {
                      if (!options?.domain || !options.clientId || !options.audience) {
                        throw new Error('The domain, clientId and audience are required.');
                      }
                    
                    
                    Severity: Minor
                    Found in packages/deep-economic-analyzer/user.js - About 1 hr to fix

                      Function emitEvent has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        async emitEvent(eventName, data) {
                          this._logger.debug(
                            `Creating event ${eventName} in kafka if it does not already exist.`
                          );
                          try {
                      Severity: Minor
                      Found in packages/data-collector/src/client.js - About 1 hr to fix

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

                          static get styles() {
                            return [
                              css`
                                :host {
                                  transition: box-shadow 0.3s;
                        Severity: Minor
                        Found in packages/deep-card/deep-card.js - About 1 hr to fix

                          Function properties has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                            static get properties() {
                              return {
                                user: {type: Object},
                                configuration: {
                                  type: Object,
                          Severity: Minor
                          Found in packages/deep-economic-analyzer/deep-site-configuration.js - About 1 hr 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

                          Function _sentimentSummaryCard has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            _sentimentSummaryCard(sentimentDatas) {
                              return sentimentDatas.length > 0
                                ? html`
                                    <deep-card class="card">
                                      <h4 slot="header">Sentiment Summary</h4>
                          Severity: Minor
                          Found in packages/deep-economic-analyzer/deep-analyzer-page-summary.js - About 1 hr to fix

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

                            const startApolloServer = async () => {
                              const commander = new Commander(logger);
                            
                              const kafka = new Kafka({
                                clientId: 'deep-microservice-collection',
                            Severity: Minor
                            Found in packages/deep-microservice-collection/src/index.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

                            Function constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              constructor() {
                                super();
                            
                                this.sentimentDatas = [];
                            
                            
                            Severity: Minor
                            Found in packages/deep-economic-analyzer/deep-analyzer-page-summary.js - About 35 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

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

                            const startApolloServer = async () => {
                              await attachExitHandler(async () => {
                                await mongoClient.close();
                              });
                            
                            
                            Severity: Minor
                            Found in packages/deep-microservice-configuration/src/index.js - About 35 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

                            Severity
                            Category
                            Status
                            Source
                            Language