IBM/scc-node-sdk

View on GitHub

Showing 159 of 159 total issues

Function listReportEvaluations has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public listReportEvaluations(
    params: SecurityAndComplianceCenterApiV3.ListReportEvaluationsParams
  ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.EvaluationPage>> {
    const _params = { ...params };
    const _requiredParams = ['reportId'];
Severity: Minor
Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

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

        const body = {
          'description': _params.description,
          'target': _params.target,
          'required_config': _params.requiredConfig,
          'type': _params.type,
    Severity: Major
    Found in security-and-compliance-center-api/v3.ts and 3 other locations - About 1 hr to fix
    security-and-compliance-center-api/v3.ts on lines 1385..1393
    security-and-compliance-center-api/v3.ts on lines 2055..2063
    security-and-compliance-center-api/v3.ts on lines 2473..2481

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

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

        const query = {
          'attachment_id': _params.attachmentId,
          'group_id': _params.groupId,
          'profile_id': _params.profileId,
          'type': _params.type,
    Severity: Major
    Found in security-and-compliance-center-api/v3.ts and 3 other locations - About 1 hr to fix
    security-and-compliance-center-api/v3.ts on lines 1177..1185
    security-and-compliance-center-api/v3.ts on lines 1385..1393
    security-and-compliance-center-api/v3.ts on lines 2473..2481

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

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

        const query = {
          'assessment_id': _params.assessmentId,
          'component_id': _params.componentId,
          'target_id': _params.targetId,
          'target_name': _params.targetName,
    Severity: Major
    Found in security-and-compliance-center-api/v3.ts and 3 other locations - About 1 hr to fix
    security-and-compliance-center-api/v3.ts on lines 1177..1185
    security-and-compliance-center-api/v3.ts on lines 1385..1393
    security-and-compliance-center-api/v3.ts on lines 2055..2063

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

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

      public replaceProfile(
        params: SecurityAndComplianceCenterApiV3.ReplaceProfileParams
      ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.Profile>> {
        const _params = { ...params };
        const _requiredParams = ['profilesId', 'profileName', 'profileDescription', 'profileType', 'controls', 'defaultParameters'];
    Severity: Minor
    Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

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

        public getReportControls(
          params: SecurityAndComplianceCenterApiV3.GetReportControlsParams
        ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.ReportControls>> {
          const _params = { ...params };
          const _requiredParams = ['reportId'];
      Severity: Minor
      Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

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

            try {
              res = await securityAndComplianceCenterApiService.getProviderTypesInstances({});
              console.log(JSON.stringify(res.result, null, 2));
            } catch (err) {
              console.warn(err);
        Severity: Major
        Found in examples/security-and-compliance-center-api.v3.test.js and 1 other location - About 1 hr to fix
        examples/security-and-compliance-center-api.v3.test.js on lines 1459..1464

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

        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

            try {
              res = await securityAndComplianceCenterApiService.listProviderTypes({});
              console.log(JSON.stringify(res.result, null, 2));
            } catch (err) {
              console.warn(err);
        Severity: Major
        Found in examples/security-and-compliance-center-api.v3.test.js and 1 other location - About 1 hr to fix
        examples/security-and-compliance-center-api.v3.test.js on lines 1629..1634

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

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

          public createCustomControlLibrary(
            params: SecurityAndComplianceCenterApiV3.CreateCustomControlLibraryParams
          ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.ControlLibrary>> {
            const _params = { ...params };
            const _requiredParams = ['controlLibraryName', 'controlLibraryDescription', 'controlLibraryType', 'controls'];
        Severity: Minor
        Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

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

            public updateProviderTypeInstance(
              params: SecurityAndComplianceCenterApiV3.UpdateProviderTypeInstanceParams
            ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.ProviderTypeInstanceItem>> {
              const _params = { ...params };
              const _requiredParams = ['providerTypeId', 'providerTypeInstanceId'];
          Severity: Minor
          Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

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

              public createRule(
                params: SecurityAndComplianceCenterApiV3.CreateRuleParams
              ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.Rule>> {
                const _params = { ...params };
                const _requiredParams = ['description', 'target', 'requiredConfig'];
            Severity: Minor
            Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

              Function createProviderTypeInstance has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public createProviderTypeInstance(
                  params: SecurityAndComplianceCenterApiV3.CreateProviderTypeInstanceParams
                ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.ProviderTypeInstanceItem>> {
                  const _params = { ...params };
                  const _requiredParams = ['providerTypeId'];
              Severity: Minor
              Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

                Function listReports has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  public listReports(
                    params?: SecurityAndComplianceCenterApiV3.ListReportsParams
                  ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.ReportPage>> {
                    const _params = { ...params };
                    const _requiredParams = [];
                Severity: Minor
                Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

                  Function createAttachment has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    public createAttachment(
                      params: SecurityAndComplianceCenterApiV3.CreateAttachmentParams
                    ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.AttachmentPrototype>> {
                      const _params = { ...params };
                      const _requiredParams = ['profilesId', 'attachments'];
                  Severity: Minor
                  Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

                    Function listAttachments has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      public listAttachments(
                        params: SecurityAndComplianceCenterApiV3.ListAttachmentsParams
                      ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.AttachmentCollection>> {
                        const _params = { ...params };
                        const _requiredParams = ['profilesId'];
                    Severity: Minor
                    Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

                      Function getReportEvaluation has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        public getReportEvaluation(
                          params: SecurityAndComplianceCenterApiV3.GetReportEvaluationParams
                        ): Promise<SecurityAndComplianceCenterApiV3.Response<NodeJS.ReadableStream>> {
                          const _params = { ...params };
                          const _requiredParams = ['reportId'];
                      Severity: Minor
                      Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

                        Function createProfile has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          public createProfile(
                            params: SecurityAndComplianceCenterApiV3.CreateProfileParams
                          ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.Profile>> {
                            const _params = { ...params };
                            const _requiredParams = ['profileName', 'profileDescription', 'profileType', 'controls', 'defaultParameters'];
                        Severity: Minor
                        Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

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

                            public getReportViolationsDrift(
                              params: SecurityAndComplianceCenterApiV3.GetReportViolationsDriftParams
                            ): Promise<SecurityAndComplianceCenterApiV3.Response<SecurityAndComplianceCenterApiV3.ReportViolationsDrift>> {
                              const _params = { ...params };
                              const _requiredParams = ['reportId'];
                          Severity: Minor
                          Found in security-and-compliance-center-api/v3.ts - About 1 hr to fix

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

                              export interface EventNotifications {
                                /** The Event Notifications instance CRN. */
                                instance_crn?: string;
                                /** The date when the Event Notifications connection was updated. */
                                updated_on?: string;
                            Severity: Major
                            Found in security-and-compliance-center-api/v3.ts and 2 other locations - About 1 hr to fix
                            security-and-compliance-center-api/v3.ts on lines 4974..4985
                            security-and-compliance-center-api/v3.ts on lines 5621..5632

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

                            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

                              export interface TargetInfo {
                                /** The target ID. */
                                id?: string;
                                /** The target account ID. */
                                account_id?: string;
                            Severity: Major
                            Found in security-and-compliance-center-api/v3.ts and 2 other locations - About 1 hr to fix
                            security-and-compliance-center-api/v3.ts on lines 4904..4915
                            security-and-compliance-center-api/v3.ts on lines 4974..4985

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

                            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