Skip to content

fix: refactor FindFiles in DirectoryInfoExtensions#577

Merged
ziagham merged 2 commits intoflowsynx:masterfrom
arch92:fix/570-refactor-directory-info-extensions
Oct 25, 2025
Merged

fix: refactor FindFiles in DirectoryInfoExtensions#577
ziagham merged 2 commits intoflowsynx:masterfrom
arch92:fix/570-refactor-directory-info-extensions

Conversation

@arch92
Copy link
Copy Markdown
Contributor

@arch92 arch92 commented Oct 25, 2025

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

  • Refactored FindFiles method in /plugins/FlowSynx.Plugins.LocalFileSystem/Extensions/DirectoryInfoExtensions.cs
  1. Extracted FindFiles into smaller methods.
  2. Created methods void ValidateDirectory(DirectoryInfo directoryInfo) , Regex? CreateRegex(ListParameters listParameters) and bool ShouldIncludeFile(FileInfo file, Regex? regex, ListParameters listParameters)
  3. Defined resultCount outside for each loop.

Issue reference

Closes #570

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Unit tests passing
  • End-to-end tests passing
  • Extended the documentation / Created issue in flowsynx/website#
  • Specification has been updated / Created issue in flowsynx/website#
  • Provided sample for the feature / Created issue in flowsynx/website#

@arch92 arch92 requested review from a team as code owners October 25, 2025 04:29
@arch92
Copy link
Copy Markdown
Contributor Author

arch92 commented Oct 25, 2025

Could you please add the hacktoberfest-accepted label to this PR so it counts toward Hacktoberfest?

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@ziagham ziagham merged commit 4a6f1eb into flowsynx:master Oct 25, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor DirectoryInfoExtensions.FindFiles to Reduce Cognitive Complexity

2 participants