Showing 886 of 3,221 total issues
Method SQL_Check_FieldValueReadList_ReturnsList
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SQL_Check_FieldValueReadList_ReturnsList()
{
// Arrance
Class CoreTestCase
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
[TestFixture]
public class CoreTestCase : DbTestFixture
{
private Core sut;
private TestHelpers testHelpers;
Method CreateField
has 29 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<Field> CreateField(short? barcodeEnabled, string barcodeType, CheckList checkList,
string color, string custom, int? decimalCount, string defaultValue, string description, int? displayIndex,
short? dummy, FieldType ft, short? geolocationEnabled, short? geolocationForced, short? geolocationHidden,
short? isNum, string label, short? mandatory, int maxLength, string maxValue, string minValue, short? multi,
short? optional, string queryType, short? readOnly, short? selected, short? split, short? stopOnSave,
Method Core_Folders_UpdateFolder_DoesUpdateFolderWithTranslations
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Core_Folders_UpdateFolder_DoesUpdateFolderWithTranslations()
{
// Arrange
Method ClearDb
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async Task ClearDb()
{
Console.WriteLine($"Starting ClearDb {DateTime.Now.ToString(CultureInfo.CurrentCulture)}");
List<string> modelNames = new List<string>();
Method AddDefaultLanguages
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
Open
public static async Task AddDefaultLanguages(MicrotingDbContext dbContext)
{
if (dbContext.Languages.FirstOrDefault(x => x.Name == "Danish") != null)
{
- 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_Unit_UnitGetAll_ReturnsAllUnits
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SQL_Unit_UnitGetAll_ReturnsAllUnits()
{
// Arrance
Method SQL_Check_FieldValueUpdate_UpdatesFieldValue
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SQL_Check_FieldValueUpdate_UpdatesFieldValue()
{
// Arrance
Method CheckListSites_Update_DoesUpdate
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task CheckListSites_Update_DoesUpdate()
{
//Arrange
Method Core_Advanced_FieldValueReadList_ReturnsList
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Core_Advanced_FieldValueReadList_ReturnsList()
{
// Arrance
Method Up
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "LastIp",
table: "units",
Method CheckStatusByMicrotingUid
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<bool> CheckStatusByMicrotingUid(int microtingUid)
{
string methodName = "Core.CheckStatusByMicrotingUid";
List<CaseDto> lstCase = new List<CaseDto>();
MainElement mainElement = new MainElement();
File SqlControllerTestSite.cs
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
Method GetAllSurveyConfigurations
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<bool> GetAllSurveyConfigurations()
{
var parsedData = JObject.Parse(await _communicator.GetAllSurveyConfigurations().ConfigureAwait(false));
var jsonSerializerSettings = new JsonSerializerSettings
Method Taggings_Delete_DoesSetWorkflowStateToRemoved
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Taggings_Delete_DoesSetWorkflowStateToRemoved()
{
//Arrange
Method Core_eForm_QuickSyncEnabledeFormFromXML_ReturnseMainElement
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test] // Core_Template_TemplateFromXml_ReturnsTemplate()
public async Task Core_eForm_QuickSyncEnabledeFormFromXML_ReturnseMainElement()
{
// Arrange
string xmlstring = @"
Method CheckListSites_Delete_DoesSetWorkflowStateToRemoved
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task CheckListSites_Delete_DoesSetWorkflowStateToRemoved()
{
//Arrange
Method TemplateUploadData
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<MainElement> TemplateUploadData(MainElement mainElement)
{
if (mainElement == null)
throw new ArgumentNullException(nameof(mainElement), "mainElement not allowed to be null");
Method RunConsole
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task RunConsole()
{
#region warning
Console.WriteLine("");
Method Core_Folders_CreateSubFolder_DoesCreateSubFolderWithTranslations
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Core_Folders_CreateSubFolder_DoesCreateSubFolderWithTranslations()
{
// Arrange