shadowproject/shadow

View on GitHub
contrib/bitrpc/bitrpc.py

Summary

Maintainability
D
2 days
Test Coverage

File bitrpc.py has 283 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from jsonrpc import ServiceProxy
import sys
import string

# ===== BEGIN USER SETTINGS =====
Severity: Minor
Found in contrib/bitrpc/bitrpc.py - About 2 hrs to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    elif cmd == "sendmany":
        try:
            frm = raw_input("From: ")
            to = raw_input("To (in format address1:amount1,address2:amount2,...): ")
            mc = raw_input("Minimum confirmations (optional): ")
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 1 other location - About 3 hrs to fix
    contrib/bitrpc/bitrpc.py on lines 251..262

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 71.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    elif cmd == "sendtoaddress":
        try:
            to = raw_input("To (in format address1:amount1,address2:amount2,...): ")
            amt = raw_input("Amount:")
            comment = raw_input("Comment (optional): ")
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 1 other location - About 3 hrs to fix
    contrib/bitrpc/bitrpc.py on lines 238..249

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 71.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    elif cmd == "getbalance":
        try:
            acct = raw_input("Enter an account (optional): ")
            mc = raw_input("Minimum confirmations (optional): ")
            try:
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 4 other locations - About 1 hr to fix
    contrib/bitrpc/bitrpc.py on lines 116..125
    contrib/bitrpc/bitrpc.py on lines 127..136
    contrib/bitrpc/bitrpc.py on lines 175..184
    contrib/bitrpc/bitrpc.py on lines 186..195

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    elif cmd == "getreceivedbyaddress":
        try:
            addr = raw_input("Enter a Bitcoin address (optional): ")
            mc = raw_input("Minimum confirmations (optional): ")
            try:
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 4 other locations - About 1 hr to fix
    contrib/bitrpc/bitrpc.py on lines 46..55
    contrib/bitrpc/bitrpc.py on lines 116..125
    contrib/bitrpc/bitrpc.py on lines 175..184
    contrib/bitrpc/bitrpc.py on lines 186..195

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    elif cmd == "getreceivedbyaccount":
        try:
            acct = raw_input("Enter an account (optional): ")
            mc = raw_input("Minimum confirmations (optional): ")
            try:
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 4 other locations - About 1 hr to fix
    contrib/bitrpc/bitrpc.py on lines 46..55
    contrib/bitrpc/bitrpc.py on lines 127..136
    contrib/bitrpc/bitrpc.py on lines 175..184
    contrib/bitrpc/bitrpc.py on lines 186..195

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    elif cmd == "listreceivedbyaccount":
        try:
            mc = raw_input("Minimum confirmations (optional): ")
            incemp = raw_input("Include empty? (true/false, optional): ")
            try:
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 4 other locations - About 1 hr to fix
    contrib/bitrpc/bitrpc.py on lines 46..55
    contrib/bitrpc/bitrpc.py on lines 116..125
    contrib/bitrpc/bitrpc.py on lines 127..136
    contrib/bitrpc/bitrpc.py on lines 186..195

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    elif cmd == "listreceivedbyaddress":
        try:
            mc = raw_input("Minimum confirmations (optional): ")
            incemp = raw_input("Include empty? (true/false, optional): ")
            try:
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 4 other locations - About 1 hr to fix
    contrib/bitrpc/bitrpc.py on lines 46..55
    contrib/bitrpc/bitrpc.py on lines 116..125
    contrib/bitrpc/bitrpc.py on lines 127..136
    contrib/bitrpc/bitrpc.py on lines 175..184

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    elif cmd == "getwork":
        try:
            data = raw_input("Data (optional): ")
            try:
                print access.gettransaction(data)
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 3 other locations - About 1 hr to fix
    contrib/bitrpc/bitrpc.py on lines 106..114
    contrib/bitrpc/bitrpc.py on lines 155..163
    contrib/bitrpc/bitrpc.py on lines 165..173

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 38.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    elif cmd == "getnewaddress":
        try:
            acct = raw_input("Enter an account name: ")
            try:
                print access.getnewaddress(acct)
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 3 other locations - About 1 hr to fix
    contrib/bitrpc/bitrpc.py on lines 145..153
    contrib/bitrpc/bitrpc.py on lines 155..163
    contrib/bitrpc/bitrpc.py on lines 165..173

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 38.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    elif cmd == "help":
        try:
            cmd = raw_input("Command (optional): ")
            try:
                print access.help(cmd)
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 3 other locations - About 1 hr to fix
    contrib/bitrpc/bitrpc.py on lines 106..114
    contrib/bitrpc/bitrpc.py on lines 145..153
    contrib/bitrpc/bitrpc.py on lines 165..173

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 38.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    elif cmd == "listaccounts":
        try:
            mc = raw_input("Minimum confirmations (optional): ")
            try:
                print access.listaccounts(mc)
    Severity: Major
    Found in contrib/bitrpc/bitrpc.py and 3 other locations - About 1 hr to fix
    contrib/bitrpc/bitrpc.py on lines 106..114
    contrib/bitrpc/bitrpc.py on lines 145..153
    contrib/bitrpc/bitrpc.py on lines 155..163

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 38.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status