gitlabhq/gitlab-shell

View on GitHub

Showing 80 of 80 total issues

Method serverConfig.handleUserCertificate has 5 return statements (exceeds 4 allowed).
Open

func (s *serverConfig) handleUserCertificate(ctx context.Context, user string, cert *ssh.Certificate) (*ssh.Permissions, error) {
    if os.Getenv("FF_GITLAB_SHELL_SSH_CERTIFICATES") != "1" {
        return nil, fmt.Errorf("handleUserCertificate: feature is disabled")
    }

Severity: Major
Found in internal/sshd/server_config.go - About 35 mins to fix

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

          context 'when key is provided' do
            let(:cmd) { "#{gitlab_shell_path} key-100" }
    
            it 'lfs is successfully authenticated' do
              output, stderr, status = Open3.capture3(env, cmd)
    Severity: Minor
    Found in spec/gitlab_shell_lfs_authentication_spec.rb and 1 other location - About 35 mins to fix
    spec/gitlab_shell_lfs_authentication_spec.rb on lines 80..87

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

    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

          context 'when username is provided' do
            let(:cmd) { "#{gitlab_shell_path} username-someone" }
    
            it 'lfs is successfully authenticated' do
              output, stderr, status = Open3.capture3(env, cmd)
    Severity: Minor
    Found in spec/gitlab_shell_lfs_authentication_spec.rb and 1 other location - About 35 mins to fix
    spec/gitlab_shell_lfs_authentication_spec.rb on lines 69..76

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

    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

            it 'the recovery keys are regenerated' do
              Open3.popen2(env, cmd) do |stdin, stdout|
                expect(stdout.gets).to eq("Are you sure you want to generate new two-factor recovery codes?\n")
                expect(stdout.gets).to eq("Any existing recovery codes you saved will be invalidated. (yes/no)\n")
    
    
    Severity: Minor
    Found in spec/gitlab_shell_two_factor_recovery_spec.rb and 1 other location - About 30 mins to fix
    spec/gitlab_shell_two_factor_recovery_spec.rb on lines 79..87

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

    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

          it 'the recovery keys are not regenerated' do
            Open3.popen2(env, cmd) do |stdin, stdout|
              expect(stdout.gets).to eq("Are you sure you want to generate new two-factor recovery codes?\n")
              expect(stdout.gets).to eq("Any existing recovery codes you saved will be invalidated. (yes/no)\n")
    
    
    Severity: Minor
    Found in spec/gitlab_shell_two_factor_recovery_spec.rb and 1 other location - About 30 mins to fix
    spec/gitlab_shell_two_factor_recovery_spec.rb on lines 97..104

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

    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

    FIXME found
    Open

        // FIXME: This causes tests to fail

    TODO found
    Open

          - TODO
    Severity: Minor
    Found in .golangci.yml by fixme

    FIXME found
    Open

          - FIXME
    Severity: Minor
    Found in .golangci.yml by fixme

    TODO found
    Open

            // TODO: Log this event once we have a consistent way to log in Go.

    FIXME found
    Open

        # report any comments starting with keywords, this is useful for TODO or FIXME comments that
    Severity: Minor
    Found in .golangci.yml by fixme

    TODO found
    Open

        keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
    Severity: Minor
    Found in .golangci.yml by fixme

    BUG found
    Open

          - BUG
    Severity: Minor
    Found in .golangci.yml by fixme

    XXX found
    Open

        # XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
    Severity: Minor
    Found in .golangci.yml by fixme

    XXX found
    Open

        # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
    Severity: Minor
    Found in .golangci.yml by fixme

    FIXME found
    Open

        // FIXME: Let's not allow this to be set in config.yml
    Severity: Minor
    Found in internal/config/config.go by fixme

    BUG found
    Open

        keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
    Severity: Minor
    Found in .golangci.yml by fixme

    XXX found
    Open

        # XXX: we don't recommend using this linter before doing performance profiling.
    Severity: Minor
    Found in .golangci.yml by fixme

    FIXME found
    Open

        keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
    Severity: Minor
    Found in .golangci.yml by fixme

    HACK found
    Open

          - HACK # marks hack-arounds that should be removed before merging
    Severity: Minor
    Found in .golangci.yml by fixme

    TODO found
    Open

        # report any comments starting with keywords, this is useful for TODO or FIXME comments that
    Severity: Minor
    Found in .golangci.yml by fixme
    Severity
    Category
    Status
    Source
    Language