Repository Analysis

realm/SwiftLint

A tool to enforce Swift style and conventions.

2.8 Likely human-written View on GitHub
2.8
Adjusted Score
2.8
Raw Score
100%
Time Factor
2026-05-29
Last Push
19,590
Stars
Swift
Language
105,166
Lines of Code
900
Files
99
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 50MEDIUM 0LOW 49

Pattern Findings

99 matches across 2 categories. Click a row to expand file-level details.

Cross-File Repetition50 hits · 250 pts
SeverityFileLineSnippet
HIGH…les/Lint/PrivateSwiftUIStatePropertyRuleExamples.swift0struct contentview: view { @state private var isplaying: bool = false }
HIGH…les/Lint/PrivateSwiftUIStatePropertyRuleExamples.swift0struct contentview: view { @state private var isplaying: bool = false }
HIGH…les/Lint/PrivateSwiftUIStatePropertyRuleExamples.swift0struct contentview: view { @state private var isplaying: bool = false }
HIGH…uiltInRules/Rules/Style/OpeningBraceRuleExamples.swift0if vardecl.parent?.is(codeblockitemsyntax.self) == true // local variable declaration || vardecl.bindings.onlyelement?.a
HIGH…uiltInRules/Rules/Style/OpeningBraceRuleExamples.swift0if vardecl.parent?.is(codeblockitemsyntax.self) == true // local variable declaration || vardecl.bindings.onlyelement?.a
HIGH…s/Rules/Style/ContrastedOpeningBraceRuleExamples.swift0if vardecl.parent?.is(codeblockitemsyntax.self) == true // local variable declaration || vardecl.bindings.onlyelement?.a
HIGH…s/Rules/Style/ContrastedOpeningBraceRuleExamples.swift0if vardecl.parent?.is(codeblockitemsyntax.self) == true // local variable declaration || vardecl.bindings.onlyelement?.a
HIGH…uiltInRules/Rules/Style/OpeningBraceRuleExamples.swift0func foo() { if q1, q2 { do1() } else if q3, q4 { do2() } }
HIGH…uiltInRules/Rules/Style/OpeningBraceRuleExamples.swift0func foo() { if q1, q2 { do1() } else if q3, q4 { do2() } }
HIGH…s/Rules/Style/ContrastedOpeningBraceRuleExamples.swift0func foo() { if q1, q2 { do1() } else if q3, q4 { do2() } }
HIGH…s/Rules/Style/ContrastedOpeningBraceRuleExamples.swift0func foo() { if q1, q2 { do1() } else if q3, q4 { do2() } }
HIGH…BuiltInRules/Rules/Style/SwitchCaseAlignmentRule.swift0switch i { \(violationmarker)case .x: 1 \(violationmarker)default: 0 }
HIGH…BuiltInRules/Rules/Style/SwitchCaseAlignmentRule.swift0switch i { \(violationmarker)case .x: 1 \(violationmarker)default: 0 }
HIGH…BuiltInRules/Rules/Style/SwitchCaseAlignmentRule.swift0switch i { \(violationmarker)case .x: 1 \(violationmarker)default: 0 }
HIGH…s/Rules/Style/FunctionNameWhitespaceRuleExamples.swift0func foo< t >( param1: int, param2: bool, param3: [string] ) { }
HIGH…s/Rules/Style/FunctionNameWhitespaceRuleExamples.swift0func foo< t >( param1: int, param2: bool, param3: [string] ) { }
HIGH…s/Rules/Style/FunctionNameWhitespaceRuleExamples.swift0func foo< t >( param1: int, param2: bool, param3: [string] ) { }
HIGH…s/Rules/Style/FunctionNameWhitespaceRuleExamples.swift0func foo < t > ( param1: int, param2: bool, param3: [string] ) { }
HIGH…s/Rules/Style/FunctionNameWhitespaceRuleExamples.swift0func foo < t > ( param1: int, param2: bool, param3: [string] ) { }
HIGH…s/Rules/Style/FunctionNameWhitespaceRuleExamples.swift0func foo < t > ( param1: int, param2: bool, param3: [string] ) { }
HIGH…s/Rules/Style/FunctionNameWhitespaceRuleExamples.swift0func foo < t > ( param1: int, param2: bool, param3: [string] ) { }
HIGH…s/Rules/Style/FunctionNameWhitespaceRuleExamples.swift0func foo < t > ( param1: int, param2: bool, param3: [string] ) { }
HIGH…es/Rules/Style/ClosureEndIndentationRuleExamples.swift0function( closure: { x in print(x) }, anotherclosure: { y in print(y) })
HIGH…es/Rules/Style/ClosureEndIndentationRuleExamples.swift0function( closure: { x in print(x) }, anotherclosure: { y in print(y) })
HIGH…es/Rules/Style/ClosureEndIndentationRuleExamples.swift0function( closure: { x in print(x) }, anotherclosure: { y in print(y) })
HIGH…iltInRules/Rules/Style/SortedImportsRuleExamples.swift0// header import ddd import sss // some comment import fff // a comment
HIGH…iltInRules/Rules/Style/SortedImportsRuleExamples.swift0// header import ddd import sss // some comment import fff // a comment
HIGH…iltInRules/Rules/Style/SortedImportsRuleExamples.swift0// header import ddd import sss // some comment import fff // a comment
HIGH…Style/VerticalWhitespaceBetweenCasesRuleExamples.swift0switch x { case .a: print("a") #if debug case .b: print("b") #endif case .c: print("c") }
HIGH…Style/VerticalWhitespaceBetweenCasesRuleExamples.swift0switch x { case .a: print("a") #if debug case .b: print("b") #endif case .c: print("c") }
HIGH…Style/VerticalWhitespaceBetweenCasesRuleExamples.swift0switch x { case .a: print("a") #if debug case .b: print("b") #endif case .c: print("c") }
HIGH…les/Rules/Idiomatic/RedundantStringEnumValueRule.swift0enum numbers: string { case one = "one" case two = "two" }
HIGH…les/Rules/Idiomatic/RedundantStringEnumValueRule.swift0enum numbers: string { case one = "one" case two = "two" }
HIGH…InRules/Rules/Idiomatic/ExplicitEnumRawValueRule.swift0enum numbers: string { case one = "one" case two = "two" }
HIGH…les/Idiomatic/RedundantObjcAttributeRuleExamples.swift0@objc extension foo { ↓@objc private var bar: int { return 0 } }
HIGH…les/Idiomatic/RedundantObjcAttributeRuleExamples.swift0@objc extension foo { ↓@objc private var bar: int { return 0 } }
HIGH…les/Idiomatic/RedundantObjcAttributeRuleExamples.swift0@objc extension foo { ↓@objc private var bar: int { return 0 } }
HIGH…ules/Rules/Idiomatic/RedundantTypeAnnotationRule.swift0class viewcontroller: uiviewcontroller { func somemethod() { let myvar↓: int = int(5) } }
HIGH…ules/Rules/Idiomatic/RedundantTypeAnnotationRule.swift0class viewcontroller: uiviewcontroller { func somemethod() { let myvar↓: int = int(5) } }
HIGH…ules/Rules/Idiomatic/RedundantTypeAnnotationRule.swift0class viewcontroller: uiviewcontroller { func somemethod() { let myvar↓: int = int(5) } }
HIGHTests/FrameworkTests/ModifierOrderTests.swift0@mainactor class foo { nonisolated public func bar() {} }
HIGHTests/FrameworkTests/ModifierOrderTests.swift0@mainactor class foo { nonisolated public func bar() {} }
HIGHTests/FrameworkTests/ModifierOrderTests.swift0@mainactor class foo { nonisolated public func bar() {} }
HIGHTests/FrameworkTests/ModifierOrderTests.swift0@mainactor class foo { nonisolated public func bar() {} }
HIGHTests/FrameworkTests/ModifierOrderTests.swift0@mainactor class foo { public nonisolated func bar() {} }
HIGHTests/FrameworkTests/ModifierOrderTests.swift0@mainactor class foo { public nonisolated func bar() {} }
HIGHTests/FrameworkTests/ModifierOrderTests.swift0@mainactor class foo { public nonisolated func bar() {} }
HIGHTests/MacroTests/SwiftSyntaxRuleTests.swift0struct hello {} extension hello: swiftsyntaxrule { func makevisitor(file: swiftlintfile) -> violationssyntaxvisitor<conf
HIGHTests/MacroTests/SwiftSyntaxRuleTests.swift0struct hello {} extension hello: swiftsyntaxrule { func makevisitor(file: swiftlintfile) -> violationssyntaxvisitor<conf
HIGHTests/MacroTests/SwiftSyntaxRuleTests.swift0struct hello {} extension hello: swiftsyntaxrule { func makevisitor(file: swiftlintfile) -> violationssyntaxvisitor<conf
Over-Commented Block49 hits · 49 pts
SeverityFileLineSnippet
LOW…wiftLintBuildToolPlugin/SwiftLintBuildToolPlugin.swift21 }
LOWSource/SwiftLintCore/Models/RuleDescription.swift21
LOWSource/SwiftLintCore/Models/RuleDescription.swift41 public let triggeringExamples: [Example]
LOWSource/SwiftLintCore/Models/RuleDescription.swift81 ///
LOW…wiftLintCore/Models/RuleConfigurationDescription.swift281infix operator =>: MultiplicationPrecedence
LOW…wiftLintCore/Models/RuleConfigurationDescription.swift321
LOW…wiftLintCore/Models/RuleConfigurationDescription.swift361/// absolutely clear that there is an error in the YAML configuration passed in. Since it may be used in a nested
LOW…wiftLintCore/Models/RuleConfigurationDescription.swift381/// ```
LOW…wiftLintCore/Models/RuleConfigurationDescription.swift401/// will have a nested configuration section:
LOW…wiftLintCore/Models/RuleConfigurationDescription.swift481 /// It allows to skip explicit initialization of the property with `nil`.
LOWSource/SwiftLintCore/Models/Example.swift1import Foundation
LOWSource/SwiftLintCore/Models/Example.swift21 /// - SeeAlso: addEmoji(_:)
LOWSource/SwiftLintCore/Models/Example.swift41 /// why a rule is applied and where not. Complex examples with rarely used language constructs or
LOWSource/SwiftLintCore/Models/Region.swift1import SwiftSyntax
LOWSource/SwiftLintCore/Models/Region.swift41 }
LOWSource/SwiftLintCore/Models/AccessControlLevel.swift1/// The accessibility of a Swift source declaration.
LOWSource/SwiftLintCore/Extensions/Array+SwiftLint.swift121 ///
LOW…urce/SwiftLintCore/Extensions/Collection+Windows.swift1// swiftlint:disable:next blanket_disable_command
LOW…urce/SwiftLintCore/Extensions/Collection+Windows.swift21 /// Returns a collection of all the overlapping slices of a given size.
LOW…urce/SwiftLintCore/Extensions/Collection+Windows.swift161 // `endIndex` and the index before it both have `base.endIndex` as their
LOW…tLintCore/Extensions/SwiftLintFile+BodyLineCount.swift1import SwiftSyntax
LOW…tLintCore/Extensions/SwiftLintFile+BodyLineCount.swift21 //
LOW…Core/Extensions/RandomAccessCollection+Swiftlint.swift1public extension RandomAccessCollection where Index == Int {
LOW…Core/Extensions/RandomAccessCollection+Swiftlint.swift21 /// - complexity: O(log(*n*)), where *n* is the length of the collection.
LOWSource/SwiftLintCore/Protocols/CollectingRule.swift1/// Type-erased protocol used to check whether a rule is collectable.
LOWSource/SwiftLintCore/Protocols/CollectingRule.swift21 /// - returns: The collected file information.
LOWSource/SwiftLintCore/Protocols/Rule.swift21 /// Creates a rule by applying its configuration.
LOWSource/SwiftLintCore/Protocols/Rule.swift41 func validate(file: SwiftLintFile, compilerArguments: [String]) -> [StyleViolation]
LOWSource/SwiftLintCore/Protocols/Rule.swift61 /// - parameter file: The file for which to collect info.
LOWSource/SwiftLintCore/Protocols/Rule.swift81 /// - Parameters:
LOWSource/SwiftLintCore/Protocols/Rule.swift161public extension Rule {
LOWSource/SwiftLintCore/Protocols/Rule.swift181 /// - parameter file: The file for which to correct violations.
LOWSource/SwiftLintCore/Protocols/SwiftSyntaxRule.swift1import SwiftSyntax
LOWSource/SwiftLintCore/Protocols/SwiftSyntaxRule.swift81/// A violation produced by `ViolationsSyntaxVisitor`s.
LOWSource/SwiftLintCore/Protocols/SwiftSyntaxRule.swift101 self.replacement = replacement
LOWSource/SwiftLintCore/Protocols/ASTRule.swift1import SourceKittenFramework
LOWSource/SwiftLintCore/Protocols/ASTRule.swift21 /// - parameter dictionary: The `SourceKittenDictionary` representing the source structure from which to extract the
LOW…iltInRules/Rules/Lint/MultilineCallArgumentsRule.swift181private extension FunctionCallExprSyntax {
LOW…LintBuiltInRules/Rules/Lint/RequiredEnumCaseRule.swift1import SwiftSyntax
LOW…LintBuiltInRules/Rules/Lint/RequiredEnumCaseRule.swift21/// ...
LOW…LintBuiltInRules/Rules/Lint/RequiredEnumCaseRule.swift41///
LOW…les/Idiomatic/UnneededSynthesizedInitializerRule.swift1// swiftlint:disable file_header
LOW…ltInRules/Rules/Idiomatic/XCTSpecificMatcherRule.swift141 //
LOWSource/SwiftLintFramework/UpdateChecker.swift1// swiftlint:disable file_header
LOW…e/SwiftLintFramework/Configuration/Configuration.swift141 /// - parameter includedPaths: Included paths to lint.
LOW…e/SwiftLintFramework/Configuration/Configuration.swift201 checkForUpdates: checkForUpdates
LOW…ftLintFramework/Extensions/FileManager+SwiftLint.swift1import FilenameMatcher
LOWSource/SwiftLintExtraRules/ExtraRules.swift1// DO NOT EDIT
LOWTests/FrameworkTests/Resources/test.txt1// My file with