weareopensource/Swift

View on GitHub

Showing 4 of 398 total issues

Function viewDidLoad has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    override func viewDidLoad() {
        self.view.setNeedsUpdateConstraints()
        // navigation
        if Metric.navigationBarTransparent == true {
            self.navigationController?.navigationBar.standardAppearance = self.transparentNavigationBar
Severity: Minor
Found in waosSwift/modules/core/controllers/CoreController.swift - About 1 hr to fix

    Function viewDidLoad has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        override func viewDidLoad() {
            self.view.setNeedsUpdateConstraints()
            // navigation
            if Metric.navigationBarTransparent == true {
                self.navigationController?.navigationBar.standardAppearance = self.transparentNavigationBar
    Severity: Minor
    Found in waosSwift/modules/core/controllers/CoreController.swift - About 35 mins to fix

    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"

    Further reading

    Function bindState has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        func bindState(_ reactor: HomeTermsReactor) {
            // pages
            reactor.state
                .map { $0.pages }
                .distinctUntilChanged()
    Severity: Minor
    Found in waosSwift/modules/home/controllers/HomeTermsController.swift - About 35 mins to fix

    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"

    Further reading

    Function bindAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        func bindAction(_ reactor: UserReactor) {
            // init
            self.rx.viewWillAppear
                .throttle(.milliseconds(Metric.timesRefreshData), latest: false, scheduler: MainScheduler.instance)
                .map { _ in Reactor.Action.get }
    Severity: Minor
    Found in waosSwift/modules/users/controllers/UserController.swift - About 25 mins to fix

    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"

    Further reading

    Severity
    Category
    Status
    Source
    Language