code: @SuppressWarnings({"fallthrough"})
  	@Override
  	public int startScan(String displayName, Target target, User user, Object[] customConfigurations) {
  		switch (Control.getSingleton().getMode()) {
  		case safe:
  			throw new IllegalStateException("Scans are not allowed in Safe mode");
  		case protect:
  			String uri = getTargetUriOutOfScope(target, customConfigurations);
  			if (uri != null) {
  				throw new IllegalStateException("Scans are not allowed on targets not in scope when in Protected mode: " + uri);
  			}
  			//$FALL-THROUGH$
  		case standard:
  		case attack:
  			// No problem
  			break;
  		}
  
  		int id = this.scanController.startScan(displayName, target, user, customConfigurations);
      	if (View.isInitialised()) {
      		addScanToUi(this.scanController.getScan(id));
      	}
      	return id;
  	}
docs: Starts a new spider scan, with the given display name, using the given target and, optionally, spidering from the
  perspective of a user and with custom configurations.
  <p>
  <strong>Note:</strong> The preferred method to start the scan is with {@link #startScan(Target, User, Object[])}, unless
  a custom display name is really needed.
  
  @param target the target that will be spidered
  @param user the user that will be used to spider, might be {@code null}
  @param customConfigurations other custom configurations for the spider, might be {@code null}
  @return the ID of the spider scan
  @throws IllegalStateException if the target or custom configurations are not allowed in the current
  {@link org.parosproxy.paros.control.Control.Mode mode}.