Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan raises an error in line 55 but file has only 38 lines #812

Open
sergiocaserowl opened this issue Sep 9, 2024 · 2 comments
Open

Scan raises an error in line 55 but file has only 38 lines #812

sergiocaserowl opened this issue Sep 9, 2024 · 2 comments
Labels
question Further information is requested

Comments

@sergiocaserowl
Copy link

Hello!

I'm facing this issue with periphery, basically, in the analysis I see:

{
  "modifiers": [],
  "attributes": [],
  "accessibility": "internal",
  "ids": [
    "s:1118NavigationColorBarV"
  ],
  "name": "NavigationColorBar",
  "hints": [
    "unused"
  ],
  "location": "*****/utils/ViewModifiers.swift:55:8",
  "modules": [
    "******"
  ],
  "kind": "struct"
}

But... this is the file:

//
//  ViewModifiers.swift
// 
//
//  Created by **** on 27/10/22.
//

import SwiftUI

#if canImport(UIKit)
extension View {
    func hideKeyboard() {
        UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
    }
}
#endif

extension View {
    func cornerRadius(_ radius: CGFloat, corners: UIRectCorner) -> some View {
        clipShape( RoundedCorner(radius: radius, corners: corners) )
    }
}

struct RoundedCorner: Shape {
    
    var radius: CGFloat = .infinity
    var corners: UIRectCorner = .allCorners
    
    func path(in rect: CGRect) -> Path {
        let path = UIBezierPath(
            roundedRect: rect,
            byRoundingCorners: corners,
            cornerRadii: CGSize(width: radius, height: radius)
        )
        return Path(path.cgPath)
    }
}
@ileitch
Copy link
Contributor

ileitch commented Sep 15, 2024

Is this issue consistently reproduced? Does --clean-build fix it? Which file declares NavigationColorBar?

@ileitch ileitch added the question Further information is requested label Sep 15, 2024
@sergiocaserowl
Copy link
Author

Is this issue consistently reproduced? Does --clean-build fix it? Which file declares NavigationColorBar?

Hello! Sorry Github didn't notified me. If I run with --clean-build, I get the same output. I have to say I'm using periphery from sonar-apple plugin, which executes exactly this command: periphery scan --skip-build --format json --quiet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants