Showing 886 of 3,221 total issues
Method FolderCreate
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<int> FolderCreate(List<CommonTranslationsModel> translations, int? parentId)
{
string methodName = "Core.FolderCreate";
try
{
Method Down
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CheckListTranslations");
Method Down
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_answer_values_options_OptionId",
table: "answer_values");
Method Down
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SiteTags");
Method GenerateSmileyOptions
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async Task GenerateSmileyOptions(MicrotingDbContext dbContext, int languageId)
{
string[] smileys = { "" };
switch (QuestionType)
{
Method CaseToPdf
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<string> CaseToPdf(int caseId, string jasperTemplate, string timeStamp,
string customPathForUploadedData, string fileType, string customXmlContent, Language language)
{
if (fileType != "pdf" && fileType != "docx" && fileType != "pptx")
{
Method Languages_Update_DoesUpdate
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Languages_Update_DoesUpdate()
{
//Arrange
Method FolderCreate
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<int> FolderCreate(List<KeyValuePair<string, string>> name,
List<KeyValuePair<string, string>> description, int? parentId)
{
string methodName = "Core.FolderCreate";
try
Method Up
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_answer_values_options_OptionsId",
table: "answer_values");
Method Workers_Delete_DoesSetWorkflowstateToRemoved
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Workers_Delete_DoesSetWorkflowstateToRemoved()
{
//Arrange
Method CasesToCsv
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public async Task<string> CasesToCsv(int templateId, DateTime? start, DateTime? end, string pathAndName,
string customPathForUploadedData, string decimalSeparator, string thousandSeparator, bool utcTime,
CultureInfo cultureInfo, TimeZoneInfo timeZoneInfo, Language language, bool gpsCoordinates,
bool includeCheckListText)
Method SQL_Template_TemplateDisplayIndexChange_ChangesDisplayIndex
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SQL_Template_TemplateDisplayIndexChange_ChangesDisplayIndex()
{
// Arrance
Method Up
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "FolderId",
table: "check_list_sites",
Method TemplateFieldReadAll
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<List<FieldDto>> TemplateFieldReadAll(int templateId, Language language)
{
string methodName = "SqlController.TemplateFieldReadAll";
_log.LogEverything(methodName, "Start");
try
Method MapVersion
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private object MapVersion(object obj)
{
Type type = obj.GetType().UnderlyingSystemType;
String className = type.Name;
var name = obj.GetType().FullName + "Version";
Method DbSettingsReloadRemote
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<string> DbSettingsReloadRemote()
{
try
{
DbContextHelper dbContextHelper = new DbContextHelper(connectionString);
Method Folders_Create_DoesCreate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task Folders_Create_DoesCreate()
{
//Arrange
Function check_new_nuget_version
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def check_new_nuget_version(package_name):
# Construct the NuGet package URL
package_url = f"https://api.nuget.org/v3-flatcontainer/{package_name.lower()}/index.json"
#print(package_url)
- 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 CasesToCsv
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
Open
public async Task<string> CasesToCsv(int templateId, DateTime? start, DateTime? end, string pathAndName,
string customPathForUploadedData, string decimalSeparator, string thousandSeparator, bool utcTime,
CultureInfo cultureInfo, TimeZoneInfo timeZoneInfo, Language language, bool gpsCoordinates,
bool includeCheckListText)
{
- 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_File_FileCaseFindMUId_doesFindMUId
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public async Task SQL_File_FileCaseFindMUId_doesFindMUId()
{
Random rnd = new Random();
Site site1 = await testHelpers.CreateSite("MySite", 22);