Showing 886 of 3,221 total issues
Method Core_Folders_CreateFolder_DoesCreateNewFolderWithTranslations
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Core_Folders_CreateFolder_DoesCreateNewFolderWithTranslations()
{
// Arrange
Method SQL_answers_Delete_DoesDelete_UTCAdjustedTrue
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SQL_answers_Delete_DoesDelete_UTCAdjustedTrue()
{
// Arrange
Random rnd = new Random();
Method SQL_answers_Delete_DoesDelete_UTCAdjustedFalse
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SQL_answers_Delete_DoesDelete_UTCAdjustedFalse()
{
// Arrange
Random rnd = new Random();
Method ReadSorted
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static async Task<Models.EntityGroup> ReadSorted(MicrotingDbContext dbContext, string entityGroupMUId,
string sort,
string nameFilter)
{
EntityGroup eG =
Method CheckRead
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<ReplyElement> CheckRead(int microtingUId, int checkUId, Language language)
{
string methodName = "SqlController.CheckRead";
try
{
Method FolderUpdate
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task FolderUpdate(int id, List<KeyValuePair<string, string>> name,
List<KeyValuePair<string, string>> description, int? parentId)
{
string methodName = "Core.FolderUpdate";
try
Method Core_Tags_TemplateSetTags_DoesAssignTagToTemplateWithoutDuplicates
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Core_Tags_TemplateSetTags_DoesAssignTagToTemplateWithoutDuplicates()
{
// Arrance
CheckList cl1 = new CheckList
Method TemplateSetTags
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<bool> TemplateSetTags(int templateId, List<int> tagIds)
{
string methodName = "SqlController.TemplateSetTags";
try
{
Method CreateCase
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<Case> CreateCase(string caseUId, CheckList checkList, DateTime created_at, string custom,
DateTime done_at, Worker doneByUserId, int microtingCheckId, int microtingUId, Site site, int? status,
string caseType, Unit unit, DateTime updated_at, int version, Worker worker, string WorkFlowState)
Method Restart
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public override async Task Restart(int sameExceptionCount, int sameExceptionCountMax)
{
string methodName = "Core.Restart";
try
{
Method SiteSurveyConfigurations_Create_DoesCreate
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SiteSurveyConfigurations_Create_DoesCreate()
{
//Arrange
Method SQL_answers_Create_DoesCreate_UTCAdjustedFalse
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SQL_answers_Create_DoesCreate_UTCAdjustedFalse()
{
// Arrange
Random rnd = new Random();
Method Up
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void Up(MigrationBuilder migrationBuilder)
{
//Setup for SQL Server Provider
Method CreateField
has 49 lines of code (exceeds 25 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 ReplaceDataElementsAndDataItems
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async Task<List<Element>> ReplaceDataElementsAndDataItems(int caseId, List<Element> elementList,
List<FieldValue> lstAnswers)
{
List<Element> elementListReplaced = new List<Element>();
Method Folders_Delete_DoesSetWorkflowStateToRemoved
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Folders_Delete_DoesSetWorkflowStateToRemoved()
{
//Arrange
Method LanguageQuestionSet_Delete_DoesDelete
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task LanguageQuestionSet_Delete_DoesDelete()
{
//Assert
Random rnd = new Random();
Method JsonToClass
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public Response JsonToClass(string json)
{
try
{
string value = "";
Method SiteTags_Update_DoesUpdate
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SiteTags_Update_DoesUpdate()
{
// Arrange
Random rnd = new Random();
Method GetElement
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
Open
private async Task<Element> GetElement(int elementId, Language language, bool includeDummyFields)
{
string methodName = "SqlController.GetElement";
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"