Showing 886 of 3,221 total issues
Method SQL_Check_CheckListValueStatusRead_ReturnsCheckListValuesStatus
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SQL_Check_CheckListValueStatusRead_ReturnsCheckListValuesStatus()
{
// Arrance
Method Down
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_field_values_uploaded_datas_UploadedDataId",
table: "field_values");
Method surveyConfiguration_Update_DoesUpdate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task surveyConfiguration_Update_DoesUpdate()
{
// Arrange
Random rnd = new Random();
Method siteSurveyConfiguration_Create_DoesCreate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task siteSurveyConfiguration_Create_DoesCreate()
{
// Arrange
Random rnd = new Random();
Method CaseUpdate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<bool> CaseUpdate(int caseId, List<string> newFieldValuePairLst,
List<string> newCheckListValuePairLst)
{
string methodName = "Core.CaseUpdate";
try
Method EntityGroupCreate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<Microting.eForm.Infrastructure.Data.Entities.EntityGroup> EntityGroupCreate(string entityType,
string name, string description, bool locked, bool editable)
{
string methodName = "Core.EntityGroupCreate";
try
Method Advanced_SiteItemDelete
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<bool> Advanced_SiteItemDelete(int microtingUid)
{
string methodName = "Core.Advanced_SiteItemDelete";
try
{
Method Core_Template_TemplateUploAddAsyncata_ReturnsmainElement
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Core_Template_TemplateUploAddAsyncata_ReturnsmainElement()
{
// Arrange
CoreElement CElement = new CoreElement();
Method ClassToXml
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public string ClassToXml()
{
try
{
string xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + Environment.NewLine +
Method CaseUpdateCompleted
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task CaseUpdateCompleted(int microtingUId, int microtingCheckId, DateTime doneAt,
int workerMicrotingUId, int unitMicrotingUid)
{
string methodName = "SqlController.CaseUpdateCompleted";
try
Method CreateSpecialOption
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async Task CreateSpecialOption(MicrotingDbContext dbContext, int weight, int weightedValue, string text,
int languageId, int optionIndex)
{
var result = (from ot in dbContext.OptionTranslations
join o in dbContext.Options
Method Delete
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<string> Delete(string elementId, string siteId)
{
try
{if (_addressNewApi != "none")
{
Method SiteCreate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<Tuple<SiteDto, UnitDto>> SiteCreate(string name, string languageCode)
{
_log.LogEverything("Communicator.SiteCreate", "called");
_log.LogVariable("Communicator.SiteCreate", nameof(name), name);
Method Workers_Create_DoesCreate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Workers_Create_DoesCreate()
{
//Arrange
Random rnd = new Random();
Method Tags_Delete_DoesSetWorkflowStateToRemoved
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Tags_Delete_DoesSetWorkflowStateToRemoved()
{
Random rnd = new Random();
Method TranscribeUploadedData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<bool> TranscribeUploadedData(int uploadedDataId)
{
string methodName = "Core.TranscribeUploadedData";
try
{
Method CaseReadAll
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<CaseList> CaseReadAll(int? templatId, DateTime? start, DateTime? end, string workflowState,
string searchKey, bool descendingSort, string sortParameter, int offSet, int pageSize,
TimeZoneInfo timeZoneInfo)
Method SettingCheckAll
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
Open
public async Task<List<string>> SettingCheckAll()
{
string methodName = "SqlController.SettingCheckAll";
List<string> result = new List<string>();
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
Method CaseReadAll
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<CaseList> CaseReadAll(int? templateId, DateTime? start, DateTime? end, string workflowState,
string searchKey, bool descendingSort, string sortParameter, int pageIndex, int pageSize,
TimeZoneInfo timeZoneInfo)
Method CreateUploadedData
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<UploadedData> CreateUploadedData(string checkSum, string currentFile, string extension,
string fileLocation, string fileName, short? local, Worker worker, string uploaderType, int version,
bool createPhysicalFile)