Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

14 changed files with 0 additions and 33419 deletions

View File

@ -1 +0,0 @@
As a special exception, if you link this library with other files to produce an executable, this library does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License.

View File

@ -1,17 +0,0 @@
name: 'log match action'
description: 'Gitea action log match key'
author: 'GitLink'
inputs:
match-step:
description: 'Gitea action job in steps.'
match-key:
description: 'Gitea action job in steps match key.'
match-job-name:
description: 'match job name, default env.job_name.'
upload-api-domain:
description: 'match value upload api save it.'
check-contains-link:
description: 'default true, Check if links are included.'
runs:
using: 'node20'
main: 'dist/index.js'

View File

@ -1,19 +0,0 @@
name: 'log match action'
description: 'Gitea action log match key'
author: 'GitLink'
inputs:
match-step:
description: 'Gitea action job in steps.'
match-key:
description: 'Gitea action job in steps match key.'
match-job-name:
description: 'match job name, default env.job_name.'
upload-api-domain:
description: 'match value upload api save it.'
check-contains-link:
description: 'default true, Check if links are included.'
show-type:
description: 'default html, html or json.'
runs:
using: 'node20'
main: 'dist/index.js'

16
asgi.py
View File

@ -1,16 +0,0 @@
"""
ASGI config for maturityAnalyse project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'maturityAnalyse.settings')
application = get_asgi_application()

Binary file not shown.

31956
index.js

File diff suppressed because one or more lines are too long

View File

@ -1,588 +0,0 @@
@actions/core
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/exec
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/github
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/http-client
MIT
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/io
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@fastify/busboy
MIT
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
@octokit/auth-token
MIT
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@octokit/core
MIT
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@octokit/endpoint
MIT
The MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@octokit/graphql
MIT
The MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@octokit/plugin-paginate-rest
MIT
MIT License Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@octokit/plugin-rest-endpoint-methods
MIT
MIT License Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@octokit/request
MIT
The MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@octokit/request-error
MIT
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
before-after-hook
Apache-2.0
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2018 Gregor Martynus and other contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
deprecation
ISC
The ISC License
Copyright (c) Gregor Martynus and contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
once
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
tunnel
MIT
The MIT License (MIT)
Copyright (c) 2012 Koichi Kobayashi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
undici
MIT
MIT License
Copyright (c) Matteo Collina and Undici contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
universal-user-agent
ISC
# [ISC License](https://spdx.org/licenses/ISC)
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
wrappy
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -1,22 +0,0 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'maturityAnalyse.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

View File

@ -1,24 +0,0 @@
{
"name": "log_match_action",
"version": "1.0.0",
"description": "通过在终端中运行此命令来安装 vercel/ncc。",
"main": "src/index.js",
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/github": "^6.0.0",
"before-after-hook": "^2.2.3",
"deprecation": "^2.3.1",
"once": "^1.4.0",
"tunnel": "^0.0.6",
"undici": "^5.28.4",
"universal-user-agent": "^6.0.1",
"wrappy": "^1.0.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"run": "node dist/index.js"
},
"keywords": [],
"author": "",
"license": "ISC"
}

Binary file not shown.

View File

@ -1,124 +0,0 @@
"""
Django settings for maturityAnalyse project.
Generated by 'django-admin startproject' using Django 5.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/5.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.1/ref/settings/
"""
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-bk5uuf*=u0@dnlpicrk%(7#20iyez^yeh9yp1wau4r_7653vev'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'maturityAnalyse.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates']
,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'maturityAnalyse.wsgi.application'
# Database
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/5.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.1/howto/static-files/
STATIC_URL = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

25
urls.py
View File

@ -1,25 +0,0 @@
"""
URL configuration for maturityAnalyse project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from maturityAnalyse.views import calculate
urlpatterns = [
path('admin/', admin.site.urls),
path('maturityAnalyse/', calculate , name = "calculate"),
]

611
views.py
View File

