(self, options)
| 55 | parser.add_argument('--branch', type=str, help='Set branch', default=None) |
| 56 | |
| 57 | def handle(self, options): |
| 58 | if options['method'] is None: |
| 59 | logger.error("method 不能为空!") |
| 60 | return |
| 61 | if options['base_url'] is None: |
| 62 | logger.error("base_url 不能为空!") |
| 63 | return |
| 64 | if options['org_sid'] is None: |
| 65 | logger.error("org_sid 不能为空!") |
| 66 | return |
| 67 | if options['team_name'] is None: |
| 68 | logger.error("team_name 不能为空!") |
| 69 | return |
| 70 | method = options['method'] |
| 71 | base_url = options['base_url'] |
| 72 | org_sid = options['org_sid'] |
| 73 | team_name = options['team_name'] |
| 74 | |
| 75 | if method == 'create_repository': |
| 76 | # 1、创建代码库 |
| 77 | self.create_repository_preproccess(base_url, org_sid, team_name, options) |
| 78 | elif method == 'update_scheme_settings': |
| 79 | # 2、设置指定代码库的指定方案的代码度量配置 |
| 80 | self.update_scheme_settings_preproccess(base_url, org_sid, team_name, options) |
| 81 | elif method == 'create_project': |
| 82 | # 3、创建分析项目 |
| 83 | self.create_project_preproccess(base_url, org_sid, team_name, options) |
| 84 | elif method == 'create_scans': |
| 85 | # 4、启动任务 |
| 86 | self.create_scans_preproccess(base_url, org_sid, team_name, options) |
| 87 | elif method == 'get_scan_cons': |
| 88 | # 5、轮询任务结果 |
| 89 | self.get_scan_cons_preproccess(base_url, org_sid, team_name, options) |
| 90 | elif method == 'get_overview': |
| 91 | # 6、获取分析概览 |
| 92 | self.get_overview_preproccess(base_url, org_sid, team_name, options) |
| 93 | elif method == 'get_issues': |
| 94 | # 7、查看扫描问题列表 |
| 95 | self.get_issues_preproccess(base_url, org_sid, team_name, options) |
| 96 | elif method == 'get_issue_detail': |
| 97 | # 8、查看问题详情 |
| 98 | self.get_issue_detail_preproccess(base_url, org_sid, team_name, options) |
| 99 | elif method == 'get_ccissues': |
| 100 | # 9、查看指定项目的圈复杂度问题列表 |
| 101 | self.get_ccissues_preproccess(base_url, org_sid, team_name, options) |
| 102 | elif method == 'get_dupfiles': |
| 103 | # 10、查看指定项目的重复文件列表 |
| 104 | self.get_dupfiles_preproccess(base_url, org_sid, team_name, options) |
| 105 | else: |
| 106 | logger.error("不存在该方法,请重新执行!") |
| 107 | return |
| 108 | |
| 109 | def create_repository_preproccess(self, base_url, org_sid, team_name, options): |
| 110 | # 请求体必填字段判断 |
no test coverage detected