Showing 13 of 13 total issues
Method FromClipboard
has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring. Open
public static ClipboardContents FromClipboard() { var container = new ClipboardContents { Timestamp = DateTime.Now };
- Read upRead up
Class Dialog
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
public sealed partial class Dialog : MasterForm { private ClipboardContents clipData = new ClipboardContents(); private int saveCount = 0; private bool _formLoaded = false;
Method save
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
string save(bool overwriteIfExists = false, bool? clearClipboardOverwrite = false) { try { var (content, ext) = contentToSave(); if (content == null) {
- Read upRead up
Method RunConfig
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
static int RunConfig(ArgsConfig args) { try { if (args.Filename != null) Settings.Default.filenameTemplate = args.Filename; if (args.TextExtension != null)
- Read upRead up
Method RunTray
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
static int RunTray(ArgsTray args = null) { var mutex = new Mutex(false, "PasteIntoFile-Tray:0fc405f4-6b23-4fd5-af4d-1291a2130531"); try { if (!mutex.WaitOne(0, false)) {
- Read upRead up
Method updateContentPreview
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
private void updateContentPreview() { textPreview.Hide(); htmlPreview.Hide(); imagePreview.Hide();
- Read upRead up
Method FromFile
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
public static ClipboardContents FromFile(string path) { var ext = BaseContent.NormalizeExtension(Path.GetExtension(path).Trim('.')); var container = new ClipboardContents { Timestamp = DateTime.Now };
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
case Template.SUBFOLDER: Text = Resources.str_subfolder_template; labelInfo.Text = Resources.str_template_edit_subfolder_info + @" " + Resources.str_template_edit_info; labelTemplate.Text = Resources.str_subfolder_template; preset = Settings.Default.subdirTemplate;
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
case Template.FILENAME: Text = Resources.str_edit_template; labelInfo.Text = Resources.str_template_edit_filename_info + @" " + Resources.str_template_edit_info; labelTemplate.Text = Resources.str_filename_template; preset = Settings.Default.filenameTemplate;
- Read upRead up
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return 0;
Avoid too many return
statements within this method. Open
return file;