Showing 886 of 3,221 total issues
Method DataItemGetAllFromList
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private List<DataItem> DataItemGetAllFromList(List<Element> elements, List<DataItem> dataItemLst)
{
foreach (Element element in elements)
{
if (element.GetType() == typeof(DataElement))
Method CreateFieldValue
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<FieldValue> CreateFieldValue(Case aCase, CheckList checkList, Field f, int? ud_id,
int? userId, string value, int? version, Worker worker)
{
FieldValue fv = new FieldValue
{
Method CaseRead
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<ReplyElement> CaseRead(int microtingUId, int checkUId, Language language)
{
string methodName = "Core.CaseRead";
try
{
Method SplitToList
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public string SplitToList(string textToBeSplit, byte index, bool lastInstedOfFirst)
{
try
{
if (string.IsNullOrEmpty(textToBeSplit))
Method InsertHeader
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void InsertHeader(string header, WordprocessingDocument wordDoc, string currentHeader)
{
WriteDebugConsoleLogEntry(new LogEntry(2, "ReportHelper", "InsertHeader called"));
// If currentHeader is not equal to new header, insert new header.
try
Method CoreThread
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async Task CoreThread()
{
_coreThreadRunning = true;
string methodName = "Core.CoreThread";
Method Advanced_UploadedDataRead
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<UploadedData> Advanced_UploadedDataRead(int id)
{
string methodName = "Core.Advanced_UploadedDataRead";
try
{
Method FolderDelete
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task FolderDelete(int id)
{
string methodName = "Core.FolderDelete";
try
{
Method DoSetup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public override async Task DoSetup()
{
#region Setup SettingsTableContent
DbContextHelper dbContextHelper = new DbContextHelper(ConnectionString);
Method Core_Case_CaseDeleteResult_DoesMarkCaseRemoved
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Core_Case_CaseDeleteResult_DoesMarkCaseRemoved()
{
// Arrance
Site site = new Site();
Method CaseReadAll
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<List<Dto.Case>> CaseReadAll(int? templatId, DateTime? start, DateTime? end,
string workflowState, string searchKey, bool descendingSort, string sortParameter,
TimeZoneInfo timeZoneInfo)
Method CaseCreate
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<int> CaseCreate(int checkListId, int siteUId, int? microtingUId, int? microtingCheckId,
string caseUId, string custom, DateTime createdAt, int? folderId)
Method TemplateItemReadAll
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<List<Template_Dto>> TemplateItemReadAll(bool includeRemoved, string siteWorkflowState,
string searchKey, bool descendingSort, string sortParameter, List<int> tagIds, TimeZoneInfo timeZoneInfo,
Language language)
Method CreateFieldValue
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<FieldValue> CreateFieldValue(Case aCase, CheckList checkList, Field f, int? ud_id,
int? userId, string value, int? version, Worker worker)
Method TemplateItemReadAll
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<List<Template_Dto>> TemplateItemReadAll(bool includeRemoved, string siteWorkflowState,
string searchKey, bool descendingSort, string sortParameter, List<int> tagIds, TimeZoneInfo timeZoneInfo,
Language language)
Method CreateTemplate
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<CheckList> CreateTemplate(DateTime cl_ca, DateTime cl_ua, string label, string description,
string caseType, string folderName, int displayIndex, int repeated)
Method CaseReadAll
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<List<Case>> CaseReadAll(int? templateId, DateTime? start, DateTime? end, string workflowState,
string searchKey, bool descendingSort, string sortParameter, TimeZoneInfo timeZoneInfo)
Method CheckRead
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
Open
public async Task<ReplyElement> CheckRead(int microtingUId, int checkUId, Language language)
{
string methodName = "SqlController.CheckRead";
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 CaseDelete
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
Open
public async Task<bool> CaseDelete(int microtingUId)
{
string methodName = "Core.CaseDelete";
Log.LogVariable(methodName, nameof(microtingUId), microtingUId);
- 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 FieldValueReadAllValues
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<List<List<KeyValuePair>>> FieldValueReadAllValues(int fieldId, List<int> caseIds,
string customPathForUploadedData, string decimalSeparator, string thousandSeparator, Language language,
bool gpsCoordinates)