Showing 226 of 488 total issues
Method CustomActionButton
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static StackLayout CustomActionButton(string icon, string text, string command)
{
var iconLabel = new Label {
HorizontalOptions = LayoutOptions.Center,
HorizontalTextAlignment = TextAlignment.Center,
Method GetSettingsIcon
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static Grid GetSettingsIcon(bool solid, string iconFont, string iconText, string popupCommandName = "")
{
var icon = new Label {
TextColor = Theme.Current.MainTitleTextColor,
FontSize = 40,
Method GetFieldTypeNameByShortName
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static string GetFieldTypeNameByShortName(string fieldTypeShortName)
{
switch (fieldTypeShortName) {
case GConsts.FLDTYPE_ACNT:
return TR.Tr("ACNT");
Method TestCaseDecrypt
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public void TestCaseDecrypt()
{
const string password = "Sun001!";
const string expectedString = "nhh86c4uQKXu8rTjp4sL8rr2fxRMmnhWWhan8LiaVb4ZhTdF4RTlX4xcHYjwsfDu";
Method CheckPreviousPremium
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static bool CheckPreviousPremium(Page page)
{
try
{
bool premiumRecovered = false;
Method EnterPassword
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
Open
public void EnterPassword()
{
// FIXME: create correct model view separation, change password should go to model!!!
var popup = new EntryPopup(TR.Tr("enter_new_password"), string.Empty, true);
popup.PopupClosed += (o, closedArgs) => {
- 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 AddListButton
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static void AddListButton(StackLayout stack, string modelCommand, string menuName, string menuIcon)
{
var itemsImportLayout = new StackLayout {
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.Fill,
Method ChangePassword
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public bool ChangePassword(string newPassword)
{
try
{
nswdb.BeginTransaction();
Method wasSubscriptionPurchased
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async Task<bool> wasSubscriptionPurchased(string productID)
{
var billing = CrossInAppBilling.Current;
try
Method changeGroup
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
void changeGroup(ItemModel item)
{
PopupPagesUIController.LaunchChangeGroupPopup((x) => {
if (x.Result != TR.Cancel) {
Device.BeginInvokeOnMainThread(() => {
Method ConvertDBDateTime
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static DateTime ConvertDBDateTime(string dbDateTime)
{
int year, month, day, hour, minute, second;
if (dbDateTime == null)
Method PrepareScreenViewByType
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
Open
void PrepareScreenViewByType(object obj = null)
{
try {
name = "";
NSWFormsLabelModel nswFormsLabel;
- 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 getHTMLFromItems
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static string getHTMLFromItems()
{
string html = null;
foreach (var item in ExportedItems) {
string marginLeft = null;
Method ExecuteSaveFieldCommand
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected void ExecuteSaveFieldCommand()
{
try {
string updText = null;
Method UpdateIcon
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public bool UpdateIcon(string iconID, string name, byte[] blob = null, int groupID = -1, int isCircle = -1)
{
try {
CheckConnection();
BeginTransaction();
Method GetListByParentID
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static List<NSWItem> GetListByParentID(string parentID, bool setAsCurrent)
{
List<NSWItem> filteredList;
if (parentID == GConsts.EXPIRING_SOON_ID) {
filteredList = GetExpiringItems();
Method DecryptStringAES_IOS
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static string DecryptStringAES_IOS(byte[] encryptedData, string password, int reEncryptionCount, string hash, out bool ok)
{
ok = false;
var key = prepareKey(password, hash, reEncryptionCount);
Method CreatePanelButton
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static Grid CreatePanelButton(string btnIcon, string btnText)
{
var icon = new Label {
FontFamily = NSWFontsController.FontAwesomeRegular,
TextColor = Theme.Current.MainTitleTextColor,
Method CheckLocalizationFiles
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public void CheckLocalizationFiles()
{
var langs = Lang.availableLangs();
Method GetCurrentPath
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static string GetCurrentPath()
{
if (CurrentItemID == GConsts.EXPIRING_SOON_ID)
{
return "/" + TR.Tr("expiringsoon_folder") + "/";