Issues (72)

Security Analysis    no request data  

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

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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.

assets/js/src/fields.js (6 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
Amarkal.settings.fields = {
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
2
    $form: null,
3
    $fields: null,
4
    init: function () {
5
        this.$form = $('#amarkal-settings-form');
6
        this.$fields = this.$form.find('.amarkal-settings-field');
7
8
        var _this = this;
9
        $('.amarkal-ui-component').on('amarkal.change',function(e, component){
10
            if($(this).amarkalUIComponent('changed')) {
11
                Amarkal.settings.fields.flag('notice', component.props.name);
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
12
                Amarkal.settings.sections.flag('notice', component.props.section);
13
                Amarkal.settings.notifier.notice("Settings have changed, click \"Save\" to apply them.");
14
            }
15
            else {
16
                Amarkal.settings.fields.unflag('notice', component.props.name);
17
            }
18
            
19
            if(!Amarkal.settings.sections.changed(component.props.section)) {
20
                Amarkal.settings.sections.unflag('notice', component.props.section);
21
            }
22
23
            if(!_this.$form.amarkalUIForm('changed')) {
24
                Amarkal.settings.notifier.clearNotifications();
25
            }
26
        }).on('amarkal.hide', function(){
27
            Amarkal.settings.fields.hide($(this).parents('.amarkal-settings-field'));
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
28
        }).on('amarkal.show', function(){
29
            if($(this).parents('.amarkal-settings-field').attr('data-section') === Amarkal.settings.sections.activeSection) {
0 ignored issues
show
The variable Amarkal seems to be never declared. If this is a global, consider adding a /** global: Amarkal */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
30
                Amarkal.settings.fields.show($(this).parents('.amarkal-settings-field'));
31
            }
32
        });
33
    },
34
    search: function(query) {
35
        var matches  = [];
36
        var $form    = this.$form;
37
        
38
        this.$fields.each(function(){
39
            var $field = $(this),
40
                name   =  $field.attr('data-name'),
41
                title  = $field.find('h3').text().toLowerCase(),
42
                help   = $field.find('.help-content').text();
43
                description = $field.find('.description').text();
0 ignored issues
show
The variable description seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.description.
Loading history...
44
45
            // Don't add fields that are currently hidden
46
            if('' !== name && !$form.amarkalUIForm('isVisible', name)) return;
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
47
48
            // Check query against the field's title
49
            if(title.match(query) || description.match(query) || help.match(query)) {
50
                matches.push($field);
51
            }
52
        });
53
54
        // Convert the matches array to a jQuery object
55
        return $(matches).map(function(){return this.toArray();});
56
    },
57
    show: function($fields) {
58
        var _this = this;
59
        $fields.each(function(){
60
            var $comp = $(this).find('.amarkal-ui-component'),
61
                name  = $comp.amarkalUIComponent('getName');
62
63
            // Only show components whose visibility condition is satisfied
64
            if(!name || _this.$form.amarkalUIForm('isVisible', name)) {
65
                $(this).addClass('visible');
66
                $comp.amarkalUIComponent('refresh');
67
            }
68
        });
69
    },
70
    hide: function($fields) {
71
        $fields.removeClass('visible');
72
    },
73
    hideAll: function () {
74
        this.hide(this.$fields);
75
    },
76
    showAll: function () {
77
        this.show(this.$fields);
78
    },
79
    flag: function(type, fieldName) {
80
        this.$fields.filter('[data-name="'+fieldName+'"]').addClass('flag-'+type);
81
    },
82
    unflag: function(type, fieldName) {
83
        this.$fields.filter('[data-name="'+fieldName+'"]').removeClass('flag-'+type);
84
    },
85
    unflagAll: function() {
86
        this.$fields.removeClass('flag-error flag-notice');
87
    }
88
};