Showing 886 of 3,221 total issues
Method Core_Advanced_FieldRead_ReadsFieldId
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Core_Advanced_FieldRead_ReadsFieldId()
{
// Arrance
Method SQL_Check_FieldRead_ReturnsField
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SQL_Check_FieldRead_ReturnsField()
{
// Arrance
Method Core_Folders_UpdateFolder_DoesUpdateFolder
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Core_Folders_UpdateFolder_DoesUpdateFolder()
{
// Arrange
Method siteSurveyConfiguration_Update_DoesUpdate
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task siteSurveyConfiguration_Update_DoesUpdate()
{
// Arrange
Random rnd = new Random();
Method WorkerGetAll
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<List<WorkerDto>> WorkerGetAll(string workflowState, int? offSet, int? limit)
{
string methodName = "SqlController.WorkerGetAll";
try
{
Method CaseReadByMUId
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<CaseDto> CaseReadByMUId(int microtingUId)
{
string methodName = "SqlController.CaseReadByMUId";
try
{
Method Workers_Update_DoesUpdate
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Workers_Update_DoesUpdate()
{
//Arrange
Method FieldValidation
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async Task<List<string>> FieldValidation(MainElement mainElement)
{
string methodName = "Core.FieldValidation";
Log.LogStandard(methodName, "called");
Method Core_Case_CaseToJasperXml_ReturnsPath
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Core_Case_CaseToJasperXml_ReturnsPath()
{
// Arrange
Method EntityGroups_Update_DoesUpdate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task EntityGroups_Update_DoesUpdate()
{
EntityGroup entityGroup = new EntityGroup
{
Method SiteTags_MultipleCreateAndDelete
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SiteTags_MultipleCreateAndDelete()
{
Random rnd = new Random();
Method QuestionSets_Delete_DoesSetWorkflowStateToRemoved
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task QuestionSets_Delete_DoesSetWorkflowStateToRemoved()
{
//Arrange
Method EntityItemUpdate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task EntityItemUpdate(int id, string name, string description, string ownUuid, int displayIndex)
{
await using var dbContext = DbContextHelper.GetDbContext();
Microting.eForm.Infrastructure.Data.Entities.EntityItem et =
await dbContext.EntityItems.FirstOrDefaultAsync(x => x.Id == id);
Method SiteWorkers_Create_DoesCreate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SiteWorkers_Create_DoesCreate()
{
// Arrange
Method SurveyConfigurations_Create_DoesCreate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SurveyConfigurations_Create_DoesCreate()
{
//Arrange
Random rnd = new Random();
Method TemplateFromXml
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
Open
public async Task<MainElement> TemplateFromXml(string xmlString)
#pragma warning restore 1998
{
if (string.IsNullOrEmpty(xmlString))
throw new ArgumentNullException("xmlString cannot be null or empty");
- 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 Up
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "FolderTranslations",
columns: table => new
Method CaseReadFirstId
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<int?> CaseReadFirstId(int? templateId, string workflowState)
{
string methodName = "SqlController.CaseReadFirstId";
_log.LogStandard(methodName, "called");
_log.LogVariable(methodName, nameof(templateId), templateId);
Method SettingCreateDefaults
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<bool> SettingCreateDefaults()
{
string methodName = "SqlController.SettingCreateDefaults";
WriteDebugConsoleLogEntry(new LogEntry(2, methodName, "called"));
Method Handle
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task Handle(TranscriptionCompleted message)
{
try
{
FieldValue fv = await sqlController.GetFieldValueByTranscriptionId(message.MicrotringUUID);