Repository Analysis

lionsoul2014/ip2region

Ip2region is an offline IP-to-Region localization library and IP data management framework with both IPv4 and IPv6 supports, 10-microsecond level query efficiency, xdb search client for many programming languages

2.0 Likely human-written View on GitHub
2.0
Adjusted Score
2.0
Raw Score
100%
Time Factor
2026-05-30
Last Push
19,076
Stars
Java
Language
29,613
Lines of Code
214
Files
58
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 0MEDIUM 0LOW 58

Pattern Findings

58 matches across 5 categories. Click a row to expand file-level details.

Over-Commented Block32 hits · 32 pts
SeverityFileLineSnippet
LOWbinding/python/ip2region/__init__.py1# Copyright 2022 The Ip2Region Authors. All rights reserved.
LOWbinding/golang/xdb/util.go41}
LOWbinding/rust/example/src/cmd.rs1use clap::{Parser, Subcommand, ValueEnum};
LOWbinding/lua_c/xdb_searcher.c1// Copyright 2022 The Ip2Region Authors. All rights reserved.
LOWbinding/nginx/src/ngx_http_ip2region_module.h1/*
LOWbinding/cpp/src/base.h1#ifndef BASE_H
LOWbinding/csharp/IP2Region.Net/XDB/XdbVersion.cs1// Copyright 2025 The Ip2Region Authors. All rights reserved.
LOWbinding/csharp/IP2Region.Net/XDB/XdbVersion.cs21 /// 获得/设置 缓存策略
LOWbinding/csharp/IP2Region.Net/XDB/CachePolicy.cs1// Copyright 2025 The Ip2Region Authors. All rights reserved.
LOW…P2Region.Net/Extensions/ServiceCollectionExtensions.cs1// Copyright 2025 The Ip2Region Authors. All rights reserved.
LOWbinding/csharp/IP2Region.Net/Abstractions/ISearcher.cs1// Copyright 2025 The Ip2Region Authors. All rights reserved.
LOWbinding/csharp/IP2Region.Net/Abstractions/ISearcher.cs21 /// <returns></returns>
LOWbinding/c/xdb_api.h1// Copyright 2022 The Ip2Region Authors. All rights reserved.
LOWbinding/c/xdb_api.h21# define XDB_PUBLIC(type) extern __declspec(dllexport) type
LOWbinding/c/xdb_api.h41#define xdb_malloc( _bytes ) malloc( _bytes )
LOWbinding/c/xdb_util.c1// Copyright 2022 The Ip2Region Authors. All rights reserved.
LOWbinding/c/xdb_util.c501 // we may have to use the large file solution later
LOWmaker/python/xdb/maker.py1# Copyright 2022 The Ip2Region Authors. All rights reserved.
LOWmaker/python/xdb/maker.py21# -- 4bytes: index block start ptr
LOWmaker/python/xdb/maker.py41# data entry structure:
LOWmaker/python/xdb/__init__.py1# Copyright 2022 The Ip2Region Authors. All rights reserved.
LOWmaker/python/xdb/segment.py21 return "{}|{}|{}".format(
LOWmaker/golang/xdb/maker.go1// Copyright 2022 The Ip2Region Authors. All rights reserved.
LOWmaker/golang/xdb/maker.go21// -- 2bytes: ip version number (4/6 since IPv6 supporting)
LOWmaker/golang/xdb/maker.go41// data entry structure:
LOWmaker/golang/xdb/editor.go201 return e.PutSegment(seg, cb)
LOWmaker/golang/xdb/segment.go141 // if eip < s.EndIP {
LOW…va/src/main/java/org/lionsoul/ip2region/xdb/Maker.java1// Copyright 2022 The Ip2Region Authors. All rights reserved.
LOW…va/src/main/java/org/lionsoul/ip2region/xdb/Maker.java21// -- 4bytes: index block end ptr
LOW…va/src/main/java/org/lionsoul/ip2region/xdb/Maker.java41//
LOWmaker/csharp/IP2RegionMaker/XDB/Maker.cs1// Copyright 2022 The Ip2Region Authors. All rights reserved.
LOWmaker/csharp/IP2RegionMaker/XDB/Maker.cs21// -- 4bytes: index block end ptr
Excessive Try-Catch Wrapping23 hits · 23 pts
SeverityFileLineSnippet
LOWbinding/python/util_test.py41 except Exception as e:
LOWbinding/python/util_test.py49 except Exception as e:
LOWbinding/python/util_test.py126 except Exception as e:
LOWbinding/python/util_test.py144 except Exception as e:
LOWbinding/python/README.md75except Exception as e:
LOWbinding/python/README.md86except Exception as e:
LOWbinding/python/README.md106except Exception as e:
LOWbinding/python/README.md113except Exception as e:
LOWbinding/python/README.md124except Exception as e:
LOWbinding/python/README.md144except Exception as e:
LOWbinding/python/README.md161except Exception as e:
LOWbinding/python/README_zh.md66except Exception as e:
LOWbinding/python/README_zh.md77except Exception as e:
LOWbinding/python/README_zh.md96except Exception as e:
LOWbinding/python/README_zh.md103except Exception as e:
LOWbinding/python/README_zh.md114except Exception as e:
LOWbinding/python/README_zh.md133except Exception as e:
LOWbinding/python/README_zh.md150except Exception as e:
LOWbinding/python/search_test.py53 except Exception as e:
LOWbinding/python/search_test.py75 except Exception as e:
LOWbinding/python/search_test.py81 except Exception as e:
LOWbinding/python/bench_test.py53 except Exception as e:
LOWbinding/python/bench_test.py94 except Exception as e:
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippet
LOWbinding/python/ip2region/util.py240# Verify if the current Searcher could be used to search the specified xdb file.
Hyper-Verbose Identifiers1 hit · 1 pts
SeverityFileLineSnippet
LOWbinding/python/ip2region/util.py220def load_vector_index_from_file(db_file: str):
Deep Nesting1 hit · 1 pts
SeverityFileLineSnippet
LOWmaker/python/main.py30