Promact/slack-erp-custom-integration-mvc

View on GitHub

Showing 517 of 517 total issues

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

        [Fact, Trait("Category", "Required")]
        public async Task QuestionAndAnswerAfterSecondAnswerAsync()
        {
            await mockAndUserCreateAsync();
            await _slackUserRepository.AddSlackUserAsync(slackUserDetails);
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 189..204
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 290..305
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 329..344
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 369..384
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 451..466
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 471..486

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

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

        [Fact, Trait("Category", "Required")]
        public async Task QuestionAndAnswerAfterThirdAnswerAsync()
        {
            await mockAndUserCreateAsync();
            await _slackUserRepository.AddSlackUserAsync(slackUserDetails);
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 189..204
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 250..265
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 329..344
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 369..384
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 451..466
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 471..486

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

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

        [Fact, Trait("Category", "Required")]
        public async Task QuestionAndAnswerAfterForthAnswerAsync()
        {
            await mockAndUserCreateAsync();
            await _slackUserRepository.AddSlackUserAsync(slackUserDetails);
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 189..204
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 250..265
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 290..305
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 369..384
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 451..466
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 471..486

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

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

        [Fact, Trait("Category", "Required")]
        public async Task QuestionAndAnswerAfterSixthAnswerForNoAsync()
        {
            await mockAndUserCreateAsync();
            await _slackUserRepository.AddSlackUserAsync(slackUserDetails);
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 189..204
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 250..265
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 290..305
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 329..344
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 369..384
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 471..486

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

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

        [Fact, Trait("Category", "Required")]
        public async Task QuestionAndAnswerAfterFifthAnswerForYesAsync()
        {
            await mockAndUserCreateAsync();
            await _slackUserRepository.AddSlackUserAsync(slackUserDetails);
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 189..204
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 250..265
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 290..305
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 329..344
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 451..466
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 471..486

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

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

        [Fact, Trait("Category", "Required")]
        public async Task QuestionAndAnswerAfterFirstAnswerAsync()
        {
            await mockAndUserCreateAsync();
            await _slackUserRepository.AddSlackUserAsync(slackUserDetails);
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 250..265
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 290..305
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 329..344
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 369..384
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 451..466
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 471..486

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

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

        [Fact, Trait("Category", "Required")]
        public async Task QuestionAndAnswerAfterSendingMailAsync()
        {
            await mockAndUserCreateAsync();
            await _slackUserRepository.AddSlackUserAsync(slackUserDetails);
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 189..204
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 250..265
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 290..305
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 329..344
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 369..384
Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 451..466

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

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

Method SlackRequestAsync has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring.
Open

        public async Task SlackRequestAsync(SlashCommand slashCommand)
        {
            // Way to break string by spaces only if spaces are not between quotes
            var text = _attachmentRepository.SlackText(slashCommand.Text);
            // Get user details from SlackUserId

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method Initialize has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public void Initialize()
        {
            slashCommand.UserId = _stringConstant.UserSlackId;
            project.Projects = new List<RedmineProject>();
            project.IssueCount = 25;
Severity: Major
Found in Slack.Automation/Promact.Core.Test/RedmineRepositoryTest.cs - About 2 hrs to fix

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

            [Fact, Trait("Category", "Required")]
            public async Task GetUserByEmployeeIdAsync()
            {
                await CreateUserAndMockingHttpContextToReturnAccessToken();
                var response = Task.FromResult(_stringConstant.UserDetailsFromOauthServer);
    Slack.Automation/Promact.Core.Test/OauthCallsRepositoryTest.cs on lines 189..198

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

    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

            [Fact, Trait("Category", "Required")]
            public async Task GetUserByEmployeeIdFalseAsync()
            {
                await CreateUserAndMockingHttpContextToReturnAccessToken();
                var response = Task.FromResult(_stringConstant.UserDetailsFromOauthServer);
    Slack.Automation/Promact.Core.Test/OauthCallsRepositoryTest.cs on lines 175..184

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

    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

            [Fact, Trait("Category", "Required")]
            public async Task SlackLeaveCancelWrongAsync()
            {
                await AddUser();
                await AddThreeUserIncomingWebHookAsync();
    Severity: Major
    Found in Slack.Automation/Promact.Core.Test/SlackRepositoryTest.cs and 1 other location - About 2 hrs to fix
    Slack.Automation/Promact.Core.Test/SlackRepositoryTest.cs on lines 421..433

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

    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

            [Fact, Trait("Category", "Required")]
            public async Task SlackLeaveStatusOwnFalseAsync()
            {
                await AddUser();
                await AddThreeUserIncomingWebHookAsync();
    Severity: Major
    Found in Slack.Automation/Promact.Core.Test/SlackRepositoryTest.cs and 1 other location - About 2 hrs to fix
    Slack.Automation/Promact.Core.Test/SlackRepositoryTest.cs on lines 346..358

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

    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

            [Fact, Trait("Category", "Required")]
            public async Task GetUserByUserIdFalseAsync()
            {
                var response = Task.FromResult(_stringConstant.UserDetailsFromOauthServer);
                var requestUrl = string.Format(_stringConstant.FirstAndSecondIndexStringFormat, _stringConstant.UserDetailsUrl, _stringConstant.FirstNameForTest);
    Slack.Automation/Promact.Core.Test/OauthCallsRepositoryTest.cs on lines 51..59

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

    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

            [Fact, Trait("Category", "Required")]
            public async Task GetUserByUserIdAsync()
            {
                var response = Task.FromResult(_stringConstant.UserDetailsFromOauthServer);
                var requestUrl = string.Format(_stringConstant.FirstAndSecondIndexStringFormat, _stringConstant.DetailsAndSlashForUrl, _stringConstant.FirstNameForTest);
    Slack.Automation/Promact.Core.Test/OauthCallsRepositoryTest.cs on lines 100..108

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

    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

            [Fact, Trait("Category", "Required")]
            public async Task CasualLeaveFalseAsync()
            {
                var response = Task.FromResult(_stringConstant.CasualLeaveResponse);
                var requestUrl = string.Format(_stringConstant.FirstAndSecondIndexStringFormat, _stringConstant.CasualLeaveUrl, _stringConstant.FirstNameForTest);
    Slack.Automation/Promact.Core.Test/OauthCallsRepositoryTest.cs on lines 149..157

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

    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

            [Fact, Trait("Category", "Required")]
            public async Task GetManagementUserNameAsync()
            {
                var managementResponse = Task.FromResult(_stringConstant.ManagementDetailsFromOauthServer);
                var managementRequestUrl = _stringConstant.ManagementDetailsUrl;
    Slack.Automation/Promact.Core.Test/OauthCallsRepositoryTest.cs on lines 131..144

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

    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

            [Fact, Trait("Category", "Required")]
            public async Task CasualLeaveAsync()
            {
                var response = Task.FromResult(_stringConstant.CasualLeaveResponse);
                var requestUrl = string.Format(_stringConstant.FirstAndSecondIndexStringFormat, _stringConstant.CasualLeaveUrl, _stringConstant.FirstNameForTest);
    Slack.Automation/Promact.Core.Test/OauthCallsRepositoryTest.cs on lines 162..170

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

    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

            [Fact, Trait("Category", "Required")]
            public async Task GetManagementUserNameFalseAsync()
            {
                var managementResponse = Task.FromResult(_stringConstant.ManagementDetailsFromOauthServer);
                var managementRequestUrl = _stringConstant.ManagementDetailsUrl;
    Slack.Automation/Promact.Core.Test/OauthCallsRepositoryTest.cs on lines 82..95

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

    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

    Method Initialization has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public void Initialization()
            {
                scrumAnswer.Answer = _stringConstant.NoQuestion;
                scrumAnswer.CreatedOn = DateTime.UtcNow;
                scrumAnswer.AnswerDate = DateTime.UtcNow;
    Severity: Major
    Found in Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs - About 2 hrs to fix
      Severity
      Category
      Status
      Source
      Language