Showing 196 of 517 total issues
Class TaskMailRepositoryTest
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
public class TaskMailRepositoryTest
{
#region Private Variables
private readonly IComponentContext _componentContext;
private readonly ITaskMailRepository _taskMailRepository;
File RedmineRepository.cs
has 401 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Threading.Tasks;
using Promact.Erp.DomainModel.ApplicationClass.SlackRequestAndResponse;
using Promact.Erp.DomainModel.DataRepository;
using Promact.Erp.DomainModel.Models;
File TaskMailRepository.cs
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
using Promact.Core.Repository.OauthCallsRepository;
using Promact.Erp.DomainModel.Models;
using System;
using System.Threading.Tasks;
using System.Linq;
Method Initialize
has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring. Open
public virtual void Initialize()
{
if ((this.Errors.HasErrors == false))
{
bool FromDateValueAcquired = false;
- Read upRead up
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 a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring. Open
public virtual void Initialize()
{
if ((this.Errors.HasErrors == false))
{
bool FromDateValueAcquired = false;
- Read upRead up
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 a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring. Open
public virtual void Initialize()
{
if ((this.Errors.HasErrors == false))
{
bool FromDateValueAcquired = false;
- Read upRead up
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 ScrumAsync
has a Cognitive Complexity of 49 (exceeds 20 allowed). Consider refactoring. Open
private async Task<string> ScrumAsync(int projectId, string slackUserName, string parameter, string slackUserId)
{
//because any command outside the scrum time must not be entertained except with the replies like "scrum is concluded","scrum has not started" or "scrum has not started".
Scrum scrum = await GetScrumAsync(projectId);
ScrumActions scrumCommand = (ScrumActions)Enum.Parse(typeof(ScrumActions), parameter);
- Read upRead up
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 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;
Method Initialize
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public virtual void Initialize()
{
if ((this.Errors.HasErrors == false))
{
bool FromDateValueAcquired = false;
Method Initialize
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public virtual void Initialize()
{
if ((this.Errors.HasErrors == false))
{
bool FromDateValueAcquired = false;
Method Initialize
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public virtual void Initialize()
{
if ((this.Errors.HasErrors == false))
{
bool FromDateValueAcquired = false;
Method GetQuestionAsync
has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring. Open
private async Task<string> GetQuestionAsync(int scrumId, List<Question> questions, List<User> users, int projectId)
{
List<ScrumAnswer> scrumAnswers = _scrumAnswerDataRepository.FetchAsync(x => x.ScrumId == scrumId).Result.ToList();
User user = new User();
TemporaryScrumDetails temporaryScrumDetails = await FetchTemporaryScrumDetailsAsync(scrumId);
- Read upRead up
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 TaskMail.cs
has 329 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;
Method Initialize
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void Initialize()
{
user.Id = _stringConstant.StringIdForTest;
user.Email = _stringConstant.EmailForTest;
user.FirstName = _stringConstant.FirstNameForTest;
Method SlackRequestAsync
has 84 lines of code (exceeds 25 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
Class ScrumBotRepository
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
public class ScrumBotRepository : RepositoryBase, IScrumBotRepository
{
#region Private Variable
File OauthCallsRepositoryTest.cs
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
using Autofac;
using Microsoft.AspNet.Identity;
using Moq;
using Promact.Core.Repository.OauthCallsRepository;
using Promact.Core.Repository.ServiceRepository;
Method AddSlackUserInformationAsync
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task AddSlackUserInformationAsync(string code)
{
string slackOAuthRequest = string.Format(_stringConstant.SlackOauthRequestUrl, _envVariableRepository.SlackOAuthClientId, _envVariableRepository.SlackOAuthClientSecret, code);
string slackOAuthResponse = await _httpClientService.GetAsync(_stringConstant.OAuthAcessUrl, slackOAuthRequest, null, _stringConstant.Bearer);
SlackOAuthResponse slackOAuth = JsonConvert.DeserializeObject<SlackOAuthResponse>(slackOAuthResponse);
Method TransformText
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public virtual string TransformText()
{
this.Write("\n");
this.Write("\n");
this.Write("\n");
Method LeaveDateDuplicate
has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring. Open
private async Task<bool> LeaveDateDuplicate(string userId, DateTime startDate, DateTime? endDate)
{
int valid = -1;
bool validIndicator = false;
LeaveRequest lastLeave = new LeaveRequest();
- Read upRead up
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"