{"id":17210988,"url":"https://github.com/arturbosch/jquality","last_synced_at":"2025-04-13T22:40:32.252Z","repository":{"id":114468502,"uuid":"70398110","full_name":"arturbosch/jquality","owner":"arturbosch","description":"Static code analysis for Java","archived":false,"fork":false,"pushed_at":"2021-11-09T17:24:06.000Z","size":1033,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-05T22:58:30.456Z","etag":null,"topics":["analysis","badsmells","code","codesmells","groovy","java","javaparser","static"],"latest_commit_sha":null,"homepage":"","language":"Groovy","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/arturbosch.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}},"created_at":"2016-10-09T11:16:58.000Z","updated_at":"2024-04-15T09:56:27.274Z","dependencies_parsed_at":"2023-04-19T06:47:44.008Z","dependency_job_id":null,"html_url":"https://github.com/arturbosch/jquality","commit_stats":null,"previous_names":[],"tags_count":12,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturbosch%2Fjquality","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturbosch%2Fjquality/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturbosch%2Fjquality/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturbosch%2Fjquality/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arturbosch","download_url":"https://codeload.github.com/arturbosch/jquality/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794082,"owners_count":21162610,"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":["analysis","badsmells","code","codesmells","groovy","java","javaparser","static"],"created_at":"2024-10-15T02:55:56.727Z","updated_at":"2025-04-13T22:40:32.212Z","avatar_url":"https://github.com/arturbosch.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jquality\n\n[![build status](https://gitlab.com/arturbosch/SmartSmells/badges/master/build.svg)](https://gitlab.com/arturbosch/SmartSmells/commits/master)\n[![CodeFactor](https://www.codefactor.io/repository/github/arturbosch/jquality/badge/master)](https://www.codefactor.io/repository/github/arturbosch/jquality/overview/master)\n[![Download](https://api.bintray.com/packages/arturbosch/code-analysis/jquality/images/download.svg) ](https://bintray.com/arturbosch/code-analysis/jquality/_latestVersion)\n\n### Info\n\njquality is a code smell detector for java powered by javaparser.\nCurrent found smells are:\n\n- BrainMethod\n- ClassDataShouldBePrivate\n- CommentSmell/Javadoc\n- ComplexCondition\n- ComplexMethod\n- Cycle\n- DataClass\n- Deadcode\n- FeatureEnvy\n- GodClass\n- LargeClass\n- LongMethod\n- LongParameterList\n- MessageChain\n- MiddleMan\n- NestedBlockDepth\n- RefusedParentBequest\n- ShotgunSurgery\n- StateChecking\n- TraditionBreaker\n\n### Installation\n\n- cd [repos]/jquality\n- gradle build to verify compilation and that all tests run\n- gradle shadowJar to build an executable jar\n\n### Usage\n\n#### Using the commandline jar\n\n```\nUsage: jquality [options]\n  Options:\n    --config, -c\n      Point to your configuration file. Supported formats are YAML and GROOVY. \n      Take a look at default-config.[yml|groovy]\n    --filters, -f\n      Regex expressions, separated by a comma to specify path filters eg. \n      '.*/test/.*' \n    --fullStack, --fullstack, -fs\n      Use all available detectors with default thresholds.\n    --help, -h\n      Shows this help message.\n      Default: false\n    --input, -i\n      Specify a path where your project is located for the analysis.\n    --metrics, -m\n      Additionally runs the metric facade, printing the means for configured \n      metrics. \n      Default: false\n    --output, -o\n      Point to a path where the xml output file with the detection result \n      should be saved.\n```\n\n1. with groovy configuration\n\n`java -jar jquality-[version]-all.jar --groovy-config /path/to/groovy/config`\n\nTake a look at the default-config.groovy file in this repository.\n\n2. with yaml configuration and arguments\n\n`java -jar jquality-[version]-all.jar --input /path/to/project [--output /path/to/output/xml] --config /path/to/yaml/config [--filters .*/test/.*]`\n\nTake a look at the default-config.yaml file in this repository.\n\nLoading detectors from configuration file cannot be used together with --fullStack mode. Config comes first.\n\n3. without configurations\n\n`java -jar jquality-[version]-all.jar --fullstack --input /path/to/project [--output /path/to/output/xml] [--filters .*/test/.*]`\n\n\n##### Filters\nFilters can help you sort out paths which are not relevant for your project eg. test data. \n\nIt is recommended to filter test cases in your analysis. Test code differs too much from production code.\nFor example feature envy is present in every test method as test cases should be isolated and \nunderstandable by itself with minimum cohesion. \nTests have other kinds of code smells which are not supported by jquality.\n\n#### As Gradle task\n\nAdd following lines to your `build.gradle` file to create a `gradle jquality` task which can be executed from the console.\n\n```groovy\nrepositories {\n    maven {\n        url  \"http://dl.bintray.com/arturbosch/code-analysis\"\n    }\n}\n\nconfigurations {\n    jquality\n}\n\ntask jquality(type: JavaExec) {\n    main = \"io.gitlab.arturbosch.smartsmells.Main\"\n    classpath = configurations.jquality\n    def input = \"$project.projectDir.absolutePath/src/main\"\n    def baseDir = \"$project.projectDir/reports/\"\n    def output = \"$baseDir/report.xml\"\n    def params = [ '-i', input, '-o', output, '-fs', '-f', \".*/test/.*\"]\n    args(params)\n}\n\ndependencies {\n    jquality 'io.gitlab.arturbosch.smartsmells:SmartSmells:1.0.0.[Milestone]'\n}\n```\n\nAs you can see above the input and output parameters must be specified.\n\nYou can also use the groovy-config for the gradle task\n\n```\ntask smartsmells(type: JavaExec) {\n    main = \"io.gitlab.arturbosch.smartsmells.Main\"\n    classpath = configurations.smartsmells\n    def params = [ '-gc', 'path/to/groovy/config]\n    args(params)\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturbosch%2Fjquality","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farturbosch%2Fjquality","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturbosch%2Fjquality/lists"}