Promact/slack-erp-custom-integration-mvc

View on GitHub
Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs

Summary

Maintainability
F
6 days
Test Coverage

File ScrumSetUpRepositoryTest.cs has 342 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using Autofac;
using Moq;
using Promact.Core.Repository.BotQuestionRepository;
using Promact.Erp.DomainModel.Models;
using System;
Severity: Minor
Found in Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs - About 4 hrs to fix

    Class ScrumSetUpRepositoryTest has 22 methods (exceeds 20 allowed). Consider refactoring.
    Open

        public class ScrumSetUpRepositoryTest
        {
    
            #region Private Variables
    
    
    Severity: Minor
    Found in Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs - About 2 hrs to fix

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

              public void Initialization()
              {
                  user.Id = _stringConstant.StringIdForTest;
                  user.Email = _stringConstant.EmailForTest;
                  user.UserName = _stringConstant.EmailForTest;
      Severity: Minor
      Found in Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs - About 1 hr to fix

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

                [Fact, Trait("Category", "Required")]
                public async Task LinkChannel()
                {
                    await UserProjectSetup();
                    slackChannelDetails.ChannelId = _stringConstant.GroupNameStartsWith + _stringConstant.SlackChannelIdForTest;
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 397..411

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

        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 UnLinkChannel()
                {
                    await UserProjectSetup();
                    slackChannelDetails.ChannelId = _stringConstant.GroupNameStartsWith + _stringConstant.SlackChannelIdForTest;
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 208..222

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

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

                [Fact, Trait("Category", "Required")]
                public async Task UnLinkChannelTeamleaderNotActive()
                {
                    await UserProjectSetup();
                    slackChannelDetails.ChannelId = _stringConstant.GroupNameStartsWith + _stringConstant.SlackChannelIdForTest;
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 364..378
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 417..431
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 437..451
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 457..471

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

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

                [Fact, Trait("Category", "Required")]
                public async Task UnLinkChannelNotLinked()
                {
                    await UserProjectSetup();
                    slackChannelDetails.ChannelId = _stringConstant.GroupNameStartsWith + _stringConstant.SlackChannelIdForTest;
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 344..358
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 364..378
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 417..431
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 457..471

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

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

                [Fact, Trait("Category", "Required")]
                public async Task UnLinkChannelLinked()
                {
                    await UserProjectSetup();
                    slackChannelDetails.ChannelId = _stringConstant.GroupNameStartsWith + _stringConstant.SlackChannelIdForTest;
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 344..358
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 364..378
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 437..451
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 457..471

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

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

                [Fact, Trait("Category", "Required")]
                public async Task UnLinkChannelNoProject()
                {
                    await UserProjectSetup();
                    slackChannelDetails.ChannelId = _stringConstant.GroupNameStartsWith + _stringConstant.SlackChannelIdForTest;
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 344..358
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 417..431
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 437..451
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 457..471

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

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

                [Fact, Trait("Category", "Required")]
                public async Task UnLinkChannelNoTeamleader()
                {
                    await UserProjectSetup();
                    slackChannelDetails.ChannelId = _stringConstant.GroupNameStartsWith + _stringConstant.SlackChannelIdForTest;
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 344..358
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 364..378
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 417..431
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 437..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 278.

        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 LinkChannelAlreadyLinked()
                {
                    await UserProjectSetup();
                    slackChannelDetails.ChannelId = _stringConstant.GroupNameStartsWith + _stringConstant.SlackChannelIdForTest;
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 284..297

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

        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 LinkChannelProjectNotActive()
                {
                    await UserProjectSetup();
                    slackChannelDetails.ChannelId = _stringConstant.GroupNameStartsWith + _stringConstant.SlackChannelIdForTest;
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 265..278

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

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

                private async Task InActiveUserProjectSetup()
                {
                    UserLoginInfo info = new UserLoginInfo(_stringConstant.PromactStringName, _stringConstant.AccessTokenForTest);
                    await _userManager.CreateAsync(user);
                    await _userManager.AddLoginAsync(user.Id, info);
        Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs on lines 173..182
        Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs on lines 184..193
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 137..146

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

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

                private async Task UserProjectSetup()
                {
                    UserLoginInfo info = new UserLoginInfo(_stringConstant.PromactStringName, _stringConstant.AccessTokenForTest);
                    await _userManager.CreateAsync(user);
                    await _userManager.AddLoginAsync(user.Id, info);
        Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs on lines 173..182
        Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs on lines 184..193
        Slack.Automation/Promact.Core.Test/ScrumSetUpRepositoryTest.cs on lines 126..135

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

        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