{"id":16087414,"url":"https://github.com/juliendelplanque/databasecritics","last_synced_at":"2026-01-17T06:54:13.475Z","repository":{"id":83914442,"uuid":"54182801","full_name":"juliendelplanque/DatabaseCritics","owner":"juliendelplanque","description":"A tool to run critics on SQL database schema dumps.","archived":false,"fork":false,"pushed_at":"2018-04-23T11:17:36.000Z","size":507,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T00:32:05.786Z","etag":null,"topics":["model-checker","moose","pharo","smalltalk"],"latest_commit_sha":null,"homepage":"","language":"Smalltalk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juliendelplanque.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":"2016-03-18T07:36:27.000Z","updated_at":"2018-10-11T14:55:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"d6d40410-5c2a-4441-b940-db5f890cc4d0","html_url":"https://github.com/juliendelplanque/DatabaseCritics","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FDatabaseCritics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FDatabaseCritics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FDatabaseCritics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliendelplanque%2FDatabaseCritics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliendelplanque","download_url":"https://codeload.github.com/juliendelplanque/DatabaseCritics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246786468,"owners_count":20833695,"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":["model-checker","moose","pharo","smalltalk"],"created_at":"2024-10-09T13:29:36.888Z","updated_at":"2026-01-17T06:54:13.458Z","avatar_url":"https://github.com/juliendelplanque.png","language":"Smalltalk","funding_links":[],"categories":[],"sub_categories":[],"readme":"Database Critics Browser\n========================\n\n# Installation\nDCB is integrated to [Myrddin](http://smalltalkhub.com/#!/~AnneEtien/Myrddin)\nbut can also be used in standalone mode.\n\n## Install in standalone mode\n~~~\nMetacello new\n    baseline: 'DatabaseCritics';\n    repository: 'github://juliendelplanque/DatabaseCritics/repository';\n    load: 'UI-standalone'.\n~~~\n\n# Use this project as a dependency\nTo use this project as a dependency of your project, simply add\nthe following code snippet to you Configuration/Baseline:\n\n~~~\nspec baseline: 'DatabaseCritics' with: [\n    spec repository: 'github://juliendelplanque/DatabaseCritics/repository' ].\n~~~\n\n# How to use this project\nThis section explains you how to check a famix model programatically using this framework.\nThe generation of the model is not the responsability of this tool. So in the\nfollowing explanations, we will assume that you generated a Famix-SQL model and\nthe variable `model` holds it.\n\n## Do a critic (Famix-SQL model checking)\nThe following code checks the model with all rules defined in the image:\n\n~~~\n\"Create the model checker.\"\nmc := DCModelChecker withAllRulesButThresholdsOn: model.\n\n\"Run rules on the entities.\"\nmc checkEntities.\n~~~\n\nIt is possible to choose the rules to apply on the model using a block:\n\n~~~\n\"Create the model checker with rules that can be applied\non FAMIXTable entities only.\"\nmc := DCModelChecker\n\ton: model\n\twithRulesSatisfying: [ :rule | rule acceptEntityClass: FAMIXTable ].\n~~~\n\nAnother way to create a model checker is to specify the rules to use\nexplicitly:\n\n~~~\nmc := DCModelChecker\n\ton: model\n\twithRules: { DCMissingPrimaryKey new . DCUnusedPrimaryKey new }.\n~~~\n\nThere are other messages defined in DCModelChecker class to instantiate it. \n\nOnce the model checker has been built, it is ready to run the rules on the\nmodel. To do that simple use `#checkEntities` message:\n\n~~~\nmc checkEntities.\n~~~\n\nAfter this message has been performed, the rules held by the model checker\nhold entities of the model that are violating them. You can access these\nrules using `rules` message:\n\n~~~\nmc rules.\n~~~\n\n## Classify the results of a critic\nOnce model's entities have been checked, it is possible to classify them\nas a tree using, eventually, multiple level of classification.\n\nThe classification method are defined as subclasses of `DCRuleClassification`\nclass. For example, if rules have to be classified according to their\ncriticity, the following code would do the job:\n\n~~~\nclassification := DCSeverityClassification rules: mc rules.\n~~~\n\nOnce the classification has been created, you can access the root of the\ntree build using `root` message:\n\n~~~\nclassification root.\n~~~\n\nThe object returned by the preceding expression is a DCRoot object, subclass\nof DCGroup object. These object are useful for results exportation which is\ndetailed later in this document.\n\n## Mark an entity as a false positive for a rule\nLet `rule` be the rule holding entities (i.e. the model checker has already\nrun this rule on the model) and `entity` be the entity that should be marked\nas a false positive. The following code mark the entity `entity` as a false\npositive for the rule `rule`:\n\n~~~\nrule addFalsePositive: entity.\n~~~\n\nFrom the moment this expressionha been performed, the entity will not appear\nin the result of `DCRule\u003e\u003eentitiesViolatingTheRuleWithoutFalsePositives`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendelplanque%2Fdatabasecritics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliendelplanque%2Fdatabasecritics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliendelplanque%2Fdatabasecritics/lists"}