Showing 226 of 488 total issues
File LoginScreenViewModel.cs
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Xamarin.Forms;
using NSWallet.Shared;
File BackupManager.cs
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using NSWallet.Controls.EntryPopup;
using NSWallet.Shared;
using NSWallet.Shared.Helpers.Logs.AppLog;
using Xamarin.Forms;
Class BusinessFixture
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
[TestFixture]
public class BusinessFixture
{
const string defaultIcon = "document";
const string defaultLang = "en";
Method AddMenu
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
void AddMenu(StackLayout stack, string modelCommand, string menuName, string menuIcon, string automationId, bool newFeature = false)
{
var itemMenuStack = new StackLayout
{
VerticalOptions = LayoutOptions.CenterAndExpand,
Method PrepareScreenViewByType
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
void PrepareScreenViewByType(object obj = null)
{
try {
name = "";
NSWFormsLabelModel nswFormsLabel;
Method ExecuteSelectedItemCommand
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
void ExecuteSelectedItemCommand(object obj)
{
IsEditItemPanel = false;
IsEditFolderPanel = false;
if (obj == null) return;
- 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 GetSubscriptionPrice
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static async Task<string> GetSubscriptionPrice()
{
var billing = CrossInAppBilling.Current;
var errorPrice = TR.Tr("price_loading_failed");
Method ExecuteBackCommand
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
void ExecuteBackCommand()
{
IsEditItemPanel = false;
IsEditFolderPanel = false;
ItemToScrollTo = BL.CurrentItemID;
Method GetPurchases
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
public static async Task<PremiumStatus> GetPurchases()
{
try
{
// Temporary BETA for Mac Desktop version
- 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 getItems
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
List<ItemList> getItems()
{
var itemList = new List<ItemList>();
var groups = BL.GetGroups();
var iconsPremade = IconGroups.GetIconsWithGroups();
Method UpdateBackup
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void UpdateBackup(string pathFrom, string pathTo, bool isAuthorized = false)
{
try {
bool errorState = false;
var tempDBFolder = createTempDBFolder();
Method onActionSend
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
void onActionSend()
{
try {
if (Intent.Action == Intent.ActionSend) {
var uriFromExtras = Intent.GetParcelableExtra(Intent.ExtraStream) as Android.Net.Uri;
Method DecryptStringAES
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static string DecryptStringAES(byte[] encryptedData, string password, int reEncryptionCount, string hash, out bool ok)
{
ok = false;
var key = prepareKey(password, hash, reEncryptionCount);
Method LocalizationExceptionsLangBG
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
static bool LocalizationExceptionsLangBG(string trTag)
{
switch (trTag)
{
case "airplane":
Method ReloadGroupedContainerList
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void ReloadGroupedContainerList()
{
var colCount = DesiredColumnCount;
var flowGroupsList = new List<FlowGroup>(FlowItemsSource.Count);
var groupDisplayPropertyName = (FlowGroupDisplayBinding as Binding)?.Path;
Method ExecuteLoginCommand
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected void ExecuteLoginCommand(object obj)
{
if (LicenseController.CheckPrivacyPolicy()) {
if (LicenseController.CheckTermsOfUse()) {
AnimationStatus = 0; // 0 - Nothing happened
Method EnumerateItems
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
static void EnumerateItems(string id, bool recursive = false)
{
try {
foreach (var item in BL.GetListByParentID(id, true)) {
if (!recursive)
Method EnumerateItems
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
static void EnumerateItems(string id, bool recursive = false)
{
try {
foreach (var item in BL.GetListByParentID(id, true)) {
if (!recursive)
Method EnumerateItems
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
static void EnumerateItems(string id, bool recursive = false)
{
try {
foreach (var item in BL.GetListByParentID(id, true)) {
if (!recursive)
Method CheckPreviousPremium
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
public static bool CheckPreviousPremium(Page page)
{
try
{
bool premiumRecovered = false;
- 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"