Showing 886 of 3,221 total issues
Method Core_eForm_OptionsWithMicrotingFormFromXML_ReturnseMainElement
has 452 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Core_eForm_OptionsWithMicrotingFormFromXML_ReturnseMainElement()
{
// Arrange
string xmlstring = @"
Method MoveTranslations
has a Cognitive Complexity of 126 (exceeds 20 allowed). Consider refactoring. Open
public static async Task MoveTranslations(MicrotingDbContext dbContext)
{
try
{
List<Field> fields = await dbContext.Fields.ToListAsync();
- 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 DocxToPdf
has a Cognitive Complexity of 125 (exceeds 20 allowed). Consider refactoring. Open
private async Task<string> DocxToPdf(int caseId, string templateId, string timeStamp,
Microting.eForm.Infrastructure.Data.Entities.Case dbCase, CaseDto cDto, string customPathForUploadedData,
string customXmlContent, string fileType, Language language)
{
SortedDictionary<string, string> valuePairs = new SortedDictionary<string, string>();
- 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 Http.cs
has 897 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.CodeDom.Compiler;
using System.IO;
using System.Net;
using System.Net.Http;
File SqlControllerTestUnit.cs
has 894 lines of code (exceeds 250 allowed). Consider refactoring. Open
using eFormCore;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;
using System;
using System.Collections.Generic;
Method CreateDataItem
has a Cognitive Complexity of 114 (exceeds 20 allowed). Consider refactoring. Open
private async Task CreateDataItem(int? parentFieldId, int elementId, DataItem dataItem, Language language)
{
string methodName = "SqlController.CreateDataItem";
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"
Further reading
File CoreTestCaseReadAllShort.cs
has 825 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
File SqlControllerTestWorker.cs
has 804 lines of code (exceeds 250 allowed). Consider refactoring. Open
using eFormCore;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;
using System;
using System.Collections.Generic;
File FieldsUTest.cs
has 797 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
Method GenerateDataSetFromCasesSubSet
has a Cognitive Complexity of 108 (exceeds 20 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();
- 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 Core_Template_TemplateItemReadAll_DoesReturnSortedTemplates
has 359 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Core_Template_TemplateItemReadAll_DoesReturnSortedTemplates()
{
// Arrance
File SqlControllerTestSite.cs
has 762 lines of code (exceeds 250 allowed). Consider refactoring. Open
using eFormCore;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;
using System;
using System.Collections.Generic;
Method Up
has 356 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected override void Up(MigrationBuilder migrationBuilder)
{
//Setup for SQL Server Provider
string autoIDGenStrategy = "SqlServer:ValueGenerationStrategy";
Method AddDefaultLanguages
has 350 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static async Task AddDefaultLanguages(MicrotingDbContext dbContext)
{
if (dbContext.Languages.FirstOrDefault(x => x.Name == "Danish") != null)
{
File CoreTesteForm.cs
has 728 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
Method Core_Advanced_UpdateCaseFieldValue_UpdatesFieldValue
has 336 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Core_Advanced_UpdateCaseFieldValue_UpdatesFieldValue()
{
// Arrange
File SqlControllerTestFieldValue.cs
has 726 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
File OptionTranslationUTest.cs
has 725 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
File 20190509074123_RefactoringidtoId.cs
has 718 lines of code (exceeds 250 allowed). Consider refactoring. Open
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microting.eForm.Migrations
{
Method SQL_Check_CheckRead_ReturnsReplyElement
has 315 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task SQL_Check_CheckRead_ReturnsReplyElement()
{
// Arrance