Showing 5 of 9 total issues
Function beginImport
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
from exportsDirectoryURL: URL,
to rootPublishSiteURL: URL,
filteringPostsWith postFilters: [PostFilter] = .default,
redirectsFormattedUsing redirectFromatter: RedirectFormatter? = nil,
importAssetsBy assetImportSetting: AssetImportSetting = .download,
Function beginImport
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
from exportsDirectoryURL: URL,
to rootPublishSiteURL: URL,
usingGenerator markdownGenerator: MarkdownGenerator =
PassthroughMarkdownGenerator.shared,
filteringPostsWith postFilters: [PostFilter] = .default,
Function writeSite
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
_ site: WordPressSite,
sectionName: String,
importing assets: [AssetImport],
to contentDirectoryURL: URL,
transformFromHTML: @escaping (String) throws -> String,
Function writeAllPosts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
fromSites sites: [SectionName: WordPressSite],
withAssets assets: [AssetImport],
inContentDirectory contentDirectoryURL: URL,
using htmlToMarkdown: @escaping (String) throws -> String,
htmlFromSitePost: ((WordPressSite) -> ((WordPressPost) -> String))? = nil
Function matchUrls
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private static func matchUrls(
in posts: [WordPressPost],
using regex: NSRegularExpression
) -> [(sourceURL: URL, post: WordPressPost)] {
posts
- 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"