Showing 63 of 149 total issues
Method AddBiteMeMenu
has 1163 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task AddBiteMeMenu()
{
var menuVendor = new MenuVendor
{
File DocumentDbRepositoryTest.cs
has 1840 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
Method AddMenu
has 344 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task AddMenu()
{
var menuVendor = new MenuVendor
{
Function updateUserBalance
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
function updateUserBalance(userBalanceAudit) {
var context = getContext();
var collection = context.getCollection();
- 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
Function addUserOrder
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
function addUserOrder(vendorOrderId, docDbVendorOrderHistoryEntries, docDbUserOrderHistory, lastOrder) {
if (!docDbVendorOrderHistoryEntries || !docDbVendorOrderHistoryEntries.length) {
throw new Error('There are no entries to insert');
}
- 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
File BadgeService.cs
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using Lunchorder.Common.Interfaces;
Method CalculateStatistics
has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring. Open
[Test]
public async Task CalculateStatistics()
{
// todo loop all users.
var allUsersQuery = DocumentDbBase.DocumentStore.GetItems<ApplicationUser>(x => x.Type == DocumentDbType.User);
- 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 CreateVendorHistory
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static string CreateVendorHistory(IConfigurationService configurationService, VendorOrderHistory vendorOrderHistory)
{
using (var stringWriter = new StringWriter())
{
using (HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter))
Function updateUserBalance
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function updateUserBalance(platformUserList) {
var context = getContext();
var collection = context.getCollection();
- 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
Function deserialize
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
deserialize(input: any): Menu {
if (!input) return;
this.id = input.id;
this.enabled = input.enabled;
- 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
Class AuthorizationControllerTestBase
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
public class AuthorizationControllerTestBase : ControllerTestBase
{
public async Task<TokenResponse> AuthorizeUser(string username, string password)
{
var httpContent = AuthorizeHttpContentRequest(username, password);
Method CalculateStatistics
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task CalculateStatistics()
{
// todo loop all users.
var allUsersQuery = DocumentDbBase.DocumentStore.GetItems<ApplicationUser>(x => x.Type == DocumentDbType.User);
Function addUserOrder
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addUserOrder(vendorOrderId, docDbVendorOrderHistoryEntries, docDbUserOrderHistory, lastOrder) {
if (!docDbVendorOrderHistoryEntries || !docDbVendorOrderHistoryEntries.length) {
throw new Error('There are no entries to insert');
}
Function migrateUsers
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function migrateUsers() {
var context = getContext();
var collection = context.getCollection();
- 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
Function bulkDeleteSproc
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function bulkDeleteSproc(query) {
var collection = getContext().getCollection();
var collectionLink = collection.getSelfLink();
var response = getContext().getResponse();
var responseBody = {
- 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
Function updateUserBalance
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateUserBalance(userBalanceAudit) {
var context = getContext();
var collection = context.getCollection();
Class DocumentDbRepository
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
public class DocumentDbRepository : IDatabaseRepository
{
private readonly IDocumentStore _documentStore;
private readonly IMapper _mapper;
Function updateUserPicture
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function updateUserPicture(userId, userPictureUrl) {
var context = getContext();
var collection = context.getCollection();
- 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
Function upgradeUserHistory
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function upgradeUserHistory() {
var context = getContext();
var collection = context.getCollection();
- 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
Function updateUserBalance
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function updateUserBalance(vendorOrderHistoryId) {
var context = getContext();
var collection = context.getCollection();
- 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"