Promact/slack-erp-custom-integration-mvc

View on GitHub

Showing 196 of 517 total issues

File StringConstantRepository.cs has 3512 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;

namespace Promact.Erp.Util.StringConstants
{
    public class StringConstantRepository : IStringConstantRepository

    File SlackRepositoryTest.cs has 1193 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using Autofac;
    using Microsoft.AspNet.Identity;
    using Moq;
    using Newtonsoft.Json;
    using Promact.Core.Repository.AttachmentRepository;
    Severity: Major
    Found in Slack.Automation/Promact.Core.Test/SlackRepositoryTest.cs - About 3 days to fix

      Method ProcessMessagesAsync has a Cognitive Complexity of 161 (exceeds 20 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);

      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

      File ScrumBotRepositoryTest.cs has 1156 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using Autofac;
      using Moq;
      using Promact.Core.Repository.BotQuestionRepository;
      using Promact.Core.Repository.ScrumRepository;
      using Promact.Erp.DomainModel.Models;
      Severity: Major
      Found in Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs - About 2 days to fix

        File ScrumBotRepository.cs has 984 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        using System;
        using System.Collections.Generic;
        using System.Data.Entity;
        using System.Linq;
        using System.Threading.Tasks;

          File TaskMailRepositoryTest.cs has 880 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          using Autofac;
          using Autofac.Extras.NLog;
          using Microsoft.AspNet.Identity;
          using Moq;
          using Promact.Core.Repository.BotQuestionRepository;
          Severity: Major
          Found in Slack.Automation/Promact.Core.Test/TaskMailRepositoryTest.cs - About 2 days to fix

            Method QuestionAndAnswerAsync has a Cognitive Complexity of 117 (exceeds 20 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);

            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 LeaveApplyAsync has a Cognitive Complexity of 106 (exceeds 20 allowed). Consider refactoring.
            Open

                    private async Task<string> LeaveApplyAsync(List<string> slackRequest, SlashCommand leave, string accessToken, string userId)
                    {
                        try
                        {
                            LeaveType leaveType;

            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

            File SlackRepository.cs has 635 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            using Promact.Core.Repository.LeaveRequestRepository;
            using Promact.Core.Repository.OauthCallsRepository;
            using Promact.Erp.DomainModel.ApplicationClass;
            using Promact.Erp.DomainModel.ApplicationClass.SlackRequestAndResponse;
            using Promact.Erp.DomainModel.Models;

              Class ScrumBotRepositoryTest has 73 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  public class ScrumBotRepositoryTest
                  {
              
                      #region Private Variables
              
              
              Severity: Major
              Found in Slack.Automation/Promact.Core.Test/ScrumBotRepositoryTest.cs - About 1 day to fix

                Class SlackRepositoryTest has 67 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    public class SlackRepositoryTest
                    {
                        #region Private Variables
                        private readonly IComponentContext _componentContext;
                        private readonly ISlackRepository _slackRepository;
                Severity: Major
                Found in Slack.Automation/Promact.Core.Test/SlackRepositoryTest.cs - About 1 day to fix

                  File RedmineRepositoryTest.cs has 569 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  using Autofac;
                  using Moq;
                  using Newtonsoft.Json;
                  using Promact.Core.Repository.RedmineRepository;
                  using Promact.Erp.DomainModel.ApplicationClass;
                  Severity: Major
                  Found in Slack.Automation/Promact.Core.Test/RedmineRepositoryTest.cs - About 1 day to fix

                    File IStringConstantRepository.cs has 522 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    namespace Promact.Erp.Util.StringConstants
                    {
                        public interface IStringConstantRepository
                        {
                    
                    

                      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);

                        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

                          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;

                                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

                                  Method LeaveApplyAsync has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          private async Task<string> LeaveApplyAsync(List<string> slackRequest, SlashCommand leave, string accessToken, string userId)
                                          {
                                              try
                                              {
                                                  LeaveType leaveType;
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language