rwbutler/IPAUploader

View on GitHub

Showing 7 of 7 total issues

Function main has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    func main() throws -> ReturnCode {
        printVersion()
        let arguments = argumentsService.processArguments(CommandLine.arguments)
        let xcode11URL = URL(fileURLWithPath: xcode11Path)
        guard argumentsService.argumentsValid(arguments),
Severity: Minor
Found in ipa-uploader-cli/main.swift - About 1 hr to fix

    Function performUpload has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private func performUpload(task uploadTask: Task, notifyOnlyOnFailure: Bool = false, verboseOnFailure: Bool = false)
            throws -> ReturnCode {
                var returnCode: ReturnCode = ReturnCode.itmsTransporterDidNotComplete
                let output = try taskService.run(task: uploadTask)
                if output.lowercased().contains("error itms") {
    Severity: Minor
    Found in ipa-uploader-cli/main.swift - About 45 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 main has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        func main() throws -> ReturnCode {
            printVersion()
            let arguments = argumentsService.processArguments(CommandLine.arguments)
            let xcode11URL = URL(fileURLWithPath: xcode11Path)
            guard argumentsService.argumentsValid(arguments),
    Severity: Minor
    Found in ipa-uploader-cli/main.swift - About 45 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 processArguments has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        func processArguments(_ arguments: [String]) -> [Argument<Any>] {
            var parsingMode: Argument<Any>.Key?
            var result: [Argument<Any>] = []
            
            for i in 1 ..< CommandLine.arguments.count {
    Severity: Minor
    Found in Services/Command Line/Implementation/CommandLineArgumentsService.swift - About 45 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

    Avoid too many return statements within this function.
    Open

                return ReturnCode.fileDoesNotExist
    Severity: Major
    Found in ipa-uploader-cli/main.swift - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return try performUpload(task: transporterTask, notifyOnlyOnFailure: notifyOnlyOnFailure,
                                           verboseOnFailure: verboseOnFailure)
      Severity: Major
      Found in ipa-uploader-cli/main.swift - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return try performUpload(task: transporterTask, notifyOnlyOnFailure: notifyOnlyOnFailure,
                                             verboseOnFailure: verboseOnFailure)
        Severity: Major
        Found in ipa-uploader-cli/main.swift - About 30 mins to fix
          Severity
          Category
          Status
          Source
          Language