Showing 226 of 488 total issues
Method CreateItem
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void CreateItem(string itemID, string parentID, byte[] name, string icon,
bool folder, string createTimestamp, string changeTimestamp, bool deleted)
{
try
{
Method ShowPopup
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void ShowPopup(EntryPopup popup)
{
var alert = new AlertDialog.Builder(Forms.Context);
var edit = new EditText(Forms.Context) { Text = popup.Text };
Method CreateLabel
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public bool CreateLabel(string fieldType, string name, string valueType, string icon, bool system, string changed, bool deleted)
{
try
{
CheckConnection();
Method SetCultureInfo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static void SetCultureInfo(string langCode)
{
CultureInfo culture = null;
try {
Method AddSystemLabels
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void AddSystemLabels(bool reset = false)
{
var dal = DataAccessLayer.GetInstance();
if (reset) {
Method ResizeImage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public byte[] ResizeImage(byte[] imageData, float width, float height)
{
var options = new BitmapFactory.Options {
InPurgeable = true
};
Method ThemeSelector
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void ThemeSelector(bool premium)
{
string[] buttons = null;
if (premium) {
buttons = new string[]
Method CheckPassword
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public bool CheckPassword()
{
if(password!=null&&pathToDatabase!=null)
{
if(compareDBVersions()==false)
Method CreateItem
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void CreateItem(string itemID, string parentID, byte[] name, string icon,
bool folder, string createTimestamp, string changeTimestamp, bool deleted)
Method saveIcons
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
Open
static void saveIcons(List<ImageModel> images, IconSet iconSet)
{
if (images != null)
{
if (images.Count > 0)
- 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 AddCheckbox
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
void AddCheckbox(StackLayout settingsLayout, string settingName, string checkedProperty, string menuIcon, string toggleCommand, string chosenSelectionProperty = null, bool isPremium = false)
Method popupWithList
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
StackLayout popupWithList(string selectedProperty, string itemSourceProperty, string iconProperty, string nameProperty, string headerText = null, string headerIcon = null, string headerCommandProperty = null)
Method CreateLabel
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public bool CreateLabel(string fieldType, string name, string valueType, string icon, bool system, string changed, bool deleted)
Method CreateField
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void CreateField(string itemID, string fieldID, string type, byte[] value, string changeTimestamp, bool deleted, int sortWeight)
Avoid deeply nested control flow statements. Open
Open
if (nowDateTime.Subtract(backupDate).Days > Settings.BackupDeletion)
PlatformSpecific.RemoveFile(backupPath + "/" + backupFile);
Avoid deeply nested control flow statements. Open
Open
if (Settings.UsedFingerprintBefore) {
Settings.FingerprintCount = 21;
Settings.RememberedPassword = closedArgs.Text;
}
Avoid deeply nested control flow statements. Open
Open
if (name.ToLower().Contains(loweredText)) {
itemList.Title = item.Title;
itemList.Add(new ItemModel {
Icon = innerItem.Icon,
Name = innerItem.Name,
Avoid deeply nested control flow statements. Open
Open
if (!string.IsNullOrEmpty(e.Text)) {
var groups = BL.GetGroups();
var lastID = groups.Max(g => g.GroupID);
var result = BL.InsertGroup(lastID + 1, e.Text);
if (result) {
Avoid deeply nested control flow statements. Open
Open
if (BL.CheckPassword(password)) {
Settings.UsedFingerprintBefore = true;
Settings.RememberedPassword = password;
setFingerprintChecked(value);
} else {
Avoid deeply nested control flow statements. Open
Open
if (string.Compare(extension, FileController.Zip) == 0) {
mimeType = FileController.ApplicationZipMimeType;
}