eltos/PasteIntoFile

View on GitHub

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
};
 
 
Severity: Minor
Found in PasteIntoFile/ClipboardContents.cs - About 4 hrs to fix

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;
 
 
Severity: Minor
Found in PasteIntoFile/Dialog.cs - About 3 hrs to fix

    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) {
    Severity: Minor
    Found in PasteIntoFile/Dialog.cs - About 2 hrs to fix

    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)
    Severity: Minor
    Found in PasteIntoFile/Main.cs - About 1 hr to fix

    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)) {
    Severity: Minor
    Found in PasteIntoFile/Main.cs - About 1 hr to fix

    Method updateContentPreview has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
    Open

    private void updateContentPreview() {
     
    textPreview.Hide();
    htmlPreview.Hide();
    imagePreview.Hide();
    Severity: Minor
    Found in PasteIntoFile/Dialog.cs - About 1 hr to fix

    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
    };
    Severity: Minor
    Found in PasteIntoFile/ClipboardContents.cs - About 1 hr to fix

    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;
    Severity: Minor
    Found in PasteIntoFile/TemplateEdit.cs and 1 other location - About 35 mins to fix
    PasteIntoFile/TemplateEdit.cs on lines 27..32

    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;
    Severity: Minor
    Found in PasteIntoFile/TemplateEdit.cs and 1 other location - About 35 mins to fix
    PasteIntoFile/TemplateEdit.cs on lines 33..38

    Avoid too many return statements within this method.
    Open

    return null;
    Severity: Major
    Found in PasteIntoFile/ExplorerUtil.cs - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

      return null;
      Severity: Major
      Found in PasteIntoFile/Dialog.cs - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

        return 0;
        Severity: Major
        Found in PasteIntoFile/Main.cs - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

          return file;
          Severity: Major
          Found in PasteIntoFile/Dialog.cs - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language