Showing 3,203 of 3,219 total issues
Method question_Create_DoesCreate_QuestionSetFalse_ValidDisplayBackButtonEnabledTrue
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Create_DoesCreate_QuestionSetFalse_ValidDisplayBackButtonEnabledTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method question_Create_DoesCreate_QuestionSetFalse_PrioritisedValidDisplayImageTrue
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Create_DoesCreate_QuestionSetFalse_PrioritisedValidDisplayImageTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method InsertImages
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void InsertImages(WordprocessingDocument wordDoc,
List<KeyValuePair<string, List<string>>> pictures)
{
string currentHeader = "";
List<Paragraph> foundEntriesToClearText = new List<Paragraph>();
Method Close
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<bool> Close()
#pragma warning restore 1998
{
string methodName = "Core.Close";
Log.LogStandard(methodName, "Close called");
Method EntityItemCreate
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async Task<EntityItem> EntityItemCreate(int entitItemGroupId, string name, string description,
string ownUuid, int displayIndex)
{
EntityGroup eg = await _sqlController.EntityGroupRead(entitItemGroupId).ConfigureAwait(false);
EntityItem et = await _sqlController.EntityItemRead(entitItemGroupId, name, description)
Method SiteWorkers_Delete_DoesSetWorkflowStateToRemoved
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task SiteWorkers_Delete_DoesSetWorkflowStateToRemoved()
{
// Arrange
Similar blocks of code found in 2 locations. Consider refactoring. Open
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microting.eForm.Migrations
{
public partial class AddingExcelExportEnabledToCheckList : Migration
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 157.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
using Microsoft.EntityFrameworkCore.Migrations;
namespace Microting.eForm.Migrations
{
public partial class AddinDisplayIndexToOptions : Migration
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 157.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
Unit unit = new Unit
{
CustomerNo = rnd.Next(1, 255),
MicrotingUid = rnd.Next(1, 255),
OtpCode = rnd.Next(1, 255),
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 156.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
Unit unit = new Unit
{
CustomerNo = rnd.Next(1, 255),
MicrotingUid = rnd.Next(1, 255),
OtpCode = rnd.Next(1, 255),
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 156.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
Unit unit = new Unit
{
CustomerNo = rnd.Next(1, 255),
MicrotingUid = rnd.Next(1, 255),
OtpCode = rnd.Next(1, 255),
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 156.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File Tools.cs
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
Method SubscriberThread
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
private void SubscriberThread()
{
var token = _sqlController.SettingRead(Settings.token).GetAwaiter().GetResult();
if (token != "UNIT_TEST___________________L:32" && token != "abc1234567890abc1234567890abcdef")
{
- 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 Core_Folders_CreateSubFolder_DoesCreateSubFolder
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Core_Folders_CreateSubFolder_DoesCreateSubFolder()
{
// Arrange
Method SQL_answers_Create_DoesCreate_UTCAdjustedTrue
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task SQL_answers_Create_DoesCreate_UTCAdjustedTrue()
{
// Arrange
Random rnd = new Random();
Method CaseCreate
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<int> CaseCreate(int checkListId, int siteUId, int? microtingUId, int? microtingCheckId,
string caseUId, string custom, DateTime createdAt, int? folderId)
{
string methodName = "SqlController.CaseCreate";
_log.LogStandard(methodName, "called");
Method SetAutoIncrementforTables
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void SetAutoIncrementforTables(MigrationBuilder migrationBuilder)
{
List<string> modelNames = new List<string>();
modelNames.Add("case_versions");
modelNames.Add("cases");
Method FolderUpdate
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task FolderUpdate(int id, List<CommonTranslationsModel> translations, int? parentId)
{
string methodName = "Core.FolderUpdate";
try
{
Method QuestionSets_Update_DoesUpdate
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task QuestionSets_Update_DoesUpdate()
{
//Arrange
Method GetAllQuestionSets
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<bool> GetAllQuestionSets()
{
var parsedData = JObject.Parse(await _communicator.GetAllQuestionSets().ConfigureAwait(false));
if (!parsedData.HasValues)