secynic/ipwhois

View on GitHub

Showing 266 of 266 total issues

Function lookup has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def lookup(self, asn=None, inc_raw=False, retry_count=3, response=None,
Severity: Minor
Found in ipwhois/asn.py - About 45 mins to fix

Function parse_fields has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def parse_fields(self, response, fields_dict, net_start=None,
Severity: Minor
Found in ipwhois/whois.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if rir == 'lacnic':

                            lacnic_total_left -= 1

Severity: Major
Found in ipwhois/experimental.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        for k, v in val.items():

                            if k in ['phone', 'address', 'email']:

                                output += generate_output(
Severity: Major
Found in ipwhois/scripts/ipwhois_cli.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        for contact in val:

                            if contact in global_contacts.keys():

                                temp_net['contacts'][key] = (
Severity: Major
Found in ipwhois/nir.py - About 45 mins to fix

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

        while True:

            d = conn.recv(4096).decode()
            data += d

Severity: Major
Found in ipwhois/experimental.py and 2 other locations - About 45 mins to fix
ipwhois/net.py on lines 314..319
ipwhois/net.py on lines 445..451

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 35.

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

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

        try:

            ret['type'] = val[1]['type']

        except (KeyError, ValueError, TypeError):
Severity: Minor
Found in ipwhois/rdap.py and 1 other location - About 45 mins to fix
ipwhois/rdap.py on lines 196..200

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 35.

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

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

        try:

            ret['type'] = val[1]['type']

        except (KeyError, ValueError, TypeError):
Severity: Minor
Found in ipwhois/rdap.py and 1 other location - About 45 mins to fix
ipwhois/rdap.py on lines 126..130

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 35.

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 3 locations. Consider refactoring.
Open

            while True:

                d = conn.recv(4096).decode()
                data += d

Severity: Major
Found in ipwhois/net.py and 2 other locations - About 45 mins to fix
ipwhois/experimental.py on lines 82..87
ipwhois/net.py on lines 445..451

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 35.

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 3 locations. Consider refactoring.
Open

            while True:

                d = conn.recv(4096).decode()

                response += d
Severity: Major
Found in ipwhois/net.py and 2 other locations - About 45 mins to fix
ipwhois/experimental.py on lines 82..87
ipwhois/net.py on lines 314..319

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 35.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    def __init__(self, net):

        from .net import Net

        # ipwhois.net.Net validation
Severity: Major
Found in ipwhois/whois.py and 2 other locations - About 40 mins to fix
ipwhois/asn.py on lines 560..571
ipwhois/nir.py on lines 160..171

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 34.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    def __init__(self, net):

        from .net import Net

        # ipwhois.net.Net validation
Severity: Major
Found in ipwhois/nir.py and 2 other locations - About 40 mins to fix
ipwhois/asn.py on lines 560..571
ipwhois/whois.py on lines 198..209

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 34.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    def __init__(self, net):

        from .net import Net

        # ipwhois.net.Net validation
Severity: Major
Found in ipwhois/asn.py and 2 other locations - About 40 mins to fix
ipwhois/nir.py on lines 160..171
ipwhois/whois.py on lines 198..209

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 34.

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

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

                    if temp is not None:
                        net_range = temp.group(1).strip()
                        net_range_start = temp.start()
Severity: Minor
Found in ipwhois/whois.py and 1 other location - About 40 mins to fix
ipwhois/whois.py on lines 356..358

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 34.

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

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

        if temp is not None:
            net_range = temp.group(1).strip()
            net_range_start = temp.start()
Severity: Minor
Found in ipwhois/whois.py and 1 other location - About 40 mins to fix
ipwhois/whois.py on lines 376..378

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 34.

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

Function get_http_raw has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def get_http_raw(self, url=None, retry_count=3, headers=None,
Severity: Minor
Found in ipwhois/net.py - About 35 mins to fix

Function get_contact has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def get_contact(self, response=None, nir=None, handle=None,
Severity: Minor
Found in ipwhois/nir.py - About 35 mins to fix

Function parse_fields has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def parse_fields(self, response, fields_dict, net_start=None,
Severity: Minor
Found in ipwhois/asn.py - About 35 mins to fix

Function get_asn_origin_whois has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def get_asn_origin_whois(self, asn_registry='radb', asn=None,
Severity: Minor
Found in ipwhois/net.py - About 35 mins to fix

Function get_whois has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def get_whois(self, asn_registry='arin', retry_count=3, server=None,
Severity: Minor
Found in ipwhois/net.py - About 35 mins to fix
Severity
Category
Status
Source
Language