Promact/slack-erp-custom-integration-mvc

View on GitHub

Showing 517 of 517 total issues

Method QuestionAndAnswerAsync has 201 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public async Task<string> QuestionAndAnswerAsync(string answer, string userId)
        {
            // method to get user's details, user's accesstoken, user's task mail details and list or else appropriate message will be send
            var userAndTaskMailDetailsWithAccessToken = await GetUserAndTaskMailDetailsAsync(userId);
            _logger.Info("Task Mail Bot Module, Is task mail question text : " + userAndTaskMailDetailsWithAccessToken.QuestionText);

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

        it("Add Group", fakeAsync(() => {
            let fixture = TestBed.createComponent(GroupAddComponent);
            let groupAddComponent = fixture.componentInstance;
            let toast = fixture.debugElement.injector.get(Md2Toast);
            let router = fixture.debugElement.injector.get(Router);
    Slack.Automation/Promact.Erp.Web/app/Group/GroupEdit/groupEdit.component.spec.ts on lines 99..112

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

    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("Update Group", fakeAsync(() => {
            let fixture = TestBed.createComponent(GroupEditComponent);
            let groupEditComponent = fixture.componentInstance;
            let toast = fixture.debugElement.injector.get(Md2Toast);
            let router = fixture.debugElement.injector.get(Router);
    Slack.Automation/Promact.Erp.Web/app/Group/GroupAdd/groupAdd.component.spec.ts on lines 48..61

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

    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 LeaveUserNotFound()
            {
                await AddChannelUserAsync();
    
    
    Severity: Major
    Found in Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs and 1 other location - About 7 hrs to fix
    Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs on lines 1055..1079

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

    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 LeaveInActiveUser()
            {
                await AddChannelUserAsync();
    
    
    Severity: Major
    Found in Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs and 1 other location - About 7 hrs to fix
    Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs on lines 1175..1200

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

    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

    File LeaveApplication.cs has 465 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    namespace Promact.Erp.Util.Email_Templates
    {
        using System.Linq;
        using System.Text;
        using System.Collections.Generic;
    Severity: Minor
    Found in Slack.Automation/Promact.Erp.Util/Email Templates/LeaveApplication.cs - About 7 hrs to fix

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

              [Fact, Trait("Category", "Required")]
              public async Task ScrumResumeUserHasOnGoingScrumInactive()
              {
                  await AddChannelUserAsync();
                  UserLoginInfo info = new UserLoginInfo(_stringConstant.PromactStringName, _stringConstant.AccessTokenForTest);
      Severity: Major
      Found in Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs and 1 other location - About 7 hrs to fix
      Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs on lines 759..783

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

      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 ScrumResumeDeletedUserHasOnGoingScrum()
              {
                  await AddChannelUserAsync();
                  UserLoginInfo info = new UserLoginInfo(_stringConstant.PromactStringName, _stringConstant.AccessTokenForTest);
      Severity: Major
      Found in Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs and 1 other location - About 7 hrs to fix
      Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs on lines 729..753

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

      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 ProcessMessagesAsync has 177 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public async Task<string> ProcessMessagesAsync(string slackUserId, string slackChannelId, string message, string scrumBotId)
              {
                  _logger.Info(DateTime.UtcNow.Date);
                  string replyText = string.Empty;
                  SlackUserDetailAc slackUserDetail = await _slackUserDetailRepository.GetByIdAsync(slackUserId);

        File LeaveApproveAndRejected.cs has 458 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        namespace Promact.Erp.Util.Email_Templates
        {
            using System.Linq;
            using System.Text;
            using System.Collections.Generic;

          File SickLeaveApplication.cs has 445 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          namespace Promact.Erp.Util.Email_Templates
          {
              using System.Linq;
              using System.Text;
              using System.Collections.Generic;

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

                    [Fact Trait("Category", "Required")]
                    public async Task ScrumReportDetailsTeamLeaderTest()
                    {
                        await CreateUserAndMockingHttpContextToReturnAccessToken();
                        int testProjectId = 1012;
            Slack.Automation/Promact.Core.Test/ScrumReportRepositoryTest.cs on lines 142..162
            Slack.Automation/Promact.Core.Test/ScrumReportRepositoryTest.cs on lines 168..188

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

            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

                    [Fact Trait("Category", "Required")]
                    public async Task ScrumReportDetailsEmployeeTest()
                    {
                        await CreateUserAndMockingHttpContextToReturnAccessToken();
                        int testProjectId = 1012;
            Slack.Automation/Promact.Core.Test/ScrumReportRepositoryTest.cs on lines 168..188
            Slack.Automation/Promact.Core.Test/ScrumReportRepositoryTest.cs on lines 194..214

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

            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

                    [Fact Trait("Category", "Required")]
                    public async Task ScrumReportDetailsAdminTest()
                    {
                        await CreateUserAndMockingHttpContextToReturnAccessToken();
                        int testProjectId = 1012;
            Slack.Automation/Promact.Core.Test/ScrumReportRepositoryTest.cs on lines 142..162
            Slack.Automation/Promact.Core.Test/ScrumReportRepositoryTest.cs on lines 194..214

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

            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('Shows details of leave report for an employee on initialization but there are no leave reports', () => {
                    let mockLeaveReportDetails = new Array<MockLeaveReportDetails>();
                    let fixture = TestBed.createComponent(LeaveReportDetailsComponent); //Create instance of component            
                    let leaveReportDetailsComponent = fixture.componentInstance;
                    let leaveReportService = fixture.debugElement.injector.get(LeaveReportService);
            Slack.Automation/Promact.Erp.Web/app/leaveReport/leaveReport-List/leaveReport-List.component.spec.ts on lines 70..78

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

            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('Shows list of leaveReports on initialization but no reports', () => {
                    let mockLeaveReports = new Array<MockLeaveReport>();
                    let fixture = TestBed.createComponent(LeaveReportListComponent); //Create instance of component            
                    let leaveReportListComponent = fixture.componentInstance;
                    let leaveReportService = fixture.debugElement.injector.get(LeaveReportService);
            Slack.Automation/Promact.Erp.Web/app/leaveReport/leaveReport-Details/leaveReport-Details.component.spec.ts on lines 73..81

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

            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

                    private async Task mockAndUserCreate()
                    {
                        var userResponse = Task.FromResult(_stringConstant.UserDetailsFromOauthServer);
                        var userRequestUrl = string.Format(_stringConstant.FirstAndSecondIndexStringFormat, _stringConstant.DetailsAndSlashForUrl, _stringConstant.StringIdForTest);
                        _mockHttpClient.Setup(x => x.GetAsync(_stringConstant.ProjectUserUrl, userRequestUrl, _stringConstant.AccessTokenForTest, _stringConstant.Bearer)).Returns(userResponse);
            Severity: Major
            Found in Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs and 1 other location - About 5 hrs to fix
            Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 492..506

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

            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

                    private async Task mockAndUserCreateAsync()
                    {
                        var userResponse = Task.FromResult(_stringConstant.UserDetailsFromOauthServer);
                        var userRequestUrl = string.Format(_stringConstant.FirstAndSecondIndexStringFormat, _stringConstant.DetailsAndSlashForUrl, _stringConstant.StringIdForTest);
                        _mockHttpClient.Setup(x => x.GetAsync(_stringConstant.ProjectUserUrl, userRequestUrl, _stringConstant.AccessTokenForTest, _stringConstant.Bearer)).Returns(userResponse);
            Severity: Major
            Found in Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs and 1 other location - About 5 hrs to fix
            Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs on lines 962..976

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

            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

            Class RedmineRepositoryTest has 43 methods (exceeds 20 allowed). Consider refactoring.
            Open

                public class RedmineRepositoryTest
                {
                    #region Private Variables
                    private readonly IComponentContext _componentContext;
                    private readonly IStringConstantRepository _stringConstant;
            Severity: Minor
            Found in Slack.Automation/Promact.Core.Test/RedmineRepositoryTest.cs - About 5 hrs to fix

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

              describe('Task Mail Component Test', () => {
                  const routes: Routes = [];
              
                  beforeEach(async(() => {
                      TestBed.configureTestingModule({
              Slack.Automation/Promact.Erp.Web/app/Group/group.component.spec.ts on lines 8..24
              Slack.Automation/Promact.Erp.Web/app/ScrumReport/scrumReport.component.spec.ts on lines 8..24

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

              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

              Severity
              Category
              Status
              Source
              Language