Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

docs: rename to DCM and update website links #1155

Merged
merged 5 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: Report an issue with Dart code metrics.
about: Report an issue with DCM.
title: "[BUG] "
labels: bug
assignees: dkrutskikh, incendial
Expand All @@ -10,7 +10,7 @@ assignees: dkrutskikh, incendial
This template is for bug reports. If you want to to ask a question, improve existing rule or suggest a new one please use another template.
-->

* **Dart code metrics version:**
* **DCM version:**
* **Dart sdk version:**

**Please show your full configuration:**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package_analyze.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Analyze project
run: dart analyze --fatal-warnings --fatal-infos .

- name: Analyze by Dart Code Metrics
- name: Analyze by DCM
uses: dart-code-checker/dart-code-metrics-action@v3.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
318 changes: 159 additions & 159 deletions CHANGELOG.md

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@

<img
src="https://raw.githubusercontent.com/dart-code-checker/dart-code-metrics/master/assets/logo.svg"
alt="Dart Code Metrics logo"
alt="DCM logo"
height="150" width="150"
align="right">

# Dart Code Metrics
# DCM

**Note: you can find [the full documentation on the website](https://dartcodemetrics.dev/docs/getting-started/introduction)**
**Note: you can find [the full documentation on the website](https://dcm.dev/individuals/docs/getting-started)**

[Configuration](https://dartcodemetrics.dev/docs/getting-started/configuration) |
[Rules](https://dartcodemetrics.dev/docs/rules) |
[Metrics](https://dartcodemetrics.dev/docs/metrics) |
[Anti-patterns](https://dartcodemetrics.dev/docs/anti-patterns/overivew)
[Configuration](https://dcm.dev/docs/individuals/configuration) |
[Rules](https://dcm.dev/docs/individuals/rules) |
[Metrics](https://dcm.dev/docs/individuals/metrics) |
[Anti-patterns](https://dcm.dev/docs/individuals/anti-patterns/overivew)

<a href="https://flutter.dev/docs/development/packages-and-plugins/favorites">
<img
Expand All @@ -29,15 +29,15 @@
align="right">
</a>

Dart Code Metrics is a static analysis tool that helps you analyse and improve your code quality.
DCM is a static analysis tool that helps you analyse and improve your code quality.

- Reports [code metrics](https://dartcodemetrics.dev/docs/metrics)
- Provides [additional rules](https://dartcodemetrics.dev/docs/rules) for the dart analyzer
- Checks for [anti-patterns](https://dartcodemetrics.dev/docs/anti-patterns)
- Checks [unused `*.dart` files](https://dartcodemetrics.dev/docs/cli/check-unused-files)
- Checks [unused l10n](https://dartcodemetrics.dev/docs/cli/check-unused-l10n)
- Checks [unnecessary nullable parameters](https://dartcodemetrics.dev/docs/cli/check-unnecessary-nullable)
- Can be used as [CLI](https://dartcodemetrics.dev/docs/cli), [analyzer plugin](https://dartcodemetrics.dev/docs/analyzer-plugin) or [library](https://dartcodemetrics.dev/docs/getting-started/installation#library)
- Reports [code metrics](https://dcm.dev/docs/individuals/metrics)
- Provides [additional rules](https://dcm.dev/individuals/docs/rules) for the dart analyzer
- Checks for [anti-patterns](https://dcm.dev/docs/individuals/anti-patterns)
- Checks [unused `*.dart` files](https://dcm.dev/docs/individuals/cli/check-unused-files)
- Checks [unused l10n](https://dcm.dev/docs/individuals/cli/check-unused-l10n)
- Checks [unnecessary nullable parameters](https://dcm.dev/docs/individuals/cli/check-unnecessary-nullable)
- Can be used as [CLI](https://dcm.dev/docs/individuals/cli), [analyzer plugin](https://dcm.dev/docs/individuals/analyzer-plugin) or [library](https://dcm.dev/docs/individuals/getting-started/#library)

## Links

Expand Down Expand Up @@ -99,13 +99,13 @@ dart_code_metrics:

Reload IDE to allow the analyzer to discover the plugin config.

You can read more about the configuration [on the website](https://dartcodemetrics.dev/docs/getting-started/configuration).
You can read more about the configuration [on the website](https://dcm.dev/docs/individuals/configuration).

## Usage

### Analyzer plugin

Dart Code Metrics can be used as a plugin for the Dart `analyzer` [package](https://pub.dev/packages/analyzer) providing additional rules. All issues produced by rules or anti-patterns will be highlighted in IDE.
DCM can be used as a plugin for the Dart `analyzer` [package](https://pub.dev/packages/analyzer) providing additional rules. All issues produced by rules or anti-patterns will be highlighted in IDE.

![Highlighted issue example](https://raw.githubusercontent.com/dart-code-checker/dart-code-metrics/master/assets/plugin-example.png)

Expand All @@ -127,7 +127,7 @@ The package can be used as CLI and supports multiple commands:

For additional help on any of the commands, enter `dart run dart_code_metrics:metrics help <command>`

**Note:** if you're setting up Dart Code Metrics for multi-package repository, check out [this website section](https://dartcodemetrics.dev/docs/cli#multi-package-repositories-usage).
**Note:** if you're setting up DCM for multi-package repository, check out [this website section](https://dcm.dev/docs/individuals/cli#multi-package-repositories-usage).

#### Analyze

Expand Down Expand Up @@ -261,16 +261,16 @@ If you are interested in contributing, please check out the [contribution guidel

### En

- [Finding Unused Files With Dart Code Metrics](https://medium.com/wriketechclub/finding-unused-files-with-dart-code-metrics-b9aba48ad7ca) - This article considers one of the first commands, checking unused Dart files, by [Dmitry Zhifarsky](https://github.com/incendial)
- [Improving Code Quality With Dart Code Metrics](https://medium.com/wriketechclub/improving-code-quality-with-dart-code-metrics-430a5e3e316d) - Advantages of using Dart Code Metrics, by [Dmitry Zhifarsky](https://github.com/incendial)
- [Finding Unused Files With DCM](https://medium.com/wriketechclub/finding-unused-files-with-dart-code-metrics-b9aba48ad7ca) - This article considers one of the first commands, checking unused Dart files, by [Dmitry Zhifarsky](https://github.com/incendial)
- [Improving Code Quality With DCM](https://medium.com/wriketechclub/improving-code-quality-with-dart-code-metrics-430a5e3e316d) - Advantages of using DCM, by [Dmitry Zhifarsky](https://github.com/incendial)
- [Creating a Custom Plugin for Dart Analyzer](https://medium.com/wriketechclub/creating-a-custom-plugin-for-dart-analyzer-48b76d81a239) - How to develop a custom Dart code analyzer plugin, by [Dmitry Zhifarsky](https://github.com/incendial)
- [Flutter Static Analysis, Dart Code Metrics](https://fredgrott.medium.com/flutter-static-analysis-dart-code-metrics-c9ec484f4e0f) - How to install the dart_code-metrics plugin and effectively use it to analyze dart code, by [Fred Grott](https://github.com/fredgrott)
- [Flutter Static Analysis, DCM](https://fredgrott.medium.com/flutter-static-analysis-dart-code-metrics-c9ec484f4e0f) - How to install the dart_code-metrics plugin and effectively use it to analyze dart code, by [Fred Grott](https://github.com/fredgrott)

### Ru

- [Повышаем качество кода с Dart Code Metrics](https://habr.com/ru/company/wrike/blog/552012/) - Преимущества использования Dart Code Metrics, от [Dmitry Zhifarsky](https://github.com/incendial)
- [Повышаем качество кода с DCM](https://habr.com/ru/company/wrike/blog/552012/) - Преимущества использования DCM, от [Dmitry Zhifarsky](https://github.com/incendial)
- [Как создать кастомный плагин для Dart-анализатора](https://habr.com/ru/company/wrike/blog/541672/) - Описан процесс создания плагина для анализатора кода, от [Dmitry Zhifarsky](https://github.com/incendial)
- [Dart Code Metrics — мой первый pull request](https://habr.com/ru/post/592131/) - Инструкция по созданию нового правила, от [Vlad Konoshenko](https://github.com/Konoshenko)
- [DCM — мой первый pull request](https://habr.com/ru/post/592131/) - Инструкция по созданию нового правила, от [Vlad Konoshenko](https://github.com/Konoshenko)

## How to reach us

Expand Down
14 changes: 4 additions & 10 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
# Examples

Dart Code Metrics is a static analysis tool and code from it is not expected to be used directly. Instead, it should be added as a dev dependency and installed [as described here](https://dartcodemetrics.dev/docs/getting-started/installation).
DCM is a static analysis tool and code from it is not expected to be used directly. Instead, it should be added as a dev dependency and installed [as described here](https://dcm.dev/docs/individuals/getting-started).

## Plugin and CLI

To use Dart Code Metrics as a plugin or a CLI, check out [this repository](https://github.com/dart-code-checker/dart-code-metrics-example) with the example Flutter app. It covers DCM setup and shows all commands output.
To use DCM as a plugin or a CLI, check out [this repository](https://github.com/dart-code-checker/dart-code-metrics-example) with the example Flutter app. It covers DCM setup and shows all commands output.

## As a library

Dart Code Metrics can be used as a library, imported and called directly from your code. Continue with [this example](https://github.com/dart-code-checker/dart-code-metrics/blob/master/example/lib/main.dart) in order to get more details.
DCM can be used as a library, imported and called directly from your code. Continue with [this example](https://github.com/dart-code-checker/dart-code-metrics/blob/master/example/lib/main.dart) in order to get more details.

## Presets

Dart Code Metrics supports presets:

- all Dart rules [dart_all.yaml](https://github.com/dart-code-checker/dart-code-metrics/blob/master/lib/presets/dart_all.yaml)
- all Flutter rules [flutter_all.yaml](https://github.com/dart-code-checker/dart-code-metrics/blob/master/lib/presets/flutter_all.yaml)
- all rules [all.yaml](https://github.com/dart-code-checker/dart-code-metrics/blob/master/lib/presets/all.yaml)

Presets can be enabled with `extends` config, more details [can be found here](https://dartcodemetrics.dev/docs/getting-started/configuration#extending-an-existing-configuration-preset).
Presets can be enabled with `extends` config, more details [can be found here](https://dcm.dev/docs/individuals/configuration/presets/).
2 changes: 1 addition & 1 deletion lib/src/analyzer_plugin/analyzer_plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AnalyzerPlugin extends ServerPlugin {
List<String> get fileGlobsToAnalyze => const ['*.dart', '*.yaml'];

@override
String get name => 'Dart Code Metrics $packageVersion';
String get name => 'DCM $packageVersion';

@override
String get version => '1.0.0-alpha.0';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ Issue createIssue({
/// Returns a url of a page containing documentation associated with [pattern]
Uri documentation(Pattern pattern) => Uri(
scheme: 'https',
host: 'dartcodemetrics.dev',
host: 'dcm.dev',
pathSegments: [
'docs',
'individuals',
'anti-patterns',
pattern.id,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class LintAnalysisOptionsValidator {
severity: Severity.warning,
message:
"'${rule.ruleName}' is not recognized as a valid rule name.",
documentation: Uri.parse('https://dartcodemetrics.dev/docs/rules'),
documentation: Uri.parse('https://dcm.dev/docs/individuals/rules'),
location: _copySpanWithOffset(rule.span),
),
);
Expand All @@ -132,7 +132,7 @@ class LintAnalysisOptionsValidator {
severity: Severity.warning,
message:
"'${rule.ruleName}' requires a config to produce any diagnostics.",
documentation: Uri.parse('https://dartcodemetrics.dev/docs/rules'),
documentation: Uri.parse('https://dcm.dev/docs/individuals/rules'),
location: _copySpanWithOffset(rule.span),
),
);
Expand Down
3 changes: 2 additions & 1 deletion lib/src/analyzers/lint_analyzer/metrics/metric_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import 'models/metric_value_level.dart';
/// Returns the url of a page containing documentation associated with [metricId]
Uri documentation(String metricId) => Uri(
scheme: 'https',
host: 'dartcodemetrics.dev',
host: 'dcm.dev',
pathSegments: [
'docs',
'individuals',
'metrics',
metricId,
],
Expand Down
3 changes: 2 additions & 1 deletion lib/src/analyzers/lint_analyzer/rules/rule_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ Issue createIssue({
/// Returns a url of a page containing documentation associated with [rule]
Uri documentation(Rule rule) => Uri(
scheme: 'https',
host: 'dartcodemetrics.dev',
host: 'dcm.dev',
pathSegments: [
'docs',
'individuals',
'rules',
rule.type.value,
rule.id,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/cli/cli_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CliRunner extends CommandRunner<void> {
final showVersion = results[FlagNames.version] as bool;

if (showVersion) {
_logger.info('Dart Code Metrics version: $packageVersion');
_logger.info('DCM version: $packageVersion');

return;
}
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: dart_code_metrics
version: 5.4.0
description: Software analytics tool that helps developers analyse and improve software quality.
homepage: https://dartcodemetrics.dev
homepage: https://dcm.dev
repository: https://github.com/dart-code-checker/dart-code-metrics
issue_tracker: https://github.com/dart-code-checker/dart-code-metrics/issues
documentation: https://dartcodemetrics.dev/docs/getting-started/introduction
documentation: https://dcm.dev/docs/individuals/getting-started/introduction

environment:
sdk: ">=2.18.0 <3.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
() {
const id = 'pattern-id';
final documentationUrl = Uri.parse(
'https://dartcodemetrics.dev/docs/anti-patterns/pattern-id',
'https://dcm.dev/docs/individuals/anti-patterns/pattern-id',
);
const severity = Severity.none;

Expand Down Expand Up @@ -65,7 +65,7 @@ void main() {
expect(
documentation(pattern1).toString(),
equals(
'https://dartcodemetrics.dev/docs/anti-patterns/$patternId1',
'https://dcm.dev/docs/individuals/anti-patterns/$patternId1',
),
);
expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main() {
expect(
documentation(metricId1).toString(),
equals(
'https://dartcodemetrics.dev/docs/metrics/metric-id-1',
'https://dcm.dev/docs/individuals/metrics/metric-id-1',
),
);
expect(
Expand Down
Loading