ory-am/hydra

View on GitHub
hsm/manager_hsm_test.go

Summary

Maintainability
F
1 wk
Test Coverage

File manager_hsm_test.go has 833 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0

//go:build hsm
// +build hsm
Severity: Major
Found in hsm/manager_hsm_test.go - About 1 day to fix

    Function TestKeyManager_GetKey has 181 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func TestKeyManager_GetKey(t *testing.T) {
        ctrl := gomock.NewController(t)
        hsmContext := NewMockContext(ctrl)
        defer ctrl.Finish()
        l := logrusx.New("", "")
    Severity: Major
    Found in hsm/manager_hsm_test.go - About 6 hrs to fix

      Function TestKeyManager_GenerateAndPersistKeySet has 172 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func TestKeyManager_GenerateAndPersistKeySet(t *testing.T) {
          ctrl := gomock.NewController(t)
          hsmContext := NewMockContext(ctrl)
          defer ctrl.Finish()
          l := logrusx.New("", "")
      Severity: Major
      Found in hsm/manager_hsm_test.go - About 5 hrs to fix

        Function TestKeyManager_GetKeySet has 138 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func TestKeyManager_GetKeySet(t *testing.T) {
            ctrl := gomock.NewController(t)
            hsmContext := NewMockContext(ctrl)
            defer ctrl.Finish()
            l := logrusx.New("", "")
        Severity: Major
        Found in hsm/manager_hsm_test.go - About 4 hrs to fix

          Function TestKeyManager_DeleteKey has 77 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func TestKeyManager_DeleteKey(t *testing.T) {
              ctrl := gomock.NewController(t)
              hsmContext := NewMockContext(ctrl)
              defer ctrl.Finish()
              l := logrusx.New("", "")
          Severity: Major
          Found in hsm/manager_hsm_test.go - About 2 hrs to fix

            Function TestKeyManager_HsmKeySetPrefix has 77 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func TestKeyManager_HsmKeySetPrefix(t *testing.T) {
                ctrl := gomock.NewController(t)
                hsmContext := NewMockContext(ctrl)
                defer ctrl.Finish()
                l := logrusx.New("", "")
            Severity: Major
            Found in hsm/manager_hsm_test.go - About 2 hrs to fix

              Function TestKeyManager_DeleteKeySet has 74 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func TestKeyManager_DeleteKeySet(t *testing.T) {
                  ctrl := gomock.NewController(t)
                  hsmContext := NewMockContext(ctrl)
                  defer ctrl.Finish()
                  l := logrusx.New("", "")
              Severity: Minor
              Found in hsm/manager_hsm_test.go - About 1 hr to fix

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

                        {
                            name: "Generate ES256 with GenerateECDSAKeyPairWithAttributes Error",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 1 other location - About 2 hrs to fix
                hsm/manager_hsm_test.go on lines 278..293

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

                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

                        {
                            name: "Generate ES512 GenerateECDSAKeyPairWithAttributes Error",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 1 other location - About 2 hrs to fix
                hsm/manager_hsm_test.go on lines 246..261

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

                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

                        {
                            name: "Generate ES256",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 1 other location - About 2 hrs to fix
                hsm/manager_hsm_test.go on lines 262..277

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

                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

                        {
                            name: "Generate ES512",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 1 other location - About 2 hrs to fix
                hsm/manager_hsm_test.go on lines 230..245

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

                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

                        {
                            name: "Get RS256 enc",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 2 other locations - About 2 hrs to fix
                hsm/manager_hsm_test.go on lines 437..449
                hsm/manager_hsm_test.go on lines 463..475

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

                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

                        {
                            name: "Get ES256 enc",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 2 other locations - About 2 hrs to fix
                hsm/manager_hsm_test.go on lines 398..410
                hsm/manager_hsm_test.go on lines 463..475

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

                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

                        {
                            name: "Get ES512 enc",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 2 other locations - About 2 hrs to fix
                hsm/manager_hsm_test.go on lines 398..410
                hsm/manager_hsm_test.go on lines 437..449

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

                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

                        {
                            name: "Get ES256 sig",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 2 other locations - About 1 hr to fix
                hsm/manager_hsm_test.go on lines 385..397
                hsm/manager_hsm_test.go on lines 450..462

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

                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

                        {
                            name: "Get ES512 sig",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 2 other locations - About 1 hr to fix
                hsm/manager_hsm_test.go on lines 385..397
                hsm/manager_hsm_test.go on lines 424..436

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

                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

                        {
                            name: "Get RS256 sig",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 2 other locations - About 1 hr to fix
                hsm/manager_hsm_test.go on lines 424..436
                hsm/manager_hsm_test.go on lines 450..462

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

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

                        {
                            name: "FindKeyPair Error",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 1 other location - About 1 hr to fix
                hsm/manager_hsm_test.go on lines 727..738

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

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

                        {
                            name: "FindKeyPair Error",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Major
                Found in hsm/manager_hsm_test.go and 1 other location - About 1 hr to fix
                hsm/manager_hsm_test.go on lines 488..499

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

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

                        {
                            name: "Key not found",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Minor
                Found in hsm/manager_hsm_test.go and 1 other location - About 1 hr to fix
                hsm/manager_hsm_test.go on lines 715..726

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

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

                        {
                            name: "Key not found",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Minor
                Found in hsm/manager_hsm_test.go and 1 other location - About 1 hr to fix
                hsm/manager_hsm_test.go on lines 476..487

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

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

                        {
                            name: "FindKeyPairs Error",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Minor
                Found in hsm/manager_hsm_test.go and 1 other location - About 55 mins to fix
                hsm/manager_hsm_test.go on lines 808..818

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

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

                        {
                            name: "FindKeyPairs Error",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Minor
                Found in hsm/manager_hsm_test.go and 1 other location - About 55 mins to fix
                hsm/manager_hsm_test.go on lines 623..633

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

                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

                        {
                            name: "Key set not found",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Minor
                Found in hsm/manager_hsm_test.go and 1 other location - About 45 mins to fix
                hsm/manager_hsm_test.go on lines 797..807

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

                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

                        {
                            name: "Key not found",
                            args: args{
                                ctx: context.TODO(),
                                set: x.OpenIDConnectKeyName,
                Severity: Minor
                Found in hsm/manager_hsm_test.go and 1 other location - About 45 mins to fix
                hsm/manager_hsm_test.go on lines 612..622

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

                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

                There are no issues that match your filters.

                Category
                Status