json format do not return all the results
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.5k
- Forks
- 1.2k
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Description
The code is below and problem i met is below:
code = """
package org.demo.codesmell.config;
public class AppConfig {
public static final String APP_PASSWORD = "appPassword";
public static final String Password = "password";
}
"""
prompt = f"""
Please review the following code, and you must find all the issues in the code:{code}"""
import ollama #ollama run codellama:34b-instruct-q5_K_M
from ollama import Options
response = ollama.chat(model='codellama:34b-instruct-q5_K_M',
messages=[
{
'role': 'user',
'content': prompt,
},
],
#format="json",
#stream=True,
options=Options(
temperature=0,
#top_p=0.9,
#max_tokens=1024,
num_ctx=8192,
num_predict=-1)
)
print(response['message']["content"])
It will return the following informations, 5 issues
The code you provided is a Java class that defines some constants for an application configuration. Here are the issues I found:
- The naming convention for constants is not consistent. Some constants are in all caps, while others are camelCase. It's best to use a consistent naming convention throughout the code.
- The
Passwordconstant is misspelled. It should beAPP_PASSWORD. - The
APP_PASSWORDconstant is not used anywhere in the code. If it's not being used, it can be removed. - There are no getters or setters for the constants. It's best to provide getters and setters for each constant so that they can be accessed and modified from outside the class.
- The class is not final, which means it can be extended. However, there is no need to extend this class as it only contains constants. It would be better to make the class final to prevent unintended inheritance.
But, as I just use the option, format="json", it just return 2 issues in json format, is that a bug?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction script in the issue and compare the ollama.chat calls with and without format="json", using the same prompt and model settings. The issue names no repository files or tests; done means establishing whether JSON formatting is expected to change the number of reported issues and documenting or reproducing the confirmed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json, ollama, python
- Domain
- ai, api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100