Showing 886 of 3,221 total issues
Method GetAnswersForQuestionSet
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task GetAnswersForQuestionSet(int? apiQuestionSetId)
{
if (apiQuestionSetId == null)
return;
Method UploadedData_Update_DoesUpdate
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task UploadedData_Update_DoesUpdate()
{
//Arrange
Method SQL_answers_Update_DoesUpdate_UTCAdjustedFalse
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task SQL_answers_Update_DoesUpdate_UTCAdjustedFalse()
{
// Arrange
Random rnd = new Random();
Method SiteCreate
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<SiteDto> SiteCreate(string name, string userFirstName, string userLastName, string userEmail,
string languageCode)
{
string methodName = "Core.SiteCreate";
await using var db = DbContextHelper.GetDbContext();
Method Core_eForm_SimplePictureAndSignatureFormCreateInDB_ReturnseFormId
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Core_eForm_SimplePictureAndSignatureFormCreateInDB_ReturnseFormId()
{
// Arrange
string xmlstring = @"
Method GetAllSurveyConfigurations
has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring. Open
public async Task<bool> GetAllSurveyConfigurations()
{
var parsedData = JObject.Parse(await _communicator.GetAllSurveyConfigurations().ConfigureAwait(false));
var jsonSerializerSettings = new JsonSerializerSettings
- 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 CheckStatusByMicrotingUid
has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring. Open
public async Task<bool> CheckStatusByMicrotingUid(int microtingUid)
{
string methodName = "Core.CheckStatusByMicrotingUid";
List<CaseDto> lstCase = new List<CaseDto>();
MainElement mainElement = new MainElement();
- 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 SQL_answers_Update_DoesUpdate_UTCAdjustedTrue
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task SQL_answers_Update_DoesUpdate_UTCAdjustedTrue()
{
// Arrange
Random rnd = new Random();
File MainElement.cs
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml.Serialization;
Method Core_Folders_UpdateFolder_DoesUpdateSingleFolderTranslation
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Core_Folders_UpdateFolder_DoesUpdateSingleFolderTranslation()
{
// Arrange
Method GenerateDataSetFromCasesSubSet
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async Task<List<string>> GenerateDataSetFromCasesSubSet(List<string> lstReturn, int? checkListId,
string preLabel, Language language, bool includeCheckListText)
{
string sep = " / ";
await using MicrotingDbContext dbContext = DbContextHelper.GetDbContext();
Method Units_Update_DoesUpdate
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Units_Update_DoesUpdate()
{
//Arrange
Method Core_SiteWorkers_Advanced_SiteWorkerRead_ReadsSiteWorker
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Core_SiteWorkers_Advanced_SiteWorkerRead_ReadsSiteWorker()
{
// Arrange
Method Core_eFormSimpleNumberFormCreateInDB_ReturnseFormId
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Core_eFormSimpleNumberFormCreateInDB_ReturnseFormId()
{
string xmlstring = @"
<?xml version='1.0' encoding='UTF-8'?>
Method Core_Case_CaseRead_ReadsCase
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Core_Case_CaseRead_ReadsCase()
{
// Arrange
#region Arrance
Method XmlToClass
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Response XmlToClass(string xmlStr)
{
try
{
ResponseTypes rType = ResponseTypes.Invalid;
Method InsertPicture
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void InsertPicture(List<string> values, WordprocessingDocument wordDoc,
Paragraph paragraph = null)
{
MainDocumentPart mainPart = wordDoc.MainDocumentPart;
ImagePart imagePart = mainPart.AddImagePart(ImagePartType.Jpeg);
Method OptionTranslation_Delete_DoesDelete
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task OptionTranslation_Delete_DoesDelete()
{
//Arrange
Method Core_eForm_SimpleCommenteFormCreateInDB_ReturnseFormId
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test] // Core_Template_TemplateFromXml_ReturnsTemplate()
public async Task Core_eForm_SimpleCommenteFormCreateInDB_ReturnseFormId()
{
// Arrange
string xmlstring = @"
Method TemplateSetTags
has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring. Open
public async Task<bool> TemplateSetTags(int templateId, List<int> tagIds)
{
string methodName = "SqlController.TemplateSetTags";
try
{
- 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"