Issues (1844)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  Header Injection
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

amenadiel/jpgraph/src/plot/MeshInterpolate.php (5 issues)

1
<?php
2
3
/**
4
 * JPGraph v4.0.3
5
 */
6
7
namespace Amenadiel\JpGraph\Plot;
8
9
/**
10
 * File:        JPGRAPH_MESHINTERPOLATE.INC.PHP
11
 * // Description: Utility class to do mesh linear interpolation of a matrix
12
 * // Created:     2009-03-09
13
 * // Ver:         $Id: jpgraph_meshinterpolate.inc.php 1709 2009-07-30 08:00:08Z ljp $
14
 * //
15
 * // Copyright (c) Asial Corporation. All rights reserved.
16
 *
17
 * @param mixed $aFactor
18
 * @param mixed $aData
19
 */
20
21
/**
22
 * Utility function to do linear mesh interpolation.
23
 *
24
 * @param $aDat Matrix to interpolate
0 ignored issues
show
The type Amenadiel\JpGraph\Plot\Matrix was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
 * @param $aFactor Interpolation factor
0 ignored issues
show
The type Amenadiel\JpGraph\Plot\Interpolation was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
26
 */
27
function doMeshInterpolate(&$aData, $aFactor)
28
{
29
    $m     = new MeshInterpolate();
30
    $aData = $m->Linear($aData, $aFactor);
31
}
32
33
/**
34
 * Utility class to interpolate a given data matrix.
35
 */
36
class MeshInterpolate
37
{
38
    private $data = [];
39
40
    /**
41
     * Calculate the mid points of the given rectangle which has its top left
42
     * corner at $row,$col. The $aFactordecides how many spliots should be done.
43
     * i.e. how many more divisions should be done recursively.
44
     *
45
     * @param $row Top left corner of square to work with
46
     * @param $col Top left corner of square to work with
0 ignored issues
show
The type Amenadiel\JpGraph\Plot\Top was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
47
     * $param $aFactor In how many subsquare should we split this square. A value of 1 indicates that no action
48
     * @param mixed $aRow
49
     * @param mixed $aCol
50
     * @param mixed $aFactor
51
     */
52
    public function IntSquare($aRow, $aCol, $aFactor)
53
    {
54
        if ($aFactor <= 1) {
55
            return;
56
        }
57
58
        $step = pow(2, $aFactor - 1);
59
60
        $v0 = $this->data[$aRow][$aCol];
61
        $v1 = $this->data[$aRow][$aCol + $step];
62
        $v2 = $this->data[$aRow + $step][$aCol];
63
        $v3 = $this->data[$aRow + $step][$aCol + $step];
64
65
        $this->data[$aRow][$aCol + $step / 2]             = ($v0 + $v1) / 2;
66
        $this->data[$aRow + $step / 2][$aCol]             = ($v0 + $v2) / 2;
67
        $this->data[$aRow + $step][$aCol + $step / 2]     = ($v2 + $v3) / 2;
68
        $this->data[$aRow + $step / 2][$aCol + $step]     = ($v1 + $v3) / 2;
69
        $this->data[$aRow + $step / 2][$aCol + $step / 2] = ($v0 + $v1 + $v2 + $v3) / 4;
70
71
        $this->IntSquare($aRow, $aCol, $aFactor - 1);
72
        $this->IntSquare($aRow, $aCol + $step / 2, $aFactor - 1);
73
        $this->IntSquare($aRow + $step / 2, $aCol, $aFactor - 1);
74
        $this->IntSquare($aRow + $step / 2, $aCol + $step / 2, $aFactor - 1);
75
    }
76
77
    /**
78
     * Interpolate values in a matrice so that the total number of data points
79
     * in vert and horizontal axis are $aIntNbr more. For example $aIntNbr=2 will
80
     * make the data matrice have tiwce as many vertical and horizontal dta points.
81
     *
82
     * Note: This will blow up the matrcide in memory size in the order of $aInNbr^2
83
     *
84
     * @param  $ &$aData The original data matricde
0 ignored issues
show
Documentation Bug introduced by
The doc comment $ at position 0 could not be parsed: Unknown type name '$' at position 0 in $.
Loading history...
85
     * @param  $aInNbr Interpolation factor
86
     * @param mixed $aIntFactor
87
     * @param mixed $aData
88
     *
89
     * @return the interpolated matrice
90
     */
91
    public function Linear(&$aData, $aIntFactor)
92
    {
93
        $step = pow(2, $aIntFactor - 1);
94
95
        $orig_cols = safe_count($aData[0]);
96
        $orig_rows = safe_count($aData);
97
        // Number of new columns/rows
98
        // N = (a-1) * 2^(f-1) + 1
99
        $p        = pow(2, $aIntFactor - 1);
100
        $new_cols = $p * ($orig_cols - 1) + 1;
101
        $new_rows = $p * ($orig_rows - 1) + 1;
102
103
        $this->data = array_fill(0, $new_rows, array_fill(0, $new_cols, 0));
104
        // Initialize the new matrix with the values that we know
105
        for ($i = 0; $i < $new_rows; ++$i) {
106
            for ($j = 0; $j < $new_cols; ++$j) {
107
                $v = 0;
108
                if (($i % $step == 0) && ($j % $step == 0)) {
109
                    $v = $aData[$i / $step][$j / $step];
110
                }
111
                $this->data[$i][$j] = $v;
112
            }
113
        }
114
115
        for ($i = 0; $i < $new_rows - 1; $i += $step) {
116
            for ($j = 0; $j < $new_cols - 1; $j += $step) {
117
                $this->IntSquare($i, $j, $aIntFactor);
118
            }
119
        }
120
121
        return $this->data;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->data returns the type array which is incompatible with the documented return type Amenadiel\JpGraph\Plot\the.
Loading history...
122
    }
123
}
124