Showing 1,511 of 31,793 total issues
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return 'UdpTimestamp';
Avoid too many return
statements within this method. Open
return 'IP-20C';
Avoid too many return
statements within this method. Open
return $ports;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return new ValidationResult(trans('validation.validations.poller.CheckPythonWrapper.no_pollers'), $status);
Avoid too many return
statements within this method. Open
return ValidationResult::fail(trans('validation.validations.poller.CheckDispatcherService.fail'));
Avoid too many return
statements within this function. Open
return Result(scan_ip, hostname, Outcome.ERROR, output)
Avoid too many return
statements within this function. Open
return Result(scan_ip, hostname, Outcome.UNDEFINED, output)
Avoid too many return
statements within this function. Open
return Result(scan_ip, hostname, Outcome.TERMINATED, "Terminated")
Avoid too many return
statements within this function. Open
return Result(scan_ip, hostname, Outcome.KNOWN, output)
Function get_port_stats_by_port_hostname
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function get_port_stats_by_port_hostname(Illuminate\Http\Request $request)
{
$ifName = $request->route('ifname');
// handle %2f in paths and pass to get_graph_by_port_hostname if needed
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function dbHandleException
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function dbHandleException(QueryException $exception)
{
$message = $exception->getMessage();
if ($exception->getCode() == 2002) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function add_device
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function add_device(Illuminate\Http\Request $request)
{
// This will add a device using the data passed encoded with json
$data = $request->json()->all();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function dbUpdate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function dbUpdate($data, $table, $where = null, $parameters = [])
{
// need field name and placeholder value
// but how merge these field placeholders with actual $parameters array for the WHERE clause
$sql = 'UPDATE `' . $table . '` set ';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function list_vrf
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function list_vrf(Illuminate\Http\Request $request)
{
$sql = '';
$sql_params = [];
$hostname = $request->get('hostname');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function update_device_group_remove_devices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function update_device_group_remove_devices(Illuminate\Http\Request $request)
{
$data = json_decode($request->getContent(), true);
if (json_last_error() || ! is_array($data)) {
return api_error(400, "We couldn't parse the provided json. " . json_last_error_msg());
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function rename_device
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function rename_device(Illuminate\Http\Request $request)
{
$hostname = $request->route('hostname');
$device_id = ctype_digit($hostname) ? $hostname : getidbyname($hostname);
$new_hostname = $request->route('new_hostname');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function update_device_group_add_devices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function update_device_group_add_devices(Illuminate\Http\Request $request)
{
$data = json_decode($request->getContent(), true);
if (json_last_error() || ! is_array($data)) {
return api_error(400, "We couldn't parse the provided json. " . json_last_error_msg());
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"