@ -1,611 +0,0 @@
import configparser
import math
import requests
import json
import os
from django.http import JsonResponse
from django.views.decorators.http import require_http_methods
from maturityAnalyse import settings
config_file_path = os.path.join(settings.BASE_DIR, 'static', 'config.ini')
# 加载配置文件
def load_config(file_path):
config = configparser.ConfigParser()
config.read(file_path)
return config['Limits']
# 获取最大最小值
def get_extreme_values(name):
limits = load_config(config_file_path)
try:
max_value = int(limits[f"{name}_max"])
min_value = int(limits[f"{name}_min"])
except KeyError:
print(f"没有找到配置项: {name}")
max_value, min_value = None, None
return max_value, min_value
# 获取成熟度计算所需的上下文(最大最小值)
def get_maturity_context():
context = MaturityContext()
context.commits_number_max, context.commits_number_min = get_extreme_values("commits_number")
context.contributing_max, context.contributing_min = get_extreme_values("contributing")
context.critical_advisory_max, context.critical_advisory_min = get_extreme_values("critical_advisory")
context.forks_max, context.forks_min = get_extreme_values("forks")
context.high_advisory_max, context.high_advisory_min = get_extreme_values("high_advisory")
context.issue_closed_max, context.issue_closed_min = get_extreme_values("issue_closed")
context.issue_opened_max, context.issue_opened_min = get_extreme_values("issue_opened")
context.license_max, context.license_min = get_extreme_values("license_info")
context.low_advisory_max, context.low_advisory_min = get_extreme_values("low_advisory")
context.moderate_advisory_max, context.moderate_advisory_min = get_extreme_values("moderate_advisory")
context.stars_max, context.stars_min = get_extreme_values("stars")
context.release_number_max, context.release_number_min = get_extreme_values("release_number")
context.developer_number_max, context.developer_number_min = get_extreme_values("developer_number")
return context
class MaturityContext:
def __init__(self):
self.stars_max = 0
self.stars_min = 0
self.watching_max = 0
self.watching_min = 0
self.forks_max = 0
self.forks_min = 0
self.commits_number_max = 0
self.commits_number_min = 0
self.license_max = 0
self.license_min = 0
self.issue_closed_max = 0
self.issue_closed_min = 0
self.issue_opened_max = 0
self.issue_opened_min = 0
self.low_advisory_max = 0
self.low_advisory_min = 0
self.moderate_advisory_max = 0
self.moderate_advisory_min = 0
self.high_advisory_max = 0
self.high_advisory_min = 0
self.critical_advisory_max = 0
self.critical_advisory_min = 0
self.contributing_max = 0
self.contributing_min = 0
self.developer_number_max = 0
self.developer_number_min = 0
self.release_number_max = 0
self.release_number_min = 0
class Software:
def __init__(self, license, issue_opened, issue_closed, low_advisory, moderate_advisory, high_advisory,
critical_advisory, stars, watching, forks, commits_number, average_day_interval, readme,
contributing, developer_number, release_number, user_number, sum_user_score):
self.license = license
self.issue_opened = issue_opened
self.issue_closed = issue_closed
self.low_advisory = low_advisory
self.moderate_advisory = moderate_advisory
self.high_advisory = high_advisory
self.critical_advisory = critical_advisory
self.stars = stars
self.watching = watching
self.forks = forks
self.commits_number = commits_number
self.contributing = contributing
self.developer_number = developer_number
self.release_number = release_number
class AllWeightSoftware:
def __init__(self, software):
self.s = software
self.m = 0
def generate_score(value, max_value, min_value):
if max_value - min_value == 0:
return 100 if value > 0 else 0
if max_value > 2:
return log_generate_score(value, max_value, min_value)
else:
return normal_generate_score(value, max_value, min_value)
def normal_generate_score(value, max_value, min_value):
return int(100 * (value - min_value) / (max_value - min_value))
def log_generate_score(value, max_value, min_value):
if max_value - min_value == 0 and max_value != 0:
return 50
fv = math.log10(value) if value > 0 else 0
fmax = math.log10(max_value) if max_value != 0 else 0
fmin = math.log10(min_value) if min_value != 0 else 0
return int(100 * (fv - fmin) / (fmax - fmin))
def maturity(software, context):
ws = AllWeightSoftware(software)
# 计算每个属性的分数
ws.license_score = generate_score(software.license, context.license_max, context.license_min)
ws.open_issue_score = generate_score(software.issue_opened, context.issue_opened_max,
context.issue_opened_min)
ws.closed_issue_score = generate_score(software.issue_closed, context.issue_closed_max, context.issue_closed_min)
ws.low_advisory_score = 100 - generate_score(software.low_advisory, context.low_advisory_max,
context.low_advisory_min)
ws.moderate_advisory_score = 100 - generate_score(software.moderate_advisory, context.moderate_advisory_max,
context.moderate_advisory_min)
ws.high_advisory_score = 100 - generate_score(software.high_advisory, context.high_advisory_max,
context.high_advisory_min)
ws.critical_advisory_score = 100 - generate_score(software.critical_advisory, context.critical_advisory_max,
context.critical_advisory_min)
ws.stars_score = generate_score(software.stars, context.stars_max, context.stars_min)
ws.watching_score = generate_score(software.watching, context.watching_max, context.watching_min)
ws.fork_score = generate_score(software.forks, context.forks_max, context.forks_min)
ws.commits_number_score = generate_score(software.commits_number, context.commits_number_max,
context.commits_number_min)
ws.developer_number_score = generate_score(software.developer_number, context.developer_number_max,
context.developer_number_min)
ws.release_number_score = generate_score(software.release_number, context.release_number_max,
context.release_number_min)
# 计算整体成熟度,去掉权重影响
ws.m = (ws.license_score + ws.open_issue_score + ws.closed_issue_score +
# 降低了这部分内容的权重
(ws.low_advisory_score + ws.moderate_advisory_score + ws.high_advisory_score + ws.critical_advisory_score) * 0.25 +
ws.stars_score + ws.watching_score + ws.fork_score + ws.commits_number_score +
ws.developer_number_score + ws.release_number_score) / 10
stage = 0
if ws.m < 60:
stage = 2
elif ws.m >= 60 and ws.m < 80:
stage = 1
yadd = stage * 3 - 1
scores_charts = [
{
"name": "license_score",
"score": ws.license_score,
"description": "开源许可证评分",
"criteria": {
"100": "使用标准开源许可证(MIT/Apache/GPL等)",
"0": "无许可证"
},
"suggestion": "建议使用标准的开源许可证以明确项目的使用条款和限制",
"itemStyle": {
"color": "#e9ff40"
},
"value": [
3,
1 + yadd,
ws.license_score
]
},
{
"name": "open_issue_score",
"score": ws.open_issue_score,
"description": "未解决issue评分",
"criteria": {
"80-100": "未解决issue较少",
"60-80": "未解决issue较多",
"0-60": "未解决issue很多"
},
"suggestion": "保持适度的未解决issue数量,及时处理重要issue",
"itemStyle": {
"color": "#abd9e9"
},
"value": [
7,
2 + yadd,
ws.open_issue_score
]
},
{
"name": "closed_issue_score",
"score": ws.closed_issue_score,
"description": "已解决issue评分",
"criteria": {
"80-100": "已解决issue很多",
"60-80": "已解决issue较多",
"0-60": "已解决issue较少"
},
"suggestion": "提高issue解决率,保持良好的问题跟踪和处理机制",
"itemStyle": {
"color": "#74add1"
},
"value": [
8,
2 + yadd,
ws.closed_issue_score
]
},
{
"name": "low_advisory_score",
"score": ws.low_advisory_score,
"description": "低风险安全警告评分",
"criteria": {
"100": "无低风险警告",
"0": "多个低风险警告"
},
"suggestion": "定期检查并修复安全隐患,即使是低风险问题也应重视",
"itemStyle": {
"color": "#ffffbf"
},
"value": [
0,
1 + yadd,
ws.low_advisory_score
]
},
{
"name": "moderate_advisory_score",
"score": ws.moderate_advisory_score,
"description": "中等风险安全警告评分",
"criteria": {
"100": "无中等风险警告",
"0": "多个中风险警告"
},
"suggestion": "优先处理中等风险安全问题,避免安全隐患扩大",
"itemStyle": {
"color": "#fee090"
},
"value": [
0,
2 + yadd,
ws.moderate_advisory_score
]
},
{
"name": "high_advisory_score",
"score": ws.high_advisory_score,
"description": "高风险安全警告评分",
"criteria": {
"100": "无高风险警告",
"0": "多个高风险警告"
},
"suggestion": "高风险安全问题必须立即处理,可考虑发布安全补丁版本",
"itemStyle": {
"color": "#fdae61"
},
"value": [
1,
1 + yadd,
ws.high_advisory_score
]
},
{
"name": "critical_advisory_score",
"score": ws.critical_advisory_score,
"description": "严重风险安全警告评分",
"criteria": {
"100": "无严重风险警告",
"0": "多个严重风险警告"
},
"suggestion": "严重安全问题需要紧急修复并及时通知用户更新",
"itemStyle": {
"color": "#f46d43"
},
"value": [
1,
2 + yadd,
ws.critical_advisory_score
]
},
{
"name": "stars_score",
"score": ws.stars_score,
"description": "项目Star数评分",
"criteria": {
"80-100": "Star很多",
"60-80": "Star较多",
"0-60": "Star较少"
},
"suggestion": "提高项目影响力,完善文档和功能以吸引更多用户关注",
"itemStyle": {
"color": "#93AAFC"
},
"value": [
3,
2 + yadd,
ws.stars_score
]
},
{
"name": "watching_score",
"score": ws.watching_score,
"description": "项目关注者评分",
"criteria": {
"80-100": "关注者很多",
"60-80": "关注者较多",
"0-60": "关注者较少"
},
"suggestion": "增加项目曝光度,保持更新以维持用户关注度",
"itemStyle": {
"color": "#40daff"
},
"value": [
4,
2 + yadd,
ws.watching_score
]
},
{
"name": "fork_score",
"score": ws.fork_score,
"description": "项目fork数评分",
"criteria": {
"80-100": "fork数很多",
"60-80": "fork数较多",
"0-60": "fork数较少"
},
"suggestion": "鼓励社区贡献,完善协作指南以促进fork开发",
"itemStyle": {
"color": "#73d797"
},
"value": [
5,
1 + yadd,
ws.fork_score
]
},
{
"name": "commits_number_score",
"score": ws.commits_number_score,
"description": "提交次数评分",
"criteria": {
"80-100": "提交次数很多",
"60-80": "提交次数较多",
"0-60": "提交次数较少"
},
"suggestion": "保持稳定的开发活跃度,定期提交代码更新",
"itemStyle": {
"color": "#ad73d7"
},
"value": [
6,
1 + yadd,
ws.commits_number_score
]
},
{
"name": "developer_number_score",
"score": ws.developer_number_score,
"description": "开发者数量评分",
"criteria": {
"80-100": "开发者数量很多",
"60-80": "开发者数量较多",
"0-60": "开发者数量较少"
},
"suggestion": "扩大开发团队,培养核心贡献者",
"itemStyle": {
"color": "#ee6df5"
},
"value": [
2,
2 + yadd,
ws.developer_number_score
]
},
{
"name": "release_number_score",
"score": ws.release_number_score,
"description": "发布版本数评分",
"criteria": {
"80-100": "发布版本数很多",
"60-80": "发布版本数较多",
"0-60": "发布版本数较少"
},
"suggestion": "建立规范的版本发布流程,保持稳定的迭代节奏",
"itemStyle": {
"color": "#c4b7e5"
},
"value": [
2,
1 + yadd,
ws.release_number_score
]
},
]
main_score = {
"name": "overall_maturity_score",
"score": ws.m,
"description": "总体成熟度评分",
"criteria": {
"80-100": "项目成熟,维护良好",
"60-80": "项目稳定,有待改进",
"40-60": "项目基本可用,需要加强维护",
"0-40": "项目初期或疏于维护"
},
"x_axis": ["稳健性","稳健性","稳健性","扩展性","扩展性","扩展性","维护性","维护性","维护性"],
"y_axis": ["成熟型","成熟型","成熟型","稳定型","稳定型","稳定型","成长型","成长型","成长型"],
"suggestion": "根据各项分值改进薄弱环节,提高项目整体质量"
}
return {'main_score': main_score, 'scores': scores_charts}
def fetch_data(url):
"""从给定 URL 获取数据并以 JSON 格式返回。"""
response = requests.get(url)
response.raise_for_status() # 对于错误响应抛出异常
return response.json()
@require_http_methods(['GET'])
def calculate(request):
owner = request.GET.get('owner')
repository = request.GET.get('repository')
env_url = "https://www.gitlink.org.cn"
if request.GET.get('env_url') == "testforgeplus":
env_url = "https://testforgeplus.trustie.net"
# owner = "xuos" # 替换为实际的 owner
# repository = "xiuos" # 替换为实际的 repository
# owner = "leslieder"
# repository = "nodom"
# owner = "openEuler-Ecosystem"
# repository = "openEuler-EulerOS"
# 从 API 获取数据
link1_info = f"{env_url}/api/{owner}/{repository}/detail.json"
link2_contri = f"{env_url}/api/{owner}/{repository}/contributors.json"
link3_issue = f"{env_url}/api/{owner}/{repository}/issues.json"
link4_commits = f"{env_url}/api/{owner}/{repository}/commits.json"
link_release = f"{env_url}/api/{owner}/{repository}/releases.json"
try:
software_detail = fetch_data(link1_info)
contributors = fetch_data(link2_contri)
issues = fetch_data(link3_issue)
commits = fetch_data(link4_commits)
releases = fetch_data(link_release)
# 提取必要的信息
license_info = 1 if software_detail.get("license_name") else 0
issue_opened = issues.get("open_count", 0)
issue_closed = issues.get("close_count", 0)
low_advisory = software_detail.get("advisories", {}).get("low", 0)
moderate_advisory = software_detail.get("advisories", {}).get("moderate", 0)
high_advisory = software_detail.get("advisories", {}).get("high", 0)
critical_advisory = software_detail.get("advisories", {}).get("critical", 0)
stars = software_detail.get("praises_count", 0)
watching = software_detail.get("watchers_count", 0)
forks = software_detail.get("forked_count", 0)
commits_number = commits.get("total_count")
average_day_interval = software_detail.get("average_day_interval", 0)
readme = software_detail.get("readme", False)
contributing = software_detail.get("contributing", False)
developer_number = len(contributors.get("list"))
release_number = releases.get("total_count")
user_number = software_detail.get("user_number", 0)
sum_user_score = software_detail.get("sum_user_score", 0)
except TypeError:
return JsonResponse({'data': {}})
except:
return JsonResponse({'data': {}})
# 输出每个信息
# print("许可证:", license_info)
# print("打开的问题数量:", issue_opened)
# print("关闭的问题数量:", issue_closed)
# print("低风险通报数量:", low_advisory)
# print("中风险通报数量:", moderate_advisory)
# print("高风险通报数量:", high_advisory)
# print("严重风险通报数量:", critical_advisory)
# print("星级:", stars)
# print("关注者数量:", watching)
# print("分支数量:", forks)
# print("提交数量:", commits_number)
# print("平均天数间隔:", average_day_interval)
# print("是否包含 README:", readme)
# print("是否包含贡献指南:", contributing)
# print("开发者数量:", developer_number)
# print("发布版本数量:", release_number)
# print("用户数量:", user_number)
# print("用户总评分:", sum_user_score)
# 创建 Software 实例
software = Software(
license=license_info,
issue_opened=issue_opened,
issue_closed=issue_closed,
low_advisory=low_advisory,
moderate_advisory=moderate_advisory,
high_advisory=high_advisory,
critical_advisory=critical_advisory,
stars=stars,
watching=watching,
forks=forks,
commits_number=commits_number,
average_day_interval=average_day_interval,
readme=readme,
contributing=contributing,
developer_number=developer_number,
release_number=release_number,
user_number=user_number,
sum_user_score=sum_user_score
)
update_config(software)
context = get_maturity_context()
maturity_score = maturity(software, context)
return JsonResponse({'data': maturity_score})
def update_config(software):
"""根据软件数据更新 config.ini 文件"""
config = configparser.ConfigParser()
config.read(config_file_path)
# 更新每个数据项
update_config_value(config, 'license_info', software.license)
update_config_value(config, 'issue_opened', software.issue_opened)
update_config_value(config, 'issue_closed', software.issue_closed)
update_config_value(config, 'low_advisory', software.low_advisory)
update_config_value(config, 'moderate_advisory', software.moderate_advisory)
update_config_value(config, 'high_advisory', software.high_advisory)
update_config_value(config, 'critical_advisory', software.critical_advisory)
update_config_value(config, 'stars', software.stars)
update_config_value(config, 'watching', software.watching)
update_config_value(config, 'forks', software.forks)
update_config_value(config, 'commits_number', software.commits_number)
update_config_value(config, 'developer_number', software.developer_number)
update_config_value(config, 'release_number', software.release_number)
# 保存更新后的配置
with open(config_file_path, 'w') as configfile:
config.write(configfile)
def update_config_value(config, key, value):
"""更新配置中的最大值和最小值"""
section = 'Limits' # 指定使用的节
# 获取当前最小值和最大值
current_min = config.getint(section, key + '_min')
current_max = config.getint(section, key + '_max')
# 更新最小值
if value < current_min:
config.set(section, key + '_min', str(value))
# 更新最大值
if value > current_max:
config.set(section, key + '_max', str(value))
# if __name__ == "__main__":
# owner = "xuos" # 替换为实际的 owner
# repository = "xiuos" # 替换为实际的 repository
# calculate(owner,repository)

16
wsgi.py
View File

@ -1,16 +0,0 @@
"""
WSGI config for maturityAnalyse project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'maturityAnalyse.settings')
application = get_wsgi_application()