{"id":25311891,"url":"https://github.com/rsvilenov/codesmellannotations","last_synced_at":"2025-10-28T16:31:00.367Z","repository":{"id":194536186,"uuid":"683422731","full_name":"rsvilenov/CodeSmellAnnotations","owner":"rsvilenov","description":"Annotate your C# codebase with attribute-based code quality remarks, which are picked up by Roslyn.","archived":false,"fork":false,"pushed_at":"2024-08-01T09:48:14.000Z","size":277,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-14T20:20:41.796Z","etag":null,"topics":["cleancode","csharp","refactoring","roslyn-analyzer"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsvilenov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-26T14:25:26.000Z","updated_at":"2024-08-01T09:47:04.000Z","dependencies_parsed_at":"2023-11-07T18:28:59.592Z","dependency_job_id":"6f4638db-39d3-4af8-ad18-60a8d59a3251","html_url":"https://github.com/rsvilenov/CodeSmellAnnotations","commit_stats":null,"previous_names":["rsvilenov/codesmellannotations"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsvilenov%2FCodeSmellAnnotations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsvilenov%2FCodeSmellAnnotations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsvilenov%2FCodeSmellAnnotations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsvilenov%2FCodeSmellAnnotations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsvilenov","download_url":"https://codeload.github.com/rsvilenov/CodeSmellAnnotations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238676995,"owners_count":19511925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cleancode","csharp","refactoring","roslyn-analyzer"],"created_at":"2025-02-13T14:55:08.375Z","updated_at":"2025-10-28T16:30:54.931Z","avatar_url":"https://github.com/rsvilenov.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeSmellAnnotations\n\n[![.NET](https://github.com/rsvilenov/CodeSmellAnnotations/actions/workflows/dotnet.yml/badge.svg)](https://github.com/rsvilenov/CodeSmellAnnotations/actions/workflows/dotnet.yml) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)  [![nuget](https://img.shields.io/nuget/v/CodeSmellAnnotations)](https://www.nuget.org/packages/CodeSmellAnnotations)\n\n## Annotate your C# codebase with attribute-based code quality remarks, which are picked up by Roslyn.\n\n\u003e netstandard2.0 compliant\n\n### Table of Contents  \n\n- [Objective](#Objective)\n- [Usage](#Usage)\n\n\n\n### Objective\n\nHow many times have we spotted a code smell but didn't have enough time to fix it right away?\nThen what do we do? Add a comment, hoping that some day we or somebody else will see this comment and get into fixing the smell? \n\nWell, that just never happens.\n\nWith this library we can add code smell annotations that will appear as warnings in our build as well as in the IDE.\nThese warnings will bug us and our collegues until someone fixes them.\n\nKey features:\n  * Attributes to annotate the code, which get picked by the compiler.\n  * A number of predefined common code smells, allowing for quick annotation of bad code.\n\n### Usage\n\n* Chose the most appropriate one of the following attributes:\n\n```csharp\n[CodeSmell(Kind.[PredefinedSmellType])]\n\n// or\n[CodeSmell(Kind.General, Reason = \"unclear intentions\")]\n\n// or\n[DuplicateOf(\"MyDoppleganger\")]\n\n// or\n[DuplicateOf(\"MyNotExactDoppleganger\", Kind = DuplicationKind.OddballSolution)]\n\n// or\n[SolidViolation(SolidPrinciple.SingleResponsibility)]\n```\n\n* Annotate the code\n```csharp\nusing CodeSmellAnnotations.Attributes;\n\npublic class StoreItem\n{\n    public string Name { get; set; }\n    \n    [CodeSmell(Kind.PrimitiveObsession, Reason = \"use a custom money class with currency info\")]\n    public decimal Price { get; set; }\n}\n```\n\n* Get a warning during build:\n\n![image info](./docs/screenshots/shot2.png)\n\n* Navigate to the annotated code by clicking on the warning above:\n\n![image info](./docs/screenshots/shot1.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsvilenov%2Fcodesmellannotations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsvilenov%2Fcodesmellannotations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsvilenov%2Fcodesmellannotations/lists"}