VoxaAI/voxa-cli

View on GitHub

Showing 31 of 36 total issues

Function intentUtterProcessor has 154 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function intentUtterProcessor(voxaSheets: IVoxaSheet[], AVAILABLE_LOCALES: string[]) {
  const voxaSheetsIntent = filterSheets(voxaSheets, [SheetTypes.INTENT]);

  const voxaSheetsUtter = _.reduce(
    filterSheets(voxaSheets, [SheetTypes.UTTERANCE]),
Severity: Major
Found in src/Processor.ts - About 6 hrs to fix

    File Processor.ts has 396 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Copyright (c) 2018 Rain Agency <contact@rain.agency>
     * Author: Rain Agency <contact@rain.agency>
     *
     * Permission is hereby granted, free of charge, to any person obtaining a copy of
    Severity: Minor
    Found in src/Processor.ts - About 5 hrs to fix

      Function action has 137 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export async function action() {
        const interactionFile = path.join(process.cwd(), "interaction.json");
        let hasAnInteractionFile = false;
        try {
          // a path we KNOW is totally bogus and not a module
      Severity: Major
      Found in src/commands/init.ts - About 5 hrs to fix

        Function result has 132 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            .map((voxaSheetIntent: IVoxaSheet) => {
              const locale = sheetLocale(voxaSheetIntent, AVAILABLE_LOCALES);
              let previousIntent: string;
              voxaSheetIntent.data = _.chain(voxaSheetIntent.data)
                .map(row => {
        Severity: Major
        Found in src/Processor.ts - About 5 hrs to fix

          File Schema.ts has 326 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * Copyright (c) 2018 Rain Agency <contact@rain.agency>
           * Author: Rain Agency <contact@rain.agency>
           *
           * Permission is hereby granted, free of charge, to any person obtaining a copy of
          Severity: Minor
          Found in src/Schema.ts - About 3 hrs to fix

            Function observe has 92 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const observe = Observable.create((obs: any) => {
                const override = (answers: any) => {
                  return answers.interactionFile;
                };
                const onlyCommaAnswer = (input: string) => {
            Severity: Major
            Found in src/commands/init.ts - About 3 hrs to fix

              File DialogflowSchema.ts has 313 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * Copyright (c) 2018 Rain Agency <contact@rain.agency>
               * Author: Rain Agency <contact@rain.agency>
               *
               * Permission is hereby granted, free of charge, to any person obtaining a copy of
              Severity: Minor
              Found in src/DialogflowSchema.ts - About 3 hrs to fix

                Function action has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                Open

                export async function action() {
                  const interactionFile = path.join(process.cwd(), "interaction.json");
                  let hasAnInteractionFile = false;
                  try {
                    // a path we KNOW is totally bogus and not a module
                Severity: Minor
                Found in src/commands/init.ts - About 3 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

                Function buildViewsMapping has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  public buildViewsMapping(): void {
                    function pathsFinder(object: any, prefixes: string[] = []) {
                      let paths: string[] = [];
                      let value: any;
                      if (typeof object === "object") {
                Severity: Major
                Found in src/Schema.ts - About 3 hrs to fix

                  Function buildIntent has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    public buildIntent(locale: string, environment: string) {
                      const intentsByPlatformAndEnvironments = this.intentsByPlatformAndEnvironments(
                        locale,
                        environment
                      );
                  Severity: Major
                  Found in src/DialogflowSchema.ts - About 2 hrs to fix

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

                      public buildUtterances(locale: string, environment: string) {
                        const intentsByPlatformAndEnvironments = this.intentsByPlatformAndEnvironments(
                          locale,
                          environment
                        );
                    Severity: Major
                    Found in src/DialogflowSchema.ts - About 2 hrs to fix

                      Function viewsProcessor has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function viewsProcessor(voxaSheets: IVoxaSheet[], AVAILABLE_LOCALES: string[]) {
                        function sanitizeView(text: string = "") {
                          return text
                            .replace(/’/g, "'")
                            .replace(/’/g, "'")
                      Severity: Major
                      Found in src/Processor.ts - About 2 hrs to fix

                        Function builtIntents has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            this.builtIntents = intentsByPlatformAndEnvironments.map((rawIntent: IIntent) => {
                              let { name, events } = rawIntent;
                              const { parameterName, parameterValue } = rawIntent;
                              const { webhookForSlotFilling, slotsDefinition, responses, webhookUsed } = rawIntent;
                              name = name.replace("AMAZON.", "");
                        Severity: Major
                        Found in src/DialogflowSchema.ts - About 2 hrs to fix

                          Function buildInteraction has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const buildInteraction = async (interactionOptions: IInteractionOptions, authKeys: any) => {
                            const definedInteractionOptions = defaultOptions(interactionOptions);
                            console.time("all");
                            console.time("timeframe");
                          
                          
                          Severity: Major
                          Found in src/InteractionBuilder.ts - About 2 hrs to fix

                            Function defaultOptions has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function defaultOptions(interactionOptions: IInteractionOptions): IDefinedInteractionOptions {
                              const rootPath: string = interactionOptions.rootPath || "";
                              const speechPath: string =
                                interactionOptions.speechPath || DEFAULT_INTERACTION_OPTIONS.speechPath;
                              const synonymPath: string =
                            Severity: Major
                            Found in src/InteractionBuilder.ts - About 2 hrs to fix

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

                                public buildAgent(locale: string, environment: string) {
                                  const intents = this.builtIntents;
                                  const invocation = _.find(this.invocations, { locale, environment });
                                  const invocationName = _.get(invocation, "name", "Skill with no name");
                                  const intentsByPlatformAndEnvironments = this.intentsByPlatformAndEnvironments(
                              Severity: Minor
                              Found in src/DialogflowSchema.ts - About 1 hr to fix

                                Function buildViewsMapping has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  public buildViewsMapping(): void {
                                    function pathsFinder(object: any, prefixes: string[] = []) {
                                      let paths: string[] = [];
                                      let value: any;
                                      if (typeof object === "object") {
                                Severity: Minor
                                Found in src/Schema.ts - 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 publishingProcessor has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function publishingProcessor(voxaSheets: IVoxaSheet[], AVAILABLE_LOCALES: string[]) {
                                  const voxaSheetsPublishing = voxaSheets.filter(voxaSheet =>
                                    _.includes(
                                      [
                                        SheetTypes.SKILL_ENVIRONMENTS,
                                Severity: Minor
                                Found in src/Processor.ts - About 1 hr to fix

                                  Function buildIntent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    public buildIntent(locale: string, environment: string) {
                                      const intentsByPlatformAndEnvironments = this.intentsByPlatformAndEnvironments(
                                        locale,
                                        environment
                                      );
                                  Severity: Minor
                                  Found in src/DialogflowSchema.ts - 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 mergeManifest has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    public mergeManifest(environment: string): any {
                                      const manifest = {};
                                      const NAMESPACE = this.NAMESPACE;
                                      this.publishing
                                        .filter(item => _.isEmpty(item.environments) && item.key.includes(this.NAMESPACE))
                                  Severity: Minor
                                  Found in src/Schema.ts - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language