pana library

Classes

CodeProblem
ComponentDef
ComponentNames
ConstraintTypes
DartdocResult
DartFileSummary
DartPlatform
DartSdkInfo
DependencyTypes
Health
InspectOptions
LicenseFile
LicenseNames
Maintenance
Describes the maintenance status of the package.
Outdated
The json output from pub outdated --json.
OutdatedPackage
PackageAnalyzer
PackageLocation
PanaRuntimeInfo
PkgDependency
PkgResolution
PlatformDef
PlatformNames
PubEntry
Pubspec
Report
Models the 'new-style' pana report.
ReportSection
SdkConstraintStatus
Detailed support coverage for the SDK constraint.
Stats
Suggestion
SuggestionCode
SuggestionLevel
Summary
ToolEnvironment
UrlChecker
VersionDescriptor

Constants

currentAnalysisOptionsFileName → const String
'analysis_options.yaml'
documentationSectionTitle → const String
'Provide documentation'
healthErrorMultiplier → const double
NOTE: In case these change, update README.md
0.75
healthHintMultiplier → const double
0.995
healthWarningMultiplier → const double
0.95
packageVersion → const String
'0.13.16'

Properties

analysisOptionsFiles List<String>
final
changelogFileNames List<String>
final
exampleReadmeFileNames List<String>
final
imageExtensions Set<String>
final
readmeFileNames List<String>
final

Functions

byteStreamSplit(Stream<List<int>> stream) Stream<String>
calcHealth({Pubspec pubspec, bool analyzeProcessFailed, bool formatProcessFailed, bool resolveProcessFailed, List<CodeProblem> analyzerItems, Iterable<DartFileSummary> dartFileSummaries}) Health
Extracts and summarizes the output of dartanalyzer and dartfmt.
calculateBaseHealth(int analyzerErrorCount, int analyzerWarningCount, int analyzerHintCount) double
Returns the part of the health score that is calculated from the number of dartanalyzer items. Other penalties will be deduced from this base score (e.g. platform conflict, dartdoc coverage).
calculateMaintenanceScore(Maintenance maintenance, {Duration age}) double
Calculates the maintenance score in the range of 0.0 - 1.0.
classifyLibPlatform(Iterable<String> dependencies) DartPlatform
classifyPkgPlatform(Pubspec pubspec, Map<String, List<String>> transitiveLibs) DartPlatform
createPkgResolution(Pubspec pubspec, String procStdout, {String path}) PkgResolution
dartdocFailedSection([DartdocResult result]) ReportSection
Creates a report section when running dartdoc failed to produce content.
detectLicenseInContent(String originalContent, {String relativePath}) LicenseFile
detectLicenseInFile(File file, {String relativePath}) Future<LicenseFile>
detectLicensesInDir(String baseDir) Future<List<LicenseFile>>
detectMaintenance(InspectOptions options, UrlChecker urlChecker, String pkgDir, Pubspec pubspec, List<PkgDependency> unconstrainedDeps, {PkgResolution pkgResolution, List<String> tags, bool dartdocSuccessful}) Future<Maintenance>
Creates Maintenance with suggestions. [...]
documentationCoverageSection({int documented, int total}) ReportSection
Creates a report section about documentation coverage. 20% coverage grants the maximum number of points.
downloadPackage(String package, String version, {String destination, String pubHostedUrl}) Future<void>
Downloads package and unpacks it into destination
exampleFileCandidates(String package, {bool caseSensitive: false}) List<String>
Returns the candidates in priority order to display under the 'Example' tab.
extractTarGz(List<int> tarball, String destination) Future
Extracts a .tar.gz file from tarball to destination.
fileSize(String packageDir, String relativePath) int
firstFileFromNames(List<String> files, List<String> names, {bool caseSensitive: false}) String
getAgeSuggestion(Duration age) Suggestion
getDartdocRunFailedSuggestion([DartdocResult result]) Suggestion
getDartdocSuggestions(DartdocResult result) List<Suggestion>
getMaintenanceScore(Maintenance maintenance, {Duration age}) double
Calculates the maintenance score in the range of 0.0 - 100.0.
getPubspecContent(String packagePath) String
If no pubspec.yaml file exists, null is returned.
getRepositoryUrl(String repository, String relativePath) String
Returns an URL that is likely the downloadable URL of the given path.
getSignals() Stream<ProcessSignal>
A merged stream of all signals that tell the test runner to shut down gracefully. [...]
handleProcessErrors(ProcessResult result) ProcessResult
listFiles(String directory, {String endsWith, bool deleteBadExtracted: false}) Stream<String>
listFocusDirs(String packageDir) Future<List<String>>
Returns the list of directories to focus on (e.g. bin, lib) - if they exist.
nonAsciiRuneRatio(String text) double
Returns the ratio of non-ASCII runes (Unicode characters) in a given text: (number of runes that are non-ASCII) / (total number of character runes). [...]
parseCodeProblem(String content, {String projectDir}) CodeProblem
prettyJson(dynamic obj) String
pubspecParseError(dynamic error) Suggestion
Returns a suggestion for pubspec.yaml parse error.
retryProc(Future<ProcessResult> body(), {bool shouldRetry(ProcessResult pr): _defaultShouldRetry, int maxAttempt: 3, Duration sleep: const Duration(seconds: 1)}) Future<ProcessResult>
Executes body and returns with the first clean or the last failure result.
runProc(String executable, List<String> arguments, {String workingDirectory, Map<String, String> environment, Duration timeout, bool deduplicate: false}) Future<ProcessResult>
runProcSync(String executable, List<String> arguments, {String workingDirectory, Map<String, String> environment}) ProcessResult
sortedJson(dynamic obj) Object
textFileNameCandidates(String base) List<String>
Returns common file name candidates for base (specified without any extension).
toPackageUri(String package, String relativePath) String
toRelativePath(String packageUri) String
updateLicenseUrls(UrlChecker urlChecker, String baseUrl, List<LicenseFile> licenses) Future<List<LicenseFile>>
withTempDir<T>(FutureOr<T> fn(String path)) Future<T>
Creates a temporary directory and passes its path to fn. [...]
yamlToJson(String yamlContent) Map<String, Object>

Enums

PlatformUse
UrlStatus
Verbosity
VersionResolutionType

Exceptions / Errors

ToolException