ory-am/hydra

View on GitHub
hsm/manager_hsm_test.go

Summary

Maintainability
F
1 wk
Test Coverage

File manager_hsm_test.go has 835 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 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 248..263

                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 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 280..295

                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",
                            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 232..247

                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 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 264..279

                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 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 400..412
                hsm/manager_hsm_test.go on lines 439..451

                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 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 439..451
                hsm/manager_hsm_test.go on lines 465..477

                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 400..412
                hsm/manager_hsm_test.go on lines 465..477

                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 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 426..438
                hsm/manager_hsm_test.go on lines 452..464

                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 387..399
                hsm/manager_hsm_test.go on lines 426..438

                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 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 387..399
                hsm/manager_hsm_test.go on lines 452..464

                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 490..501

                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 729..740

                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 717..728

                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 478..489

                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 625..635

                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 810..820

                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 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 614..624

                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 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 799..809

                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