core/com.nokia.carbide.cpp.codescanner/src/com/nokia/carbide/cpp/internal/codescanner/config/CSConfigSettings.java
author Ed Swartz <ed.swartz@nokia.com>
Fri, 04 Dec 2009 08:33:28 -0600
changeset 630 dee2f67c6538
parent 33 2d1c891725ea
permissions -rw-r--r--
More Linux porting changes. Use HostOS.EXE_EXT to select the Win32 ".exe" suffix in executable filenames.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
/*
cawthron
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
cawthron
parents:
diff changeset
     3
* All rights reserved.
cawthron
parents:
diff changeset
     4
* This component and the accompanying materials are made available
cawthron
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
cawthron
parents:
diff changeset
     6
* which accompanies this distribution, and is available
cawthron
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
cawthron
parents:
diff changeset
     8
*
cawthron
parents:
diff changeset
     9
* Initial Contributors:
cawthron
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
cawthron
parents:
diff changeset
    11
*
cawthron
parents:
diff changeset
    12
* Contributors:
cawthron
parents:
diff changeset
    13
*
cawthron
parents:
diff changeset
    14
* Description: 
cawthron
parents:
diff changeset
    15
*
cawthron
parents:
diff changeset
    16
*/
cawthron
parents:
diff changeset
    17
cawthron
parents:
diff changeset
    18
package com.nokia.carbide.cpp.internal.codescanner.config;
cawthron
parents:
diff changeset
    19
cawthron
parents:
diff changeset
    20
import java.io.File;
cawthron
parents:
diff changeset
    21
import java.io.IOException;
cawthron
parents:
diff changeset
    22
import java.net.URISyntaxException;
cawthron
parents:
diff changeset
    23
import java.util.List;
cawthron
parents:
diff changeset
    24
cawthron
parents:
diff changeset
    25
import org.eclipse.emf.common.util.EList;
cawthron
parents:
diff changeset
    26
import org.eclipse.jface.dialogs.MessageDialog;
cawthron
parents:
diff changeset
    27
import org.eclipse.ui.IWorkbenchWindow;
cawthron
parents:
diff changeset
    28
import org.eclipse.ui.PlatformUI;
cawthron
parents:
diff changeset
    29
cawthron
parents:
diff changeset
    30
import com.nokia.carbide.cpp.internal.codescanner.Messages;
cawthron
parents:
diff changeset
    31
import com.nokia.carbide.cpp.internal.codescanner.gen.CSConfig.*;
cawthron
parents:
diff changeset
    32
import com.nokia.carbide.cpp.internal.codescanner.xml.CSConfigXMLLoader;
cawthron
parents:
diff changeset
    33
cawthron
parents:
diff changeset
    34
/**
cawthron
parents:
diff changeset
    35
 * A class for handling CodeScanner configuration settings.
cawthron
parents:
diff changeset
    36
 *
cawthron
parents:
diff changeset
    37
 */
cawthron
parents:
diff changeset
    38
public class CSConfigSettings {
cawthron
parents:
diff changeset
    39
cawthron
parents:
diff changeset
    40
	private CodescannerConfigType csConfig;
cawthron
parents:
diff changeset
    41
cawthron
parents:
diff changeset
    42
	/**
cawthron
parents:
diff changeset
    43
	 * The constructor.
cawthron
parents:
diff changeset
    44
	 */
cawthron
parents:
diff changeset
    45
	public CSConfigSettings() {
cawthron
parents:
diff changeset
    46
		csConfig = null;
cawthron
parents:
diff changeset
    47
	}
cawthron
parents:
diff changeset
    48
	
cawthron
parents:
diff changeset
    49
	/**
cawthron
parents:
diff changeset
    50
	 * Create the default CodeScanner configuration settings.
cawthron
parents:
diff changeset
    51
	 */
cawthron
parents:
diff changeset
    52
	public void loadDefaultConfig() {
cawthron
parents:
diff changeset
    53
		CodescannerConfigType config = CSConfigFactory.eINSTANCE.createCodescannerConfigType();
cawthron
parents:
diff changeset
    54
		config.setArguments(createDefaultArguments());
cawthron
parents:
diff changeset
    55
		config.setCategories(createDefaultCategories());
cawthron
parents:
diff changeset
    56
		config.setCustomrules(createDefaultCustomRules());
cawthron
parents:
diff changeset
    57
		config.setScripts(createDefaultScripts());
cawthron
parents:
diff changeset
    58
		config.setSeverities(createDefaultSeverities());
cawthron
parents:
diff changeset
    59
		config.setSources(createDefaultSources());
cawthron
parents:
diff changeset
    60
		csConfig = config;
cawthron
parents:
diff changeset
    61
	}
cawthron
parents:
diff changeset
    62
cawthron
parents:
diff changeset
    63
	/**
cawthron
parents:
diff changeset
    64
	 * Load CodeScanner configuration settings from a file.
cawthron
parents:
diff changeset
    65
	 * @param configFile - file containing CodeScanner configuration settings.
cawthron
parents:
diff changeset
    66
	 * @return true on success
cawthron
parents:
diff changeset
    67
	 */
cawthron
parents:
diff changeset
    68
	public boolean loadConfig(File configFile) {
cawthron
parents:
diff changeset
    69
		if (configFile == null)
cawthron
parents:
diff changeset
    70
			return false;
cawthron
parents:
diff changeset
    71
		boolean success = true;
cawthron
parents:
diff changeset
    72
		try {
cawthron
parents:
diff changeset
    73
			this.csConfig = CSConfigXMLLoader.loadCSConfig(configFile.toURL());	
cawthron
parents:
diff changeset
    74
			success = (this.csConfig != null);
cawthron
parents:
diff changeset
    75
		}
cawthron
parents:
diff changeset
    76
		catch (URISyntaxException eURI){
cawthron
parents:
diff changeset
    77
			eURI.printStackTrace();
cawthron
parents:
diff changeset
    78
			loadConfigError(configFile.getName(), eURI.getMessage());
cawthron
parents:
diff changeset
    79
			success = false;
cawthron
parents:
diff changeset
    80
		}
cawthron
parents:
diff changeset
    81
		catch (IOException eIO){
cawthron
parents:
diff changeset
    82
			eIO.printStackTrace();
cawthron
parents:
diff changeset
    83
			loadConfigError(configFile.getName(), eIO.getMessage());
cawthron
parents:
diff changeset
    84
			success = false;
cawthron
parents:
diff changeset
    85
		}
cawthron
parents:
diff changeset
    86
		return success;
cawthron
parents:
diff changeset
    87
	}
cawthron
parents:
diff changeset
    88
cawthron
parents:
diff changeset
    89
	/**
cawthron
parents:
diff changeset
    90
	 * Save CodeScanner configuration settings to a file.
cawthron
parents:
diff changeset
    91
	 * @param configFile - file to write CodeScanner configuration settings.
cawthron
parents:
diff changeset
    92
	 * @return true on success
cawthron
parents:
diff changeset
    93
	 */
cawthron
parents:
diff changeset
    94
	public boolean saveConfig(File configFile) {
cawthron
parents:
diff changeset
    95
		if (configFile == null)
cawthron
parents:
diff changeset
    96
			return false;
cawthron
parents:
diff changeset
    97
		boolean success = true;
cawthron
parents:
diff changeset
    98
		try {
cawthron
parents:
diff changeset
    99
			if (this.csConfig != null) {
cawthron
parents:
diff changeset
   100
				configFile.createNewFile();
cawthron
parents:
diff changeset
   101
				success = CSConfigXMLLoader.writeCSConfig(this.csConfig, configFile.toURL());
cawthron
parents:
diff changeset
   102
			}
cawthron
parents:
diff changeset
   103
			else
cawthron
parents:
diff changeset
   104
				success = false;
cawthron
parents:
diff changeset
   105
		}
cawthron
parents:
diff changeset
   106
		catch (URISyntaxException eURI){
cawthron
parents:
diff changeset
   107
			eURI.printStackTrace();
cawthron
parents:
diff changeset
   108
			saveConfigError(configFile.getName(), eURI.getMessage());
cawthron
parents:
diff changeset
   109
			success = false;
cawthron
parents:
diff changeset
   110
		}
cawthron
parents:
diff changeset
   111
		catch (IOException eIO){
cawthron
parents:
diff changeset
   112
			eIO.printStackTrace();
cawthron
parents:
diff changeset
   113
			saveConfigError(configFile.getName(), eIO.getMessage());
cawthron
parents:
diff changeset
   114
			success = false;
cawthron
parents:
diff changeset
   115
		}
cawthron
parents:
diff changeset
   116
		return success;
cawthron
parents:
diff changeset
   117
	}
cawthron
parents:
diff changeset
   118
cawthron
parents:
diff changeset
   119
	/**
cawthron
parents:
diff changeset
   120
	 * Retrieve entire CodeScanner configuration settings
cawthron
parents:
diff changeset
   121
	 * @return CodeScanner configuration settings
cawthron
parents:
diff changeset
   122
	 */
cawthron
parents:
diff changeset
   123
	public CodescannerConfigType getConfig() {
cawthron
parents:
diff changeset
   124
		return this.csConfig;
cawthron
parents:
diff changeset
   125
	}
cawthron
parents:
diff changeset
   126
cawthron
parents:
diff changeset
   127
	/**
cawthron
parents:
diff changeset
   128
	 * Set entire CodeScanner configuration settings
cawthron
parents:
diff changeset
   129
	 * @param config - new configuration settings
cawthron
parents:
diff changeset
   130
	 */
cawthron
parents:
diff changeset
   131
	public void setConfig(CodescannerConfigType config) {
cawthron
parents:
diff changeset
   132
		this.csConfig = config;
cawthron
parents:
diff changeset
   133
	}
cawthron
parents:
diff changeset
   134
cawthron
parents:
diff changeset
   135
	/**
cawthron
parents:
diff changeset
   136
	 * Retrieve CodeScanner arguments
cawthron
parents:
diff changeset
   137
	 * @return CodeScanner arguments
cawthron
parents:
diff changeset
   138
	 */
cawthron
parents:
diff changeset
   139
	public ArgumentsType getArguments() {
cawthron
parents:
diff changeset
   140
		return this.csConfig.getArguments();
cawthron
parents:
diff changeset
   141
	}
cawthron
parents:
diff changeset
   142
cawthron
parents:
diff changeset
   143
	/**
cawthron
parents:
diff changeset
   144
	 * Set CodeScanner arguments
cawthron
parents:
diff changeset
   145
	 * @param arguments - new arguments
cawthron
parents:
diff changeset
   146
	 */
cawthron
parents:
diff changeset
   147
	public void setArguments(ArgumentsType arguments) {
cawthron
parents:
diff changeset
   148
		this.csConfig.setArguments(arguments);
cawthron
parents:
diff changeset
   149
	}
cawthron
parents:
diff changeset
   150
cawthron
parents:
diff changeset
   151
	/**
cawthron
parents:
diff changeset
   152
	 * Retrieve a CodeScanner argument.
cawthron
parents:
diff changeset
   153
	 * @param argument - argument element containing the attribute
cawthron
parents:
diff changeset
   154
	 * @return argument element
cawthron
parents:
diff changeset
   155
	 */
cawthron
parents:
diff changeset
   156
	public Object getArgument(CSArgument argument) {
cawthron
parents:
diff changeset
   157
		switch (argument) {
cawthron
parents:
diff changeset
   158
			case argument_input:
cawthron
parents:
diff changeset
   159
				return this.csConfig.getArguments().getInput();
cawthron
parents:
diff changeset
   160
			case argument_lxr:
cawthron
parents:
diff changeset
   161
				return this.csConfig.getArguments().getLxr();
cawthron
parents:
diff changeset
   162
			case argument_lxrversion:
cawthron
parents:
diff changeset
   163
				return this.csConfig.getArguments().getLxrversion();
cawthron
parents:
diff changeset
   164
			case argument_outputformat:
cawthron
parents:
diff changeset
   165
				return this.csConfig.getArguments().getOutputformat();
cawthron
parents:
diff changeset
   166
			case argument_timestampedoutput:
cawthron
parents:
diff changeset
   167
				return this.csConfig.getArguments().getTimestampedoutput();
cawthron
parents:
diff changeset
   168
			case argument_unknown:
cawthron
parents:
diff changeset
   169
			default:
cawthron
parents:
diff changeset
   170
				return null;
cawthron
parents:
diff changeset
   171
		}
cawthron
parents:
diff changeset
   172
	}
cawthron
parents:
diff changeset
   173
cawthron
parents:
diff changeset
   174
	/**
cawthron
parents:
diff changeset
   175
	 * Set values of the "input" arguments
cawthron
parents:
diff changeset
   176
	 * @param inputPaths - new values
cawthron
parents:
diff changeset
   177
	 */
cawthron
parents:
diff changeset
   178
	public void setInputArguments(List<String> inputPaths) {
cawthron
parents:
diff changeset
   179
		EList<String> inputArgumentList = this.csConfig.getArguments().getInput();
cawthron
parents:
diff changeset
   180
		inputArgumentList.clear();
cawthron
parents:
diff changeset
   181
		if (inputPaths != null) {
cawthron
parents:
diff changeset
   182
			for (String inputPath : inputPaths) {
cawthron
parents:
diff changeset
   183
				inputArgumentList.add(inputPath);
cawthron
parents:
diff changeset
   184
			}
cawthron
parents:
diff changeset
   185
		}
cawthron
parents:
diff changeset
   186
	}
cawthron
parents:
diff changeset
   187
cawthron
parents:
diff changeset
   188
	/**
cawthron
parents:
diff changeset
   189
	 * Set value of the "lxr" argument
cawthron
parents:
diff changeset
   190
	 * @param value - new value
cawthron
parents:
diff changeset
   191
	 */
cawthron
parents:
diff changeset
   192
	public void setLxrArgument(String value) {
cawthron
parents:
diff changeset
   193
		this.csConfig.getArguments().setLxr(value);
cawthron
parents:
diff changeset
   194
	}
cawthron
parents:
diff changeset
   195
cawthron
parents:
diff changeset
   196
	/**
cawthron
parents:
diff changeset
   197
	 * Set value of the "lxrversion" argument
cawthron
parents:
diff changeset
   198
	 * @param value - new value
cawthron
parents:
diff changeset
   199
	 */
cawthron
parents:
diff changeset
   200
	public void setLxrVersionArgument(String value) {
cawthron
parents:
diff changeset
   201
		this.csConfig.getArguments().setLxrversion(value);
cawthron
parents:
diff changeset
   202
	}
cawthron
parents:
diff changeset
   203
cawthron
parents:
diff changeset
   204
	/**
cawthron
parents:
diff changeset
   205
	 * Set value of the "outputformat" argument
cawthron
parents:
diff changeset
   206
	 * @param value - new value
cawthron
parents:
diff changeset
   207
	 */
cawthron
parents:
diff changeset
   208
	public void setOutputFormatArgument(String value) {
cawthron
parents:
diff changeset
   209
		this.csConfig.getArguments().setOutputformat(value);
cawthron
parents:
diff changeset
   210
	}
cawthron
parents:
diff changeset
   211
cawthron
parents:
diff changeset
   212
	/**
cawthron
parents:
diff changeset
   213
	 * Set value of the "timestampedoutput" argument
cawthron
parents:
diff changeset
   214
	 * @param value - new value
cawthron
parents:
diff changeset
   215
	 */
cawthron
parents:
diff changeset
   216
	public void setTimeStampedOutputArgument(String value) {
cawthron
parents:
diff changeset
   217
		this.csConfig.getArguments().setTimestampedoutput(value);
cawthron
parents:
diff changeset
   218
	}
cawthron
parents:
diff changeset
   219
cawthron
parents:
diff changeset
   220
	/**
cawthron
parents:
diff changeset
   221
	 * Retrieve the custom rules
cawthron
parents:
diff changeset
   222
	 * @return custom rules
cawthron
parents:
diff changeset
   223
	 */
cawthron
parents:
diff changeset
   224
	public CustomrulesType getCustomRules() {
cawthron
parents:
diff changeset
   225
		return this.csConfig.getCustomrules();
cawthron
parents:
diff changeset
   226
	}
cawthron
parents:
diff changeset
   227
cawthron
parents:
diff changeset
   228
	/**
cawthron
parents:
diff changeset
   229
	 * Set the custom rules
cawthron
parents:
diff changeset
   230
	 * @param customRules - new set of custom rules
cawthron
parents:
diff changeset
   231
	 */
cawthron
parents:
diff changeset
   232
	public void SetCustomRules(CustomrulesType customRules) {
cawthron
parents:
diff changeset
   233
		this.csConfig.setCustomrules(customRules);
cawthron
parents:
diff changeset
   234
	}
cawthron
parents:
diff changeset
   235
cawthron
parents:
diff changeset
   236
	/**
cawthron
parents:
diff changeset
   237
	 * Retrieve CodeScanner script category settings
cawthron
parents:
diff changeset
   238
	 * @return CodeScanner script category settings
cawthron
parents:
diff changeset
   239
	 */
cawthron
parents:
diff changeset
   240
	public CategoriesType getCategories() {
cawthron
parents:
diff changeset
   241
		return this.csConfig.getCategories();
cawthron
parents:
diff changeset
   242
	}
cawthron
parents:
diff changeset
   243
cawthron
parents:
diff changeset
   244
	/**
cawthron
parents:
diff changeset
   245
	 * Set CodeScanner script category settings
cawthron
parents:
diff changeset
   246
	 * @param categories - new script category settings
cawthron
parents:
diff changeset
   247
	 */
cawthron
parents:
diff changeset
   248
	public void setCategories(CategoriesType categories) {
cawthron
parents:
diff changeset
   249
		this.csConfig.setCategories(categories);
cawthron
parents:
diff changeset
   250
	}
cawthron
parents:
diff changeset
   251
cawthron
parents:
diff changeset
   252
	/**
cawthron
parents:
diff changeset
   253
	 * Retrieve CodeScanner script settings
cawthron
parents:
diff changeset
   254
	 * @return CodeScanner script settings
cawthron
parents:
diff changeset
   255
	 */
cawthron
parents:
diff changeset
   256
	public ScriptsType getScripts() {
cawthron
parents:
diff changeset
   257
		return this.csConfig.getScripts();
cawthron
parents:
diff changeset
   258
	}
cawthron
parents:
diff changeset
   259
cawthron
parents:
diff changeset
   260
	/**
cawthron
parents:
diff changeset
   261
	 * Set CodeScanner script settings
cawthron
parents:
diff changeset
   262
	 * @param scripts - new script settings
cawthron
parents:
diff changeset
   263
	 */
cawthron
parents:
diff changeset
   264
	public void setScripts(ScriptsType scripts) {
cawthron
parents:
diff changeset
   265
		this.csConfig.setScripts(scripts);
cawthron
parents:
diff changeset
   266
	}
cawthron
parents:
diff changeset
   267
cawthron
parents:
diff changeset
   268
	/**
cawthron
parents:
diff changeset
   269
	 * Retrieve CodeScanner script severity settings
cawthron
parents:
diff changeset
   270
	 * @return CodeScanner script severity settings
cawthron
parents:
diff changeset
   271
	 */
cawthron
parents:
diff changeset
   272
	public SeveritiesType getSeverities() {
cawthron
parents:
diff changeset
   273
		return this.csConfig.getSeverities();
cawthron
parents:
diff changeset
   274
	}
cawthron
parents:
diff changeset
   275
cawthron
parents:
diff changeset
   276
	/**
cawthron
parents:
diff changeset
   277
	 * Set CodeScanner script severity settings
cawthron
parents:
diff changeset
   278
	 * @param severities - new script severity settings
cawthron
parents:
diff changeset
   279
	 */
cawthron
parents:
diff changeset
   280
	public void setSeverities(SeveritiesType severities) {
cawthron
parents:
diff changeset
   281
		this.csConfig.setSeverities(severities);
cawthron
parents:
diff changeset
   282
	}
cawthron
parents:
diff changeset
   283
cawthron
parents:
diff changeset
   284
	/**
cawthron
parents:
diff changeset
   285
	 * Retrieve CodeScanner source filter settings
cawthron
parents:
diff changeset
   286
	 * @return CodeScanner source filter settings
cawthron
parents:
diff changeset
   287
	 */
cawthron
parents:
diff changeset
   288
	public SourcesType getSourceFilters() {
cawthron
parents:
diff changeset
   289
		return this.csConfig.getSources();
cawthron
parents:
diff changeset
   290
	}
cawthron
parents:
diff changeset
   291
cawthron
parents:
diff changeset
   292
	/**
cawthron
parents:
diff changeset
   293
	 * Set CodeScanner source filter settings
cawthron
parents:
diff changeset
   294
	 * @param sourcefilters - new source filter settings
cawthron
parents:
diff changeset
   295
	 */
cawthron
parents:
diff changeset
   296
	public void setSourceFilters(SourcesType sourcefilters) {
cawthron
parents:
diff changeset
   297
		this.csConfig.setSources(sourcefilters);
cawthron
parents:
diff changeset
   298
	}
cawthron
parents:
diff changeset
   299
cawthron
parents:
diff changeset
   300
	/**
cawthron
parents:
diff changeset
   301
	 * Retrieve a CodeScanner script element
cawthron
parents:
diff changeset
   302
	 * @param script - script element containing the attribute
cawthron
parents:
diff changeset
   303
	 * @return script element
cawthron
parents:
diff changeset
   304
	 */
cawthron
parents:
diff changeset
   305
	public Object getScript(CSScript script) {
cawthron
parents:
diff changeset
   306
		switch (script) {
cawthron
parents:
diff changeset
   307
			case script_accessArrayElementWithoutCheck:
cawthron
parents:
diff changeset
   308
				return this.csConfig.getScripts().getAccessArrayElementWithoutCheck();
cawthron
parents:
diff changeset
   309
			case script_accessArrayElementWithoutCheck2:
cawthron
parents:
diff changeset
   310
				return this.csConfig.getScripts().getAccessArrayElementWithoutCheck2();
cawthron
parents:
diff changeset
   311
			case script_activestart:
cawthron
parents:
diff changeset
   312
				return this.csConfig.getScripts().getActivestart();
cawthron
parents:
diff changeset
   313
			case script_activestop:
cawthron
parents:
diff changeset
   314
				return this.csConfig.getScripts().getActivestop();
cawthron
parents:
diff changeset
   315
			case script_arraypassing:
cawthron
parents:
diff changeset
   316
				return this.csConfig.getScripts().getArraypassing();
cawthron
parents:
diff changeset
   317
			case script_arrayptrcleanup:
cawthron
parents:
diff changeset
   318
				return this.csConfig.getScripts().getArrayptrcleanup();
cawthron
parents:
diff changeset
   319
			case script_assertdebuginvariant:
cawthron
parents:
diff changeset
   320
				return this.csConfig.getScripts().getAssertdebuginvariant();
cawthron
parents:
diff changeset
   321
			case script_baddefines:
cawthron
parents:
diff changeset
   322
				return this.csConfig.getScripts().getBaddefines();
cawthron
parents:
diff changeset
   323
			case script_baseconstruct:
cawthron
parents:
diff changeset
   324
				return this.csConfig.getScripts().getBaseconstruct();
cawthron
parents:
diff changeset
   325
			case script_callActiveObjectWithoutCheckingOrStopping:
cawthron
parents:
diff changeset
   326
				return this.csConfig.getScripts().getCallActiveObjectWithoutCheckingOrStopping();
cawthron
parents:
diff changeset
   327
			case script_changenotification:
cawthron
parents:
diff changeset
   328
				return this.csConfig.getScripts().getChangenotification();
cawthron
parents:
diff changeset
   329
			case script_cleanup:
cawthron
parents:
diff changeset
   330
				return this.csConfig.getScripts().getCleanup();
cawthron
parents:
diff changeset
   331
			case script_commentcode:
cawthron
parents:
diff changeset
   332
				return this.csConfig.getScripts().getCommentcode();
cawthron
parents:
diff changeset
   333
			case script_connect:
cawthron
parents:
diff changeset
   334
				return this.csConfig.getScripts().getConnect();
cawthron
parents:
diff changeset
   335
			case script_ConnectAndDontCloseMemberVariable:
cawthron
parents:
diff changeset
   336
				return this.csConfig.getScripts().getConnectAndDontCloseMemberVariable();
cawthron
parents:
diff changeset
   337
			case script_constnames:
cawthron
parents:
diff changeset
   338
				return this.csConfig.getScripts().getConstnames();
cawthron
parents:
diff changeset
   339
			case script_consttdescptr:
cawthron
parents:
diff changeset
   340
				return this.csConfig.getScripts().getConsttdescptr();
cawthron
parents:
diff changeset
   341
			case script_controlornull:
cawthron
parents:
diff changeset
   342
				return this.csConfig.getScripts().getControlornull();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   343
			case script_crepository:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   344
				return this.csConfig.getScripts().getCrepository();
2
cawthron
parents:
diff changeset
   345
			case script_ctltargettype:
cawthron
parents:
diff changeset
   346
				return this.csConfig.getScripts().getCtltargettype();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   347
			case script_customizableicons:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   348
				return this.csConfig.getScripts().getCustomizableicons();
2
cawthron
parents:
diff changeset
   349
			case script_debugrom:
cawthron
parents:
diff changeset
   350
				return this.csConfig.getScripts().getDebugrom();
cawthron
parents:
diff changeset
   351
			case script_declarename:
cawthron
parents:
diff changeset
   352
				return this.csConfig.getScripts().getDeclarename();
cawthron
parents:
diff changeset
   353
			case script_deleteMemberVariable:
cawthron
parents:
diff changeset
   354
				return this.csConfig.getScripts().getDeleteMemberVariable();
cawthron
parents:
diff changeset
   355
			case script_destructor:
cawthron
parents:
diff changeset
   356
				return this.csConfig.getScripts().getDestructor();
cawthron
parents:
diff changeset
   357
			case script_doubleSemiColon:
cawthron
parents:
diff changeset
   358
				return this.csConfig.getScripts().getDoubleSemiColon();
cawthron
parents:
diff changeset
   359
			case script_driveletters:
cawthron
parents:
diff changeset
   360
				return this.csConfig.getScripts().getDriveletters();
cawthron
parents:
diff changeset
   361
			case script_eikbuttons:
cawthron
parents:
diff changeset
   362
				return this.csConfig.getScripts().getEikbuttons();
cawthron
parents:
diff changeset
   363
			case script_eikonenvstatic:
cawthron
parents:
diff changeset
   364
				return this.csConfig.getScripts().getEikonenvstatic();
cawthron
parents:
diff changeset
   365
			case script_enummembers:
cawthron
parents:
diff changeset
   366
				return this.csConfig.getScripts().getEnummembers();
cawthron
parents:
diff changeset
   367
			case script_enumnames:
cawthron
parents:
diff changeset
   368
				return this.csConfig.getScripts().getEnumnames();
cawthron
parents:
diff changeset
   369
			case script_exportinline:
cawthron
parents:
diff changeset
   370
				return this.csConfig.getScripts().getExportinline();
cawthron
parents:
diff changeset
   371
			case script_exportpurevirtual:
cawthron
parents:
diff changeset
   372
				return this.csConfig.getScripts().getExportpurevirtual();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   373
			case script_flags:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   374
				return this.csConfig.getScripts().getFlags();
2
cawthron
parents:
diff changeset
   375
			case script_foff:
cawthron
parents:
diff changeset
   376
				return this.csConfig.getScripts().getFoff();
cawthron
parents:
diff changeset
   377
			case script_forbiddenwords:
cawthron
parents:
diff changeset
   378
				return this.csConfig.getScripts().getForbiddenwords();
cawthron
parents:
diff changeset
   379
			case script_forgottoputptroncleanupstack:
cawthron
parents:
diff changeset
   380
				return this.csConfig.getScripts().getForgottoputptroncleanupstack();
cawthron
parents:
diff changeset
   381
			case script_friend:
cawthron
parents:
diff changeset
   382
				return this.csConfig.getScripts().getFriend();
cawthron
parents:
diff changeset
   383
			case script_goto:
cawthron
parents:
diff changeset
   384
				return this.csConfig.getScripts().getGoto();
cawthron
parents:
diff changeset
   385
			case script_ifassignments:
cawthron
parents:
diff changeset
   386
				return this.csConfig.getScripts().getIfassignments();
cawthron
parents:
diff changeset
   387
			case script_ifpreprocessor:
cawthron
parents:
diff changeset
   388
				return this.csConfig.getScripts().getIfpreprocessor();
cawthron
parents:
diff changeset
   389
			case script_inheritanceorder:
cawthron
parents:
diff changeset
   390
				return this.csConfig.getScripts().getInheritanceorder();
cawthron
parents:
diff changeset
   391
			case script_intleaves:
cawthron
parents:
diff changeset
   392
				return this.csConfig.getScripts().getIntleaves();
cawthron
parents:
diff changeset
   393
			case script_jmp:
cawthron
parents:
diff changeset
   394
				return this.csConfig.getScripts().getJmp();
cawthron
parents:
diff changeset
   395
			case script_leave:
cawthron
parents:
diff changeset
   396
				return this.csConfig.getScripts().getLeave();
cawthron
parents:
diff changeset
   397
			case script_LeaveNoError:
cawthron
parents:
diff changeset
   398
				return this.csConfig.getScripts().getLeaveNoError();
cawthron
parents:
diff changeset
   399
			case script_leavingoperators:
cawthron
parents:
diff changeset
   400
				return this.csConfig.getScripts().getLeavingoperators();
cawthron
parents:
diff changeset
   401
			case script_LFunctionCantLeave:
cawthron
parents:
diff changeset
   402
				return this.csConfig.getScripts().getLFunctionCantLeave();
cawthron
parents:
diff changeset
   403
			case script_longlines: 
cawthron
parents:
diff changeset
   404
				return this.csConfig.getScripts().getLonglines();
cawthron
parents:
diff changeset
   405
			case script_magicnumbers:
cawthron
parents:
diff changeset
   406
				return this.csConfig.getScripts().getMagicnumbers();
cawthron
parents:
diff changeset
   407
			case script_mclassdestructor:
cawthron
parents:
diff changeset
   408
				return this.csConfig.getScripts().getMclassdestructor();
cawthron
parents:
diff changeset
   409
			case script_memberlc:
cawthron
parents:
diff changeset
   410
				return this.csConfig.getScripts().getMemberlc();
cawthron
parents:
diff changeset
   411
			case script_membervariablecallld:
cawthron
parents:
diff changeset
   412
				return this.csConfig.getScripts().getMembervariablecallld();
cawthron
parents:
diff changeset
   413
			case script_missingcancel:
cawthron
parents:
diff changeset
   414
				return this.csConfig.getScripts().getMissingcancel();
cawthron
parents:
diff changeset
   415
			case script_missingcclass:
cawthron
parents:
diff changeset
   416
				return this.csConfig.getScripts().getMissingcclass();
cawthron
parents:
diff changeset
   417
			case script_mmpsourcepath:
cawthron
parents:
diff changeset
   418
				return this.csConfig.getScripts().getMmpsourcepath();
cawthron
parents:
diff changeset
   419
			case script_multilangrsc:
cawthron
parents:
diff changeset
   420
				return this.csConfig.getScripts().getMultilangrsc();
cawthron
parents:
diff changeset
   421
			case script_multipledeclarations:
cawthron
parents:
diff changeset
   422
				return this.csConfig.getScripts().getMultipledeclarations();
cawthron
parents:
diff changeset
   423
			case script_multipleinheritance:
cawthron
parents:
diff changeset
   424
				return this.csConfig.getScripts().getMultipleinheritance();
cawthron
parents:
diff changeset
   425
			case script_mydocs:
cawthron
parents:
diff changeset
   426
				return this.csConfig.getScripts().getMydocs();
cawthron
parents:
diff changeset
   427
			case script_namespace:
cawthron
parents:
diff changeset
   428
				return this.csConfig.getScripts().getNamespace();
cawthron
parents:
diff changeset
   429
			case script_newlreferences:
cawthron
parents:
diff changeset
   430
				return this.csConfig.getScripts().getNewlreferences();
cawthron
parents:
diff changeset
   431
			case script_noleavetrap:
cawthron
parents:
diff changeset
   432
				return this.csConfig.getScripts().getNoleavetrap();
cawthron
parents:
diff changeset
   433
			case script_nonconsthbufc:
cawthron
parents:
diff changeset
   434
				return this.csConfig.getScripts().getNonconsthbufc();
cawthron
parents:
diff changeset
   435
			case script_nonconsttdesc:
cawthron
parents:
diff changeset
   436
				return this.csConfig.getScripts().getNonconsttdesc();
cawthron
parents:
diff changeset
   437
			case script_nonleavenew:
cawthron
parents:
diff changeset
   438
				return this.csConfig.getScripts().getNonleavenew();
cawthron
parents:
diff changeset
   439
			case script_nonunicodeskins:
cawthron
parents:
diff changeset
   440
				return this.csConfig.getScripts().getNonunicodeskins();
cawthron
parents:
diff changeset
   441
			case script_null:
cawthron
parents:
diff changeset
   442
				return this.csConfig.getScripts().getNull();
cawthron
parents:
diff changeset
   443
			case script_open:
cawthron
parents:
diff changeset
   444
				return this.csConfig.getScripts().getOpen();
cawthron
parents:
diff changeset
   445
			case script_pointertoarrays:
cawthron
parents:
diff changeset
   446
				return this.csConfig.getScripts().getPointertoarrays();
cawthron
parents:
diff changeset
   447
			case script_pragmadisable:
cawthron
parents:
diff changeset
   448
				return this.csConfig.getScripts().getPragmadisable();
cawthron
parents:
diff changeset
   449
			case script_pragmamessage:
cawthron
parents:
diff changeset
   450
				return this.csConfig.getScripts().getPragmamessage();
cawthron
parents:
diff changeset
   451
			case script_pragmaother:
cawthron
parents:
diff changeset
   452
				return this.csConfig.getScripts().getPragmaother();
cawthron
parents:
diff changeset
   453
			case script_privateinheritance:
cawthron
parents:
diff changeset
   454
				return this.csConfig.getScripts().getPrivateinheritance();
cawthron
parents:
diff changeset
   455
			case script_pushaddrvar:
cawthron
parents:
diff changeset
   456
				return this.csConfig.getScripts().getPushaddrvar();
cawthron
parents:
diff changeset
   457
			case script_pushmember:
cawthron
parents:
diff changeset
   458
				return this.csConfig.getScripts().getPushmember();
cawthron
parents:
diff changeset
   459
			case script_readresource:
cawthron
parents:
diff changeset
   460
				return this.csConfig.getScripts().getReadresource();
cawthron
parents:
diff changeset
   461
			case script_resourcenotoncleanupstack:
cawthron
parents:
diff changeset
   462
				return this.csConfig.getScripts().getResourcenotoncleanupstack();
cawthron
parents:
diff changeset
   463
			case script_resourcesonheap:
cawthron
parents:
diff changeset
   464
				return this.csConfig.getScripts().getResourcesonheap();
cawthron
parents:
diff changeset
   465
			case script_returndescriptoroutofscope:
cawthron
parents:
diff changeset
   466
				return this.csConfig.getScripts().getReturndescriptoroutofscope();
cawthron
parents:
diff changeset
   467
			case script_rfs:
cawthron
parents:
diff changeset
   468
				return this.csConfig.getScripts().getRfs();
cawthron
parents:
diff changeset
   469
			case script_rssnames:
cawthron
parents:
diff changeset
   470
				return this.csConfig.getScripts().getRssnames();
cawthron
parents:
diff changeset
   471
			case script_stringliterals:
cawthron
parents:
diff changeset
   472
				return this.csConfig.getScripts().getStringliterals();
cawthron
parents:
diff changeset
   473
			case script_stringsinresourcefiles:
cawthron
parents:
diff changeset
   474
				return this.csConfig.getScripts().getStringsinresourcefiles();
cawthron
parents:
diff changeset
   475
			case script_struct:
cawthron
parents:
diff changeset
   476
				return this.csConfig.getScripts().getStruct();
cawthron
parents:
diff changeset
   477
			case script_tcclasses:
cawthron
parents:
diff changeset
   478
				return this.csConfig.getScripts().getTcclasses();
cawthron
parents:
diff changeset
   479
			case script_tclassdestructor:
cawthron
parents:
diff changeset
   480
				return this.csConfig.getScripts().getTclassdestructor();
cawthron
parents:
diff changeset
   481
			case script_todocomments:
cawthron
parents:
diff changeset
   482
				return this.csConfig.getScripts().getTodocomments();
cawthron
parents:
diff changeset
   483
			case script_trapcleanup:
cawthron
parents:
diff changeset
   484
				return this.csConfig.getScripts().getTrapcleanup();
cawthron
parents:
diff changeset
   485
			case script_trapeleave:
cawthron
parents:
diff changeset
   486
				return this.csConfig.getScripts().getTrapeleave();
cawthron
parents:
diff changeset
   487
			case script_traprunl:
cawthron
parents:
diff changeset
   488
				return this.csConfig.getScripts().getTraprunl();
cawthron
parents:
diff changeset
   489
			case script_trspassing:
cawthron
parents:
diff changeset
   490
				return this.csConfig.getScripts().getTrspassing();
cawthron
parents:
diff changeset
   491
			case script_uids:
cawthron
parents:
diff changeset
   492
				return this.csConfig.getScripts().getUids();
cawthron
parents:
diff changeset
   493
			case script_uncompressedaif:
cawthron
parents:
diff changeset
   494
				return this.csConfig.getScripts().getUncompressedaif();
cawthron
parents:
diff changeset
   495
			case script_uncompressedbmp:
cawthron
parents:
diff changeset
   496
				return this.csConfig.getScripts().getUncompressedaif();
cawthron
parents:
diff changeset
   497
			case script_unicodesource:
cawthron
parents:
diff changeset
   498
				return this.csConfig.getScripts(). getUnicodesource();
cawthron
parents:
diff changeset
   499
			case script_userafter:
cawthron
parents:
diff changeset
   500
				return this.csConfig.getScripts().getUserafter();
cawthron
parents:
diff changeset
   501
			case script_userfree:
cawthron
parents:
diff changeset
   502
				return this.csConfig.getScripts().getUserfree();
cawthron
parents:
diff changeset
   503
			case script_userWaitForRequest:
cawthron
parents:
diff changeset
   504
				return this.csConfig.getScripts().getUserWaitForRequest();
cawthron
parents:
diff changeset
   505
			case script_variablenames:
cawthron
parents:
diff changeset
   506
				return this.csConfig.getScripts().getVariablenames();
cawthron
parents:
diff changeset
   507
			case script_voidparameter:
cawthron
parents:
diff changeset
   508
				return this.csConfig.getScripts().getVoidparameter();
cawthron
parents:
diff changeset
   509
			case script_worryingcomments:
cawthron
parents:
diff changeset
   510
				return this.csConfig.getScripts().getWorryingcomments();
cawthron
parents:
diff changeset
   511
			case script_unknown:
cawthron
parents:
diff changeset
   512
			default:
cawthron
parents:
diff changeset
   513
				return null;
cawthron
parents:
diff changeset
   514
		}
cawthron
parents:
diff changeset
   515
	}
cawthron
parents:
diff changeset
   516
cawthron
parents:
diff changeset
   517
	/**
cawthron
parents:
diff changeset
   518
	 * Retrieve the "enabled" attribute of a CodeScanner script element
cawthron
parents:
diff changeset
   519
	 * @param script - script element containing the attribute
cawthron
parents:
diff changeset
   520
	 * @return attribute value
cawthron
parents:
diff changeset
   521
	 */
cawthron
parents:
diff changeset
   522
	public boolean getScriptEnabled(CSScript script) {
cawthron
parents:
diff changeset
   523
		switch (script) {
cawthron
parents:
diff changeset
   524
			case script_accessArrayElementWithoutCheck:
cawthron
parents:
diff changeset
   525
				return this.csConfig.getScripts().getAccessArrayElementWithoutCheck().isEnable();
cawthron
parents:
diff changeset
   526
			case script_accessArrayElementWithoutCheck2:
cawthron
parents:
diff changeset
   527
				return this.csConfig.getScripts().getAccessArrayElementWithoutCheck2().isEnable();
cawthron
parents:
diff changeset
   528
			case script_activestart:
cawthron
parents:
diff changeset
   529
				return this.csConfig.getScripts().getActivestart().isEnable();
cawthron
parents:
diff changeset
   530
			case script_activestop:
cawthron
parents:
diff changeset
   531
				return this.csConfig.getScripts().getActivestop().isEnable();
cawthron
parents:
diff changeset
   532
			case script_arraypassing:
cawthron
parents:
diff changeset
   533
				return this.csConfig.getScripts().getArraypassing().isEnable();
cawthron
parents:
diff changeset
   534
			case script_arrayptrcleanup:
cawthron
parents:
diff changeset
   535
				return this.csConfig.getScripts().getArrayptrcleanup().isEnable();
cawthron
parents:
diff changeset
   536
			case script_assertdebuginvariant:
cawthron
parents:
diff changeset
   537
				return this.csConfig.getScripts().getAssertdebuginvariant().isEnable();
cawthron
parents:
diff changeset
   538
			case script_baddefines:
cawthron
parents:
diff changeset
   539
				return this.csConfig.getScripts().getBaddefines().isEnable();
cawthron
parents:
diff changeset
   540
			case script_baseconstruct:
cawthron
parents:
diff changeset
   541
				return this.csConfig.getScripts().getBaseconstruct().isEnable();
cawthron
parents:
diff changeset
   542
			case script_callActiveObjectWithoutCheckingOrStopping:
cawthron
parents:
diff changeset
   543
				return this.csConfig.getScripts().getCallActiveObjectWithoutCheckingOrStopping().isEnable();
cawthron
parents:
diff changeset
   544
			case script_changenotification:
cawthron
parents:
diff changeset
   545
				return this.csConfig.getScripts().getChangenotification().isEnable();
cawthron
parents:
diff changeset
   546
			case script_cleanup:
cawthron
parents:
diff changeset
   547
				return this.csConfig.getScripts().getCleanup().isEnable();
cawthron
parents:
diff changeset
   548
			case script_commentcode:
cawthron
parents:
diff changeset
   549
				return this.csConfig.getScripts().getCommentcode().isEnable();
cawthron
parents:
diff changeset
   550
			case script_connect:
cawthron
parents:
diff changeset
   551
				return this.csConfig.getScripts().getConnect().isEnable();
cawthron
parents:
diff changeset
   552
			case script_ConnectAndDontCloseMemberVariable:
cawthron
parents:
diff changeset
   553
				return this.csConfig.getScripts().getConnectAndDontCloseMemberVariable().isEnable();
cawthron
parents:
diff changeset
   554
			case script_constnames:
cawthron
parents:
diff changeset
   555
				return this.csConfig.getScripts().getConstnames().isEnable();
cawthron
parents:
diff changeset
   556
			case script_consttdescptr:
cawthron
parents:
diff changeset
   557
				return this.csConfig.getScripts().getConsttdescptr().isEnable();
cawthron
parents:
diff changeset
   558
			case script_controlornull:
cawthron
parents:
diff changeset
   559
				return this.csConfig.getScripts().getControlornull().isEnable();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   560
			case script_crepository:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   561
				return this.csConfig.getScripts().getCrepository().isEnable();
2
cawthron
parents:
diff changeset
   562
			case script_ctltargettype:
cawthron
parents:
diff changeset
   563
				return this.csConfig.getScripts().getCtltargettype().isEnable();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   564
			case script_customizableicons:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   565
				return this.csConfig.getScripts().getCustomizableicons().isEnable();
2
cawthron
parents:
diff changeset
   566
			case script_debugrom:
cawthron
parents:
diff changeset
   567
				return this.csConfig.getScripts().getDebugrom().isEnable();
cawthron
parents:
diff changeset
   568
			case script_declarename:
cawthron
parents:
diff changeset
   569
				return this.csConfig.getScripts().getDeclarename().isEnable();
cawthron
parents:
diff changeset
   570
			case script_deleteMemberVariable:
cawthron
parents:
diff changeset
   571
				return this.csConfig.getScripts().getDeleteMemberVariable().isEnable();
cawthron
parents:
diff changeset
   572
			case script_destructor:
cawthron
parents:
diff changeset
   573
				return this.csConfig.getScripts().getDestructor().isEnable();
cawthron
parents:
diff changeset
   574
			case script_doubleSemiColon:
cawthron
parents:
diff changeset
   575
				return this.csConfig.getScripts().getDoubleSemiColon().isEnable();
cawthron
parents:
diff changeset
   576
			case script_driveletters:
cawthron
parents:
diff changeset
   577
				return this.csConfig.getScripts().getDriveletters().isEnable();
cawthron
parents:
diff changeset
   578
			case script_eikbuttons:
cawthron
parents:
diff changeset
   579
				return this.csConfig.getScripts().getEikbuttons().isEnable();
cawthron
parents:
diff changeset
   580
			case script_eikonenvstatic:
cawthron
parents:
diff changeset
   581
				return this.csConfig.getScripts().getEikonenvstatic().isEnable();
cawthron
parents:
diff changeset
   582
			case script_enummembers:
cawthron
parents:
diff changeset
   583
				return this.csConfig.getScripts().getEnummembers().isEnable();
cawthron
parents:
diff changeset
   584
			case script_enumnames:
cawthron
parents:
diff changeset
   585
				return this.csConfig.getScripts().getEnumnames().isEnable();
cawthron
parents:
diff changeset
   586
			case script_exportinline:
cawthron
parents:
diff changeset
   587
				return this.csConfig.getScripts().getExportinline().isEnable();
cawthron
parents:
diff changeset
   588
			case script_exportpurevirtual:
cawthron
parents:
diff changeset
   589
				return this.csConfig.getScripts().getExportpurevirtual().isEnable();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   590
			case script_flags:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   591
				return this.csConfig.getScripts().getFlags().isEnable();
2
cawthron
parents:
diff changeset
   592
			case script_foff:
cawthron
parents:
diff changeset
   593
				return this.csConfig.getScripts().getFoff().isEnable();
cawthron
parents:
diff changeset
   594
			case script_forbiddenwords:
cawthron
parents:
diff changeset
   595
				return this.csConfig.getScripts().getForbiddenwords().isEnable();
cawthron
parents:
diff changeset
   596
			case script_forgottoputptroncleanupstack:
cawthron
parents:
diff changeset
   597
				return this.csConfig.getScripts().getForgottoputptroncleanupstack().isEnable();
cawthron
parents:
diff changeset
   598
			case script_friend:
cawthron
parents:
diff changeset
   599
				return this.csConfig.getScripts().getFriend().isEnable();
cawthron
parents:
diff changeset
   600
			case script_goto:
cawthron
parents:
diff changeset
   601
				return this.csConfig.getScripts().getGoto().isEnable();
cawthron
parents:
diff changeset
   602
			case script_ifassignments:
cawthron
parents:
diff changeset
   603
				return this.csConfig.getScripts().getIfassignments().isEnable();
cawthron
parents:
diff changeset
   604
			case script_ifpreprocessor:
cawthron
parents:
diff changeset
   605
				return this.csConfig.getScripts().getIfpreprocessor().isEnable();
cawthron
parents:
diff changeset
   606
			case script_inheritanceorder:
cawthron
parents:
diff changeset
   607
				return this.csConfig.getScripts().getInheritanceorder().isEnable();
cawthron
parents:
diff changeset
   608
			case script_intleaves:
cawthron
parents:
diff changeset
   609
				return this.csConfig.getScripts().getIntleaves().isEnable();
cawthron
parents:
diff changeset
   610
			case script_jmp:
cawthron
parents:
diff changeset
   611
				return this.csConfig.getScripts().getJmp().isEnable();
cawthron
parents:
diff changeset
   612
			case script_leave:
cawthron
parents:
diff changeset
   613
				return this.csConfig.getScripts().getLeave().isEnable();
cawthron
parents:
diff changeset
   614
			case script_LeaveNoError:
cawthron
parents:
diff changeset
   615
				return this.csConfig.getScripts().getLeaveNoError().isEnable();
cawthron
parents:
diff changeset
   616
			case script_leavingoperators:
cawthron
parents:
diff changeset
   617
				return this.csConfig.getScripts().getLeavingoperators().isEnable();
cawthron
parents:
diff changeset
   618
			case script_LFunctionCantLeave:
cawthron
parents:
diff changeset
   619
				return this.csConfig.getScripts().getLFunctionCantLeave().isEnable();
cawthron
parents:
diff changeset
   620
			case script_longlines: 
cawthron
parents:
diff changeset
   621
				return this.csConfig.getScripts().getLonglines().isEnable();
cawthron
parents:
diff changeset
   622
			case script_magicnumbers:
cawthron
parents:
diff changeset
   623
				return this.csConfig.getScripts().getMagicnumbers().isEnable();
cawthron
parents:
diff changeset
   624
			case script_mclassdestructor:
cawthron
parents:
diff changeset
   625
				return this.csConfig.getScripts().getMclassdestructor().isEnable();
cawthron
parents:
diff changeset
   626
			case script_memberlc:
cawthron
parents:
diff changeset
   627
				return this.csConfig.getScripts().getMemberlc().isEnable();
cawthron
parents:
diff changeset
   628
			case script_membervariablecallld:
cawthron
parents:
diff changeset
   629
				return this.csConfig.getScripts().getMembervariablecallld().isEnable();
cawthron
parents:
diff changeset
   630
			case script_missingcancel:
cawthron
parents:
diff changeset
   631
				return this.csConfig.getScripts().getMissingcancel().isEnable();
cawthron
parents:
diff changeset
   632
			case script_missingcclass:
cawthron
parents:
diff changeset
   633
				return this.csConfig.getScripts().getMissingcclass().isEnable();
cawthron
parents:
diff changeset
   634
			case script_mmpsourcepath:
cawthron
parents:
diff changeset
   635
				return this.csConfig.getScripts().getMmpsourcepath().isEnable();
cawthron
parents:
diff changeset
   636
			case script_multilangrsc:
cawthron
parents:
diff changeset
   637
				return this.csConfig.getScripts().getMultilangrsc().isEnable();
cawthron
parents:
diff changeset
   638
			case script_multipledeclarations:
cawthron
parents:
diff changeset
   639
				return this.csConfig.getScripts().getMultipledeclarations().isEnable();
cawthron
parents:
diff changeset
   640
			case script_multipleinheritance:
cawthron
parents:
diff changeset
   641
				return this.csConfig.getScripts().getMultipleinheritance().isEnable();
cawthron
parents:
diff changeset
   642
			case script_mydocs:
cawthron
parents:
diff changeset
   643
				return this.csConfig.getScripts().getMydocs().isEnable();
cawthron
parents:
diff changeset
   644
			case script_namespace:
cawthron
parents:
diff changeset
   645
				return this.csConfig.getScripts().getNamespace().isEnable();
cawthron
parents:
diff changeset
   646
			case script_newlreferences:
cawthron
parents:
diff changeset
   647
				return this.csConfig.getScripts().getNewlreferences().isEnable();
cawthron
parents:
diff changeset
   648
			case script_noleavetrap:
cawthron
parents:
diff changeset
   649
				return this.csConfig.getScripts().getNoleavetrap().isEnable();
cawthron
parents:
diff changeset
   650
			case script_nonconsthbufc:
cawthron
parents:
diff changeset
   651
				return this.csConfig.getScripts().getNonconsthbufc().isEnable();
cawthron
parents:
diff changeset
   652
			case script_nonconsttdesc:
cawthron
parents:
diff changeset
   653
				return this.csConfig.getScripts().getNonconsttdesc().isEnable();
cawthron
parents:
diff changeset
   654
			case script_nonleavenew:
cawthron
parents:
diff changeset
   655
				return this.csConfig.getScripts().getNonleavenew().isEnable();
cawthron
parents:
diff changeset
   656
			case script_nonunicodeskins:
cawthron
parents:
diff changeset
   657
				return this.csConfig.getScripts().getNonunicodeskins().isEnable();
cawthron
parents:
diff changeset
   658
			case script_null:
cawthron
parents:
diff changeset
   659
				return this.csConfig.getScripts().getNull().isEnable();
cawthron
parents:
diff changeset
   660
			case script_open:
cawthron
parents:
diff changeset
   661
				return this.csConfig.getScripts().getOpen().isEnable();
cawthron
parents:
diff changeset
   662
			case script_pointertoarrays:
cawthron
parents:
diff changeset
   663
				return this.csConfig.getScripts().getPointertoarrays().isEnable();
cawthron
parents:
diff changeset
   664
			case script_pragmadisable:
cawthron
parents:
diff changeset
   665
				return this.csConfig.getScripts().getPragmadisable().isEnable();
cawthron
parents:
diff changeset
   666
			case script_pragmamessage:
cawthron
parents:
diff changeset
   667
				return this.csConfig.getScripts().getPragmamessage().isEnable();
cawthron
parents:
diff changeset
   668
			case script_pragmaother:
cawthron
parents:
diff changeset
   669
				return this.csConfig.getScripts().getPragmaother().isEnable();
cawthron
parents:
diff changeset
   670
			case script_privateinheritance:
cawthron
parents:
diff changeset
   671
				return this.csConfig.getScripts().getPrivateinheritance().isEnable();
cawthron
parents:
diff changeset
   672
			case script_pushaddrvar:
cawthron
parents:
diff changeset
   673
				return this.csConfig.getScripts().getPushaddrvar().isEnable();
cawthron
parents:
diff changeset
   674
			case script_pushmember:
cawthron
parents:
diff changeset
   675
				return this.csConfig.getScripts().getPushmember().isEnable();
cawthron
parents:
diff changeset
   676
			case script_readresource:
cawthron
parents:
diff changeset
   677
				return this.csConfig.getScripts().getReadresource().isEnable();
cawthron
parents:
diff changeset
   678
			case script_resourcenotoncleanupstack:
cawthron
parents:
diff changeset
   679
				return this.csConfig.getScripts().getResourcenotoncleanupstack().isEnable();
cawthron
parents:
diff changeset
   680
			case script_resourcesonheap:
cawthron
parents:
diff changeset
   681
				return this.csConfig.getScripts().getResourcesonheap().isEnable();
cawthron
parents:
diff changeset
   682
			case script_returndescriptoroutofscope:
cawthron
parents:
diff changeset
   683
				return this.csConfig.getScripts().getReturndescriptoroutofscope().isEnable();
cawthron
parents:
diff changeset
   684
			case script_rfs:
cawthron
parents:
diff changeset
   685
				return this.csConfig.getScripts().getRfs().isEnable();
cawthron
parents:
diff changeset
   686
			case script_rssnames:
cawthron
parents:
diff changeset
   687
				return this.csConfig.getScripts().getRssnames().isEnable();
cawthron
parents:
diff changeset
   688
			case script_stringliterals:
cawthron
parents:
diff changeset
   689
				return this.csConfig.getScripts().getStringliterals().isEnable();
cawthron
parents:
diff changeset
   690
			case script_stringsinresourcefiles:
cawthron
parents:
diff changeset
   691
				return this.csConfig.getScripts().getStringsinresourcefiles().isEnable();
cawthron
parents:
diff changeset
   692
			case script_struct:
cawthron
parents:
diff changeset
   693
				return this.csConfig.getScripts().getStruct().isEnable();
cawthron
parents:
diff changeset
   694
			case script_tcclasses:
cawthron
parents:
diff changeset
   695
				return this.csConfig.getScripts().getTcclasses().isEnable();
cawthron
parents:
diff changeset
   696
			case script_tclassdestructor:
cawthron
parents:
diff changeset
   697
				return this.csConfig.getScripts().getTclassdestructor().isEnable();
cawthron
parents:
diff changeset
   698
			case script_todocomments:
cawthron
parents:
diff changeset
   699
				return this.csConfig.getScripts().getTodocomments().isEnable();
cawthron
parents:
diff changeset
   700
			case script_trapcleanup:
cawthron
parents:
diff changeset
   701
				return this.csConfig.getScripts().getTrapcleanup().isEnable();
cawthron
parents:
diff changeset
   702
			case script_trapeleave:
cawthron
parents:
diff changeset
   703
				return this.csConfig.getScripts().getTrapeleave().isEnable();
cawthron
parents:
diff changeset
   704
			case script_traprunl:
cawthron
parents:
diff changeset
   705
				return this.csConfig.getScripts().getTraprunl().isEnable();
cawthron
parents:
diff changeset
   706
			case script_trspassing:
cawthron
parents:
diff changeset
   707
				return this.csConfig.getScripts().getTrspassing().isEnable();
cawthron
parents:
diff changeset
   708
			case script_uids:
cawthron
parents:
diff changeset
   709
				return this.csConfig.getScripts().getUids().isEnable();
cawthron
parents:
diff changeset
   710
			case script_uncompressedaif:
cawthron
parents:
diff changeset
   711
				return this.csConfig.getScripts().getUncompressedaif().isEnable();
cawthron
parents:
diff changeset
   712
			case script_uncompressedbmp:
cawthron
parents:
diff changeset
   713
				return this.csConfig.getScripts().getUncompressedaif().isEnable();
cawthron
parents:
diff changeset
   714
			case script_unicodesource:
cawthron
parents:
diff changeset
   715
				return this.csConfig.getScripts(). getUnicodesource().isEnable();
cawthron
parents:
diff changeset
   716
			case script_userafter:
cawthron
parents:
diff changeset
   717
				return this.csConfig.getScripts().getUserafter().isEnable();
cawthron
parents:
diff changeset
   718
			case script_userfree:
cawthron
parents:
diff changeset
   719
				return this.csConfig.getScripts().getUserfree().isEnable();
cawthron
parents:
diff changeset
   720
			case script_userWaitForRequest:
cawthron
parents:
diff changeset
   721
				return this.csConfig.getScripts().getUserWaitForRequest().isEnable();
cawthron
parents:
diff changeset
   722
			case script_variablenames:
cawthron
parents:
diff changeset
   723
				return this.csConfig.getScripts().getVariablenames().isEnable();
cawthron
parents:
diff changeset
   724
			case script_voidparameter:
cawthron
parents:
diff changeset
   725
				return this.csConfig.getScripts().getVoidparameter().isEnable();
cawthron
parents:
diff changeset
   726
			case script_worryingcomments:
cawthron
parents:
diff changeset
   727
				return this.csConfig.getScripts().getWorryingcomments().isEnable();
cawthron
parents:
diff changeset
   728
			case script_unknown:
cawthron
parents:
diff changeset
   729
			default:
cawthron
parents:
diff changeset
   730
				return true;
cawthron
parents:
diff changeset
   731
		}
cawthron
parents:
diff changeset
   732
	}
cawthron
parents:
diff changeset
   733
cawthron
parents:
diff changeset
   734
	/**
cawthron
parents:
diff changeset
   735
	 * Set the "enabled" attribute of a CodeScanner script element
cawthron
parents:
diff changeset
   736
	 * @param script - script element containing the attribute
cawthron
parents:
diff changeset
   737
	 * @param value - new attribute value
cawthron
parents:
diff changeset
   738
	 */
cawthron
parents:
diff changeset
   739
	public void setScriptEnabled(CSScript script, boolean value) {
cawthron
parents:
diff changeset
   740
		switch (script) {
cawthron
parents:
diff changeset
   741
			case script_accessArrayElementWithoutCheck:
cawthron
parents:
diff changeset
   742
				this.csConfig.getScripts().getAccessArrayElementWithoutCheck().setEnable(value);
cawthron
parents:
diff changeset
   743
				break;
cawthron
parents:
diff changeset
   744
			case script_accessArrayElementWithoutCheck2:
cawthron
parents:
diff changeset
   745
				this.csConfig.getScripts().getAccessArrayElementWithoutCheck2().setEnable(value);
cawthron
parents:
diff changeset
   746
				break;
cawthron
parents:
diff changeset
   747
			case script_activestart:
cawthron
parents:
diff changeset
   748
				this.csConfig.getScripts().getActivestart().setEnable(value);
cawthron
parents:
diff changeset
   749
				break;
cawthron
parents:
diff changeset
   750
			case script_activestop:
cawthron
parents:
diff changeset
   751
				this.csConfig.getScripts().getActivestop().setEnable(value);
cawthron
parents:
diff changeset
   752
				break;
cawthron
parents:
diff changeset
   753
			case script_arraypassing:
cawthron
parents:
diff changeset
   754
				this.csConfig.getScripts().getArraypassing().setEnable(value);
cawthron
parents:
diff changeset
   755
				break;
cawthron
parents:
diff changeset
   756
			case script_arrayptrcleanup:
cawthron
parents:
diff changeset
   757
				this.csConfig.getScripts().getArrayptrcleanup().setEnable(value);
cawthron
parents:
diff changeset
   758
				break;
cawthron
parents:
diff changeset
   759
			case script_assertdebuginvariant:
cawthron
parents:
diff changeset
   760
				this.csConfig.getScripts().getAssertdebuginvariant().setEnable(value);
cawthron
parents:
diff changeset
   761
				break;
cawthron
parents:
diff changeset
   762
			case script_baddefines:
cawthron
parents:
diff changeset
   763
				this.csConfig.getScripts().getBaddefines().setEnable(value);
cawthron
parents:
diff changeset
   764
				break;
cawthron
parents:
diff changeset
   765
			case script_baseconstruct:
cawthron
parents:
diff changeset
   766
				this.csConfig.getScripts().getBaseconstruct().setEnable(value);
cawthron
parents:
diff changeset
   767
				break;
cawthron
parents:
diff changeset
   768
			case script_callActiveObjectWithoutCheckingOrStopping:
cawthron
parents:
diff changeset
   769
				this.csConfig.getScripts().getCallActiveObjectWithoutCheckingOrStopping().setEnable(value);
cawthron
parents:
diff changeset
   770
				break;
cawthron
parents:
diff changeset
   771
			case script_changenotification:
cawthron
parents:
diff changeset
   772
				this.csConfig.getScripts().getChangenotification().setEnable(value);
cawthron
parents:
diff changeset
   773
				break;
cawthron
parents:
diff changeset
   774
			case script_cleanup:
cawthron
parents:
diff changeset
   775
				this.csConfig.getScripts().getCleanup().setEnable(value);
cawthron
parents:
diff changeset
   776
				break;
cawthron
parents:
diff changeset
   777
			case script_commentcode:
cawthron
parents:
diff changeset
   778
				this.csConfig.getScripts().getCommentcode().setEnable(value);
cawthron
parents:
diff changeset
   779
				break;
cawthron
parents:
diff changeset
   780
			case script_connect:
cawthron
parents:
diff changeset
   781
				this.csConfig.getScripts().getConnect().setEnable(value);
cawthron
parents:
diff changeset
   782
				break;
cawthron
parents:
diff changeset
   783
			case script_ConnectAndDontCloseMemberVariable:
cawthron
parents:
diff changeset
   784
				this.csConfig.getScripts().getConnectAndDontCloseMemberVariable().setEnable(value);
cawthron
parents:
diff changeset
   785
				break;
cawthron
parents:
diff changeset
   786
			case script_constnames:
cawthron
parents:
diff changeset
   787
				this.csConfig.getScripts().getConstnames().setEnable(value);
cawthron
parents:
diff changeset
   788
				break;
cawthron
parents:
diff changeset
   789
			case script_consttdescptr:
cawthron
parents:
diff changeset
   790
				this.csConfig.getScripts().getConsttdescptr().setEnable(value);
cawthron
parents:
diff changeset
   791
				break;
cawthron
parents:
diff changeset
   792
			case script_controlornull:
cawthron
parents:
diff changeset
   793
				this.csConfig.getScripts().getControlornull().setEnable(value);
cawthron
parents:
diff changeset
   794
				break;
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   795
			case script_crepository:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   796
				this.csConfig.getScripts().getCrepository().setEnable(value);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   797
				break;
2
cawthron
parents:
diff changeset
   798
			case script_ctltargettype:
cawthron
parents:
diff changeset
   799
				this.csConfig.getScripts().getCtltargettype().setEnable(value);
cawthron
parents:
diff changeset
   800
				break;
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   801
			case script_customizableicons:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   802
				this.csConfig.getScripts().getCustomizableicons().setEnable(value);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   803
				break;
2
cawthron
parents:
diff changeset
   804
			case script_debugrom:
cawthron
parents:
diff changeset
   805
				this.csConfig.getScripts().getDebugrom().setEnable(value);
cawthron
parents:
diff changeset
   806
				break;
cawthron
parents:
diff changeset
   807
			case script_declarename:
cawthron
parents:
diff changeset
   808
				this.csConfig.getScripts().getDeclarename().setEnable(value);
cawthron
parents:
diff changeset
   809
				break;
cawthron
parents:
diff changeset
   810
			case script_deleteMemberVariable:
cawthron
parents:
diff changeset
   811
				this.csConfig.getScripts().getDeleteMemberVariable().setEnable(value);
cawthron
parents:
diff changeset
   812
				break;
cawthron
parents:
diff changeset
   813
			case script_destructor:
cawthron
parents:
diff changeset
   814
				this.csConfig.getScripts().getDestructor().setEnable(value);
cawthron
parents:
diff changeset
   815
				break;
cawthron
parents:
diff changeset
   816
			case script_doubleSemiColon:
cawthron
parents:
diff changeset
   817
				this.csConfig.getScripts().getDoubleSemiColon().setEnable(value);
cawthron
parents:
diff changeset
   818
				break;
cawthron
parents:
diff changeset
   819
			case script_driveletters:
cawthron
parents:
diff changeset
   820
				this.csConfig.getScripts().getDriveletters().setEnable(value);
cawthron
parents:
diff changeset
   821
				break;
cawthron
parents:
diff changeset
   822
			case script_eikbuttons:
cawthron
parents:
diff changeset
   823
				this.csConfig.getScripts().getEikbuttons().setEnable(value);
cawthron
parents:
diff changeset
   824
				break;
cawthron
parents:
diff changeset
   825
			case script_eikonenvstatic:
cawthron
parents:
diff changeset
   826
				this.csConfig.getScripts().getEikonenvstatic().setEnable(value);
cawthron
parents:
diff changeset
   827
				break;
cawthron
parents:
diff changeset
   828
			case script_enummembers:
cawthron
parents:
diff changeset
   829
				this.csConfig.getScripts().getEnummembers().setEnable(value);
cawthron
parents:
diff changeset
   830
				break;
cawthron
parents:
diff changeset
   831
			case script_enumnames:
cawthron
parents:
diff changeset
   832
				this.csConfig.getScripts().getEnumnames().setEnable(value);
cawthron
parents:
diff changeset
   833
				break;
cawthron
parents:
diff changeset
   834
			case script_exportinline:
cawthron
parents:
diff changeset
   835
				this.csConfig.getScripts().getExportinline().setEnable(value);
cawthron
parents:
diff changeset
   836
				break;
cawthron
parents:
diff changeset
   837
			case script_exportpurevirtual:
cawthron
parents:
diff changeset
   838
				this.csConfig.getScripts().getExportpurevirtual().setEnable(value);
cawthron
parents:
diff changeset
   839
				break;
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   840
			case script_flags:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   841
				this.csConfig.getScripts().getFlags().setEnable(value);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
   842
				break;
2
cawthron
parents:
diff changeset
   843
			case script_foff:
cawthron
parents:
diff changeset
   844
				this.csConfig.getScripts().getFoff().setEnable(value);
cawthron
parents:
diff changeset
   845
				break;
cawthron
parents:
diff changeset
   846
			case script_forbiddenwords:
cawthron
parents:
diff changeset
   847
				this.csConfig.getScripts().getForbiddenwords().setEnable(value);
cawthron
parents:
diff changeset
   848
				break;
cawthron
parents:
diff changeset
   849
			case script_forgottoputptroncleanupstack:
cawthron
parents:
diff changeset
   850
				this.csConfig.getScripts().getForgottoputptroncleanupstack().setEnable(value);
cawthron
parents:
diff changeset
   851
				break;
cawthron
parents:
diff changeset
   852
			case script_friend:
cawthron
parents:
diff changeset
   853
				this.csConfig.getScripts().getFriend().setEnable(value);
cawthron
parents:
diff changeset
   854
				break;
cawthron
parents:
diff changeset
   855
			case script_goto:
cawthron
parents:
diff changeset
   856
				this.csConfig.getScripts().getGoto().setEnable(value);
cawthron
parents:
diff changeset
   857
				break;
cawthron
parents:
diff changeset
   858
			case script_ifassignments:
cawthron
parents:
diff changeset
   859
				this.csConfig.getScripts().getIfassignments().setEnable(value);
cawthron
parents:
diff changeset
   860
				break;
cawthron
parents:
diff changeset
   861
			case script_ifpreprocessor:
cawthron
parents:
diff changeset
   862
				this.csConfig.getScripts().getIfpreprocessor().setEnable(value);
cawthron
parents:
diff changeset
   863
				break;
cawthron
parents:
diff changeset
   864
			case script_inheritanceorder:
cawthron
parents:
diff changeset
   865
				this.csConfig.getScripts().getInheritanceorder().setEnable(value);
cawthron
parents:
diff changeset
   866
				break;
cawthron
parents:
diff changeset
   867
			case script_intleaves:
cawthron
parents:
diff changeset
   868
				this.csConfig.getScripts().getIntleaves().setEnable(value);
cawthron
parents:
diff changeset
   869
				break;
cawthron
parents:
diff changeset
   870
			case script_jmp:
cawthron
parents:
diff changeset
   871
				this.csConfig.getScripts().getJmp().setEnable(value);
cawthron
parents:
diff changeset
   872
				break;
cawthron
parents:
diff changeset
   873
			case script_leave:
cawthron
parents:
diff changeset
   874
				this.csConfig.getScripts().getLeave().setEnable(value);
cawthron
parents:
diff changeset
   875
				break;
cawthron
parents:
diff changeset
   876
			case script_LeaveNoError:
cawthron
parents:
diff changeset
   877
				this.csConfig.getScripts().getLeaveNoError().setEnable(value);
cawthron
parents:
diff changeset
   878
				break;
cawthron
parents:
diff changeset
   879
			case script_leavingoperators:
cawthron
parents:
diff changeset
   880
				this.csConfig.getScripts().getLeavingoperators().setEnable(value);
cawthron
parents:
diff changeset
   881
				break;
cawthron
parents:
diff changeset
   882
			case script_LFunctionCantLeave:
cawthron
parents:
diff changeset
   883
				this.csConfig.getScripts().getLFunctionCantLeave().setEnable(value);
cawthron
parents:
diff changeset
   884
				break;
cawthron
parents:
diff changeset
   885
			case script_longlines: 
cawthron
parents:
diff changeset
   886
				this.csConfig.getScripts().getLonglines().setEnable(value);
cawthron
parents:
diff changeset
   887
				break;
cawthron
parents:
diff changeset
   888
			case script_magicnumbers:
cawthron
parents:
diff changeset
   889
				this.csConfig.getScripts().getMagicnumbers().setEnable(value);
cawthron
parents:
diff changeset
   890
				break;
cawthron
parents:
diff changeset
   891
			case script_mclassdestructor:
cawthron
parents:
diff changeset
   892
				this.csConfig.getScripts().getMclassdestructor().setEnable(value);
cawthron
parents:
diff changeset
   893
				break;
cawthron
parents:
diff changeset
   894
			case script_memberlc:
cawthron
parents:
diff changeset
   895
				this.csConfig.getScripts().getMemberlc().setEnable(value);
cawthron
parents:
diff changeset
   896
				break;
cawthron
parents:
diff changeset
   897
			case script_membervariablecallld:
cawthron
parents:
diff changeset
   898
				this.csConfig.getScripts().getMembervariablecallld().setEnable(value);
cawthron
parents:
diff changeset
   899
				break;
cawthron
parents:
diff changeset
   900
			case script_missingcancel:
cawthron
parents:
diff changeset
   901
				this.csConfig.getScripts().getMissingcancel().setEnable(value);
cawthron
parents:
diff changeset
   902
				break;
cawthron
parents:
diff changeset
   903
			case script_missingcclass:
cawthron
parents:
diff changeset
   904
				this.csConfig.getScripts().getMissingcclass().setEnable(value);
cawthron
parents:
diff changeset
   905
				break;
cawthron
parents:
diff changeset
   906
			case script_mmpsourcepath:
cawthron
parents:
diff changeset
   907
				this.csConfig.getScripts().getMmpsourcepath().setEnable(value);
cawthron
parents:
diff changeset
   908
				break;
cawthron
parents:
diff changeset
   909
			case script_multilangrsc:
cawthron
parents:
diff changeset
   910
				this.csConfig.getScripts().getMultilangrsc().setEnable(value);
cawthron
parents:
diff changeset
   911
				break;
cawthron
parents:
diff changeset
   912
			case script_multipledeclarations:
cawthron
parents:
diff changeset
   913
				this.csConfig.getScripts().getMultipledeclarations().setEnable(value);
cawthron
parents:
diff changeset
   914
				break;
cawthron
parents:
diff changeset
   915
			case script_multipleinheritance:
cawthron
parents:
diff changeset
   916
				this.csConfig.getScripts().getMultipleinheritance().setEnable(value);
cawthron
parents:
diff changeset
   917
				break;
cawthron
parents:
diff changeset
   918
			case script_mydocs:
cawthron
parents:
diff changeset
   919
				this.csConfig.getScripts().getMydocs().setEnable(value);
cawthron
parents:
diff changeset
   920
				break;
cawthron
parents:
diff changeset
   921
			case script_namespace:
cawthron
parents:
diff changeset
   922
				this.csConfig.getScripts().getNamespace().setEnable(value);
cawthron
parents:
diff changeset
   923
				break;
cawthron
parents:
diff changeset
   924
			case script_newlreferences:
cawthron
parents:
diff changeset
   925
				this.csConfig.getScripts().getNewlreferences().setEnable(value);
cawthron
parents:
diff changeset
   926
				break;
cawthron
parents:
diff changeset
   927
			case script_noleavetrap:
cawthron
parents:
diff changeset
   928
				this.csConfig.getScripts().getNoleavetrap().setEnable(value);
cawthron
parents:
diff changeset
   929
				break;
cawthron
parents:
diff changeset
   930
			case script_nonconsthbufc:
cawthron
parents:
diff changeset
   931
				this.csConfig.getScripts().getNonconsthbufc().setEnable(value);
cawthron
parents:
diff changeset
   932
				break;
cawthron
parents:
diff changeset
   933
			case script_nonconsttdesc:
cawthron
parents:
diff changeset
   934
				this.csConfig.getScripts().getNonconsttdesc().setEnable(value);
cawthron
parents:
diff changeset
   935
				break;
cawthron
parents:
diff changeset
   936
			case script_nonleavenew:
cawthron
parents:
diff changeset
   937
				this.csConfig.getScripts().getNonleavenew().setEnable(value);
cawthron
parents:
diff changeset
   938
				break;
cawthron
parents:
diff changeset
   939
			case script_nonunicodeskins:
cawthron
parents:
diff changeset
   940
				this.csConfig.getScripts().getNonunicodeskins().setEnable(value);
cawthron
parents:
diff changeset
   941
				break;
cawthron
parents:
diff changeset
   942
			case script_null:
cawthron
parents:
diff changeset
   943
				this.csConfig.getScripts().getNull().setEnable(value);
cawthron
parents:
diff changeset
   944
				break;
cawthron
parents:
diff changeset
   945
			case script_open:
cawthron
parents:
diff changeset
   946
				this.csConfig.getScripts().getOpen().setEnable(value);
cawthron
parents:
diff changeset
   947
				break;
cawthron
parents:
diff changeset
   948
			case script_pointertoarrays:
cawthron
parents:
diff changeset
   949
				this.csConfig.getScripts().getPointertoarrays().setEnable(value);
cawthron
parents:
diff changeset
   950
				break;
cawthron
parents:
diff changeset
   951
			case script_pragmadisable:
cawthron
parents:
diff changeset
   952
				this.csConfig.getScripts().getPragmadisable().setEnable(value);
cawthron
parents:
diff changeset
   953
				break;
cawthron
parents:
diff changeset
   954
			case script_pragmamessage:
cawthron
parents:
diff changeset
   955
				this.csConfig.getScripts().getPragmamessage().setEnable(value);
cawthron
parents:
diff changeset
   956
				break;
cawthron
parents:
diff changeset
   957
			case script_pragmaother:
cawthron
parents:
diff changeset
   958
				this.csConfig.getScripts().getPragmaother().setEnable(value);
cawthron
parents:
diff changeset
   959
				break;
cawthron
parents:
diff changeset
   960
			case script_privateinheritance:
cawthron
parents:
diff changeset
   961
				this.csConfig.getScripts().getPrivateinheritance().setEnable(value);
cawthron
parents:
diff changeset
   962
				break;
cawthron
parents:
diff changeset
   963
			case script_pushaddrvar:
cawthron
parents:
diff changeset
   964
				this.csConfig.getScripts().getPushaddrvar().setEnable(value);
cawthron
parents:
diff changeset
   965
				break;
cawthron
parents:
diff changeset
   966
			case script_pushmember:
cawthron
parents:
diff changeset
   967
				this.csConfig.getScripts().getPushmember().setEnable(value);
cawthron
parents:
diff changeset
   968
				break;
cawthron
parents:
diff changeset
   969
			case script_readresource:
cawthron
parents:
diff changeset
   970
				this.csConfig.getScripts().getReadresource().setEnable(value);
cawthron
parents:
diff changeset
   971
				break;
cawthron
parents:
diff changeset
   972
			case script_resourcenotoncleanupstack:
cawthron
parents:
diff changeset
   973
				this.csConfig.getScripts().getResourcenotoncleanupstack().setEnable(value);
cawthron
parents:
diff changeset
   974
				break;
cawthron
parents:
diff changeset
   975
			case script_resourcesonheap:
cawthron
parents:
diff changeset
   976
				this.csConfig.getScripts().getResourcesonheap().setEnable(value);
cawthron
parents:
diff changeset
   977
				break;
cawthron
parents:
diff changeset
   978
			case script_returndescriptoroutofscope:
cawthron
parents:
diff changeset
   979
				this.csConfig.getScripts().getReturndescriptoroutofscope().setEnable(value);
cawthron
parents:
diff changeset
   980
				break;
cawthron
parents:
diff changeset
   981
			case script_rfs:
cawthron
parents:
diff changeset
   982
				this.csConfig.getScripts().getRfs().setEnable(value);
cawthron
parents:
diff changeset
   983
				break;
cawthron
parents:
diff changeset
   984
			case script_rssnames:
cawthron
parents:
diff changeset
   985
				this.csConfig.getScripts().getRssnames().setEnable(value);
cawthron
parents:
diff changeset
   986
				break;
cawthron
parents:
diff changeset
   987
			case script_stringliterals:
cawthron
parents:
diff changeset
   988
				this.csConfig.getScripts().getStringliterals().setEnable(value);
cawthron
parents:
diff changeset
   989
				break;
cawthron
parents:
diff changeset
   990
			case script_stringsinresourcefiles:
cawthron
parents:
diff changeset
   991
				this.csConfig.getScripts().getStringsinresourcefiles().setEnable(value);
cawthron
parents:
diff changeset
   992
				break;
cawthron
parents:
diff changeset
   993
			case script_struct:
cawthron
parents:
diff changeset
   994
				this.csConfig.getScripts().getStruct().setEnable(value);
cawthron
parents:
diff changeset
   995
				break;
cawthron
parents:
diff changeset
   996
			case script_tcclasses:
cawthron
parents:
diff changeset
   997
				this.csConfig.getScripts().getTcclasses().setEnable(value);
cawthron
parents:
diff changeset
   998
				break;
cawthron
parents:
diff changeset
   999
			case script_tclassdestructor:
cawthron
parents:
diff changeset
  1000
				this.csConfig.getScripts().getTclassdestructor().setEnable(value);
cawthron
parents:
diff changeset
  1001
				break;
cawthron
parents:
diff changeset
  1002
			case script_todocomments:
cawthron
parents:
diff changeset
  1003
				this.csConfig.getScripts().getTodocomments().setEnable(value);
cawthron
parents:
diff changeset
  1004
				break;
cawthron
parents:
diff changeset
  1005
			case script_trapcleanup:
cawthron
parents:
diff changeset
  1006
				this.csConfig.getScripts().getTrapcleanup().setEnable(value);
cawthron
parents:
diff changeset
  1007
				break;
cawthron
parents:
diff changeset
  1008
			case script_trapeleave:
cawthron
parents:
diff changeset
  1009
				this.csConfig.getScripts().getTrapeleave().setEnable(value);
cawthron
parents:
diff changeset
  1010
				break;
cawthron
parents:
diff changeset
  1011
			case script_traprunl:
cawthron
parents:
diff changeset
  1012
				this.csConfig.getScripts().getTraprunl().setEnable(value);
cawthron
parents:
diff changeset
  1013
				break;
cawthron
parents:
diff changeset
  1014
			case script_trspassing:
cawthron
parents:
diff changeset
  1015
				this.csConfig.getScripts().getTrspassing().setEnable(value);
cawthron
parents:
diff changeset
  1016
				break;
cawthron
parents:
diff changeset
  1017
			case script_uids:
cawthron
parents:
diff changeset
  1018
				this.csConfig.getScripts().getUids().setEnable(value);
cawthron
parents:
diff changeset
  1019
				break;
cawthron
parents:
diff changeset
  1020
			case script_uncompressedaif:
cawthron
parents:
diff changeset
  1021
				this.csConfig.getScripts().getUncompressedaif().setEnable(value);
cawthron
parents:
diff changeset
  1022
				break;
cawthron
parents:
diff changeset
  1023
			case script_uncompressedbmp:
cawthron
parents:
diff changeset
  1024
				this.csConfig.getScripts().getUncompressedbmp().setEnable(value);
cawthron
parents:
diff changeset
  1025
				break;
cawthron
parents:
diff changeset
  1026
			case script_unicodesource:
cawthron
parents:
diff changeset
  1027
				this.csConfig.getScripts(). getUnicodesource().setEnable(value);
cawthron
parents:
diff changeset
  1028
				break;
cawthron
parents:
diff changeset
  1029
			case script_userafter:
cawthron
parents:
diff changeset
  1030
				this.csConfig.getScripts().getUserafter().setEnable(value);
cawthron
parents:
diff changeset
  1031
				break;
cawthron
parents:
diff changeset
  1032
			case script_userfree:
cawthron
parents:
diff changeset
  1033
				this.csConfig.getScripts().getUserfree().setEnable(value);
cawthron
parents:
diff changeset
  1034
				break;
cawthron
parents:
diff changeset
  1035
			case script_userWaitForRequest:
cawthron
parents:
diff changeset
  1036
				this.csConfig.getScripts().getUserWaitForRequest().setEnable(value);
cawthron
parents:
diff changeset
  1037
				break;
cawthron
parents:
diff changeset
  1038
			case script_variablenames:
cawthron
parents:
diff changeset
  1039
				this.csConfig.getScripts().getVariablenames().setEnable(value);
cawthron
parents:
diff changeset
  1040
				break;
cawthron
parents:
diff changeset
  1041
			case script_voidparameter:
cawthron
parents:
diff changeset
  1042
				this.csConfig.getScripts().getVoidparameter().setEnable(value);
cawthron
parents:
diff changeset
  1043
				break;
cawthron
parents:
diff changeset
  1044
			case script_worryingcomments:
cawthron
parents:
diff changeset
  1045
				this.csConfig.getScripts().getWorryingcomments().setEnable(value);
cawthron
parents:
diff changeset
  1046
				break;
cawthron
parents:
diff changeset
  1047
			case script_unknown:
cawthron
parents:
diff changeset
  1048
			default:
cawthron
parents:
diff changeset
  1049
				break;
cawthron
parents:
diff changeset
  1050
		}
cawthron
parents:
diff changeset
  1051
	}
cawthron
parents:
diff changeset
  1052
cawthron
parents:
diff changeset
  1053
	/**
cawthron
parents:
diff changeset
  1054
	 * Retrieve the "category" attribute of a CodeScanner script element
cawthron
parents:
diff changeset
  1055
	 * @param script - script element containing the attribute
cawthron
parents:
diff changeset
  1056
	 * @return attribute value
cawthron
parents:
diff changeset
  1057
	 */
cawthron
parents:
diff changeset
  1058
	public String getScriptCategory(CSScript script) {
cawthron
parents:
diff changeset
  1059
		switch (script) {
cawthron
parents:
diff changeset
  1060
			case script_accessArrayElementWithoutCheck:
cawthron
parents:
diff changeset
  1061
				return this.csConfig.getScripts().getAccessArrayElementWithoutCheck().getCategory().toString();
cawthron
parents:
diff changeset
  1062
			case script_accessArrayElementWithoutCheck2:
cawthron
parents:
diff changeset
  1063
				return this.csConfig.getScripts().getAccessArrayElementWithoutCheck2().getCategory().toString();
cawthron
parents:
diff changeset
  1064
			case script_activestart:
cawthron
parents:
diff changeset
  1065
				return this.csConfig.getScripts().getActivestart().getCategory().toString();
cawthron
parents:
diff changeset
  1066
			case script_activestop:
cawthron
parents:
diff changeset
  1067
				return this.csConfig.getScripts().getActivestop().getCategory().toString();
cawthron
parents:
diff changeset
  1068
			case script_arraypassing:
cawthron
parents:
diff changeset
  1069
				return this.csConfig.getScripts().getArraypassing().getCategory().toString();
cawthron
parents:
diff changeset
  1070
			case script_arrayptrcleanup:
cawthron
parents:
diff changeset
  1071
				return this.csConfig.getScripts().getArrayptrcleanup().getCategory().toString();
cawthron
parents:
diff changeset
  1072
			case script_assertdebuginvariant:
cawthron
parents:
diff changeset
  1073
				return this.csConfig.getScripts().getAssertdebuginvariant().getCategory().toString();
cawthron
parents:
diff changeset
  1074
			case script_baddefines:
cawthron
parents:
diff changeset
  1075
				return this.csConfig.getScripts().getBaddefines().getCategory().toString();
cawthron
parents:
diff changeset
  1076
			case script_baseconstruct:
cawthron
parents:
diff changeset
  1077
				return this.csConfig.getScripts().getBaseconstruct().getCategory().toString();
cawthron
parents:
diff changeset
  1078
			case script_callActiveObjectWithoutCheckingOrStopping:
cawthron
parents:
diff changeset
  1079
				return this.csConfig.getScripts().getCallActiveObjectWithoutCheckingOrStopping().getCategory().toString();
cawthron
parents:
diff changeset
  1080
			case script_changenotification:
cawthron
parents:
diff changeset
  1081
				return this.csConfig.getScripts().getChangenotification().getCategory().toString();
cawthron
parents:
diff changeset
  1082
			case script_cleanup:
cawthron
parents:
diff changeset
  1083
				return this.csConfig.getScripts().getCleanup().getCategory().toString();
cawthron
parents:
diff changeset
  1084
			case script_commentcode:
cawthron
parents:
diff changeset
  1085
				return this.csConfig.getScripts().getCommentcode().getCategory().toString();
cawthron
parents:
diff changeset
  1086
			case script_connect:
cawthron
parents:
diff changeset
  1087
				return this.csConfig.getScripts().getConnect().getCategory().toString();
cawthron
parents:
diff changeset
  1088
			case script_ConnectAndDontCloseMemberVariable:
cawthron
parents:
diff changeset
  1089
				return this.csConfig.getScripts().getConnectAndDontCloseMemberVariable().getCategory().toString();
cawthron
parents:
diff changeset
  1090
			case script_constnames:
cawthron
parents:
diff changeset
  1091
				return this.csConfig.getScripts().getConstnames().getCategory().toString();
cawthron
parents:
diff changeset
  1092
			case script_consttdescptr:
cawthron
parents:
diff changeset
  1093
				return this.csConfig.getScripts().getConsttdescptr().getCategory().toString();
cawthron
parents:
diff changeset
  1094
			case script_controlornull:
cawthron
parents:
diff changeset
  1095
				return this.csConfig.getScripts().getControlornull().getCategory().toString();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1096
			case script_crepository:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1097
				return this.csConfig.getScripts().getCrepository().getCategory().toString();
2
cawthron
parents:
diff changeset
  1098
			case script_ctltargettype:
cawthron
parents:
diff changeset
  1099
				return this.csConfig.getScripts().getCtltargettype().getCategory().toString();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1100
			case script_customizableicons:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1101
				return this.csConfig.getScripts().getCustomizableicons().getCategory().toString();
2
cawthron
parents:
diff changeset
  1102
			case script_debugrom:
cawthron
parents:
diff changeset
  1103
				return this.csConfig.getScripts().getDebugrom().getCategory().toString();
cawthron
parents:
diff changeset
  1104
			case script_declarename:
cawthron
parents:
diff changeset
  1105
				return this.csConfig.getScripts().getDeclarename().getCategory().toString();
cawthron
parents:
diff changeset
  1106
			case script_deleteMemberVariable:
cawthron
parents:
diff changeset
  1107
				return this.csConfig.getScripts().getDeleteMemberVariable().getCategory().toString();
cawthron
parents:
diff changeset
  1108
			case script_destructor:
cawthron
parents:
diff changeset
  1109
				return this.csConfig.getScripts().getDestructor().getCategory().toString();
cawthron
parents:
diff changeset
  1110
			case script_doubleSemiColon:
cawthron
parents:
diff changeset
  1111
				return this.csConfig.getScripts().getDoubleSemiColon().getCategory().toString();
cawthron
parents:
diff changeset
  1112
			case script_driveletters:
cawthron
parents:
diff changeset
  1113
				return this.csConfig.getScripts().getDriveletters().getCategory().toString();
cawthron
parents:
diff changeset
  1114
			case script_eikbuttons:
cawthron
parents:
diff changeset
  1115
				return this.csConfig.getScripts().getEikbuttons().getCategory().toString();
cawthron
parents:
diff changeset
  1116
			case script_eikonenvstatic:
cawthron
parents:
diff changeset
  1117
				return this.csConfig.getScripts().getEikonenvstatic().getCategory().toString();
cawthron
parents:
diff changeset
  1118
			case script_enummembers:
cawthron
parents:
diff changeset
  1119
				return this.csConfig.getScripts().getEnummembers().getCategory().toString();
cawthron
parents:
diff changeset
  1120
			case script_enumnames:
cawthron
parents:
diff changeset
  1121
				return this.csConfig.getScripts().getEnumnames().getCategory().toString();
cawthron
parents:
diff changeset
  1122
			case script_exportinline:
cawthron
parents:
diff changeset
  1123
				return this.csConfig.getScripts().getExportinline().getCategory().toString();
cawthron
parents:
diff changeset
  1124
			case script_exportpurevirtual:
cawthron
parents:
diff changeset
  1125
				return this.csConfig.getScripts().getExportpurevirtual().getCategory().toString();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1126
			case script_flags:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1127
				return this.csConfig.getScripts().getFlags().getCategory().toString();
2
cawthron
parents:
diff changeset
  1128
			case script_foff:
cawthron
parents:
diff changeset
  1129
				return this.csConfig.getScripts().getFoff().getCategory().toString();
cawthron
parents:
diff changeset
  1130
			case script_forbiddenwords:
cawthron
parents:
diff changeset
  1131
				return this.csConfig.getScripts().getForbiddenwords().getCategory().toString();
cawthron
parents:
diff changeset
  1132
			case script_forgottoputptroncleanupstack:
cawthron
parents:
diff changeset
  1133
				return this.csConfig.getScripts().getForgottoputptroncleanupstack().getCategory().toString();
cawthron
parents:
diff changeset
  1134
			case script_friend:
cawthron
parents:
diff changeset
  1135
				return this.csConfig.getScripts().getFriend().getCategory().toString();
cawthron
parents:
diff changeset
  1136
			case script_goto:
cawthron
parents:
diff changeset
  1137
				return this.csConfig.getScripts().getGoto().getCategory().toString();
cawthron
parents:
diff changeset
  1138
			case script_ifassignments:
cawthron
parents:
diff changeset
  1139
				return this.csConfig.getScripts().getIfassignments().getCategory().toString();
cawthron
parents:
diff changeset
  1140
			case script_ifpreprocessor:
cawthron
parents:
diff changeset
  1141
				return this.csConfig.getScripts().getIfpreprocessor().getCategory().toString();
cawthron
parents:
diff changeset
  1142
			case script_inheritanceorder:
cawthron
parents:
diff changeset
  1143
				return this.csConfig.getScripts().getInheritanceorder().getCategory().toString();
cawthron
parents:
diff changeset
  1144
			case script_intleaves:
cawthron
parents:
diff changeset
  1145
				return this.csConfig.getScripts().getIntleaves().getCategory().toString();
cawthron
parents:
diff changeset
  1146
			case script_jmp:
cawthron
parents:
diff changeset
  1147
				return this.csConfig.getScripts().getJmp().getCategory().toString();
cawthron
parents:
diff changeset
  1148
			case script_leave:
cawthron
parents:
diff changeset
  1149
				return this.csConfig.getScripts().getLeave().getCategory().toString();
cawthron
parents:
diff changeset
  1150
			case script_LeaveNoError:
cawthron
parents:
diff changeset
  1151
				return this.csConfig.getScripts().getLeaveNoError().getCategory().toString();
cawthron
parents:
diff changeset
  1152
			case script_leavingoperators:
cawthron
parents:
diff changeset
  1153
				return this.csConfig.getScripts().getLeavingoperators().getCategory().toString();
cawthron
parents:
diff changeset
  1154
			case script_LFunctionCantLeave:
cawthron
parents:
diff changeset
  1155
				return this.csConfig.getScripts().getLFunctionCantLeave().getCategory().toString();
cawthron
parents:
diff changeset
  1156
			case script_longlines: 
cawthron
parents:
diff changeset
  1157
				return this.csConfig.getScripts().getLonglines().getCategory().toString();
cawthron
parents:
diff changeset
  1158
			case script_magicnumbers:
cawthron
parents:
diff changeset
  1159
				return this.csConfig.getScripts().getMagicnumbers().getCategory().toString();
cawthron
parents:
diff changeset
  1160
			case script_mclassdestructor:
cawthron
parents:
diff changeset
  1161
				return this.csConfig.getScripts().getMclassdestructor().getCategory().toString();
cawthron
parents:
diff changeset
  1162
			case script_memberlc:
cawthron
parents:
diff changeset
  1163
				return this.csConfig.getScripts().getMemberlc().getCategory().toString();
cawthron
parents:
diff changeset
  1164
			case script_membervariablecallld:
cawthron
parents:
diff changeset
  1165
				return this.csConfig.getScripts().getMembervariablecallld().getCategory().toString();
cawthron
parents:
diff changeset
  1166
			case script_missingcancel:
cawthron
parents:
diff changeset
  1167
				return this.csConfig.getScripts().getMissingcancel().getCategory().toString();
cawthron
parents:
diff changeset
  1168
			case script_missingcclass:
cawthron
parents:
diff changeset
  1169
				return this.csConfig.getScripts().getMissingcclass().getCategory().toString();
cawthron
parents:
diff changeset
  1170
			case script_mmpsourcepath:
cawthron
parents:
diff changeset
  1171
				return this.csConfig.getScripts().getMmpsourcepath().getCategory().toString();
cawthron
parents:
diff changeset
  1172
			case script_multilangrsc:
cawthron
parents:
diff changeset
  1173
				return this.csConfig.getScripts().getMultilangrsc().getCategory().toString();
cawthron
parents:
diff changeset
  1174
			case script_multipledeclarations:
cawthron
parents:
diff changeset
  1175
				return this.csConfig.getScripts().getMultipledeclarations().getCategory().toString();
cawthron
parents:
diff changeset
  1176
			case script_multipleinheritance:
cawthron
parents:
diff changeset
  1177
				return this.csConfig.getScripts().getMultipleinheritance().getCategory().toString();
cawthron
parents:
diff changeset
  1178
			case script_mydocs:
cawthron
parents:
diff changeset
  1179
				return this.csConfig.getScripts().getMydocs().getCategory().toString();
cawthron
parents:
diff changeset
  1180
			case script_namespace:
cawthron
parents:
diff changeset
  1181
				return this.csConfig.getScripts().getNamespace().getCategory().toString();
cawthron
parents:
diff changeset
  1182
			case script_newlreferences:
cawthron
parents:
diff changeset
  1183
				return this.csConfig.getScripts().getNewlreferences().getCategory().toString();
cawthron
parents:
diff changeset
  1184
			case script_noleavetrap:
cawthron
parents:
diff changeset
  1185
				return this.csConfig.getScripts().getNoleavetrap().getCategory().toString();
cawthron
parents:
diff changeset
  1186
			case script_nonconsthbufc:
cawthron
parents:
diff changeset
  1187
				return this.csConfig.getScripts().getNonconsthbufc().getCategory().toString();
cawthron
parents:
diff changeset
  1188
			case script_nonconsttdesc:
cawthron
parents:
diff changeset
  1189
				return this.csConfig.getScripts().getNonconsttdesc().getCategory().toString();
cawthron
parents:
diff changeset
  1190
			case script_nonleavenew:
cawthron
parents:
diff changeset
  1191
				return this.csConfig.getScripts().getNonleavenew().getCategory().toString();
cawthron
parents:
diff changeset
  1192
			case script_nonunicodeskins:
cawthron
parents:
diff changeset
  1193
				return this.csConfig.getScripts().getNonunicodeskins().getCategory().toString();
cawthron
parents:
diff changeset
  1194
			case script_null:
cawthron
parents:
diff changeset
  1195
				return this.csConfig.getScripts().getNull().getCategory().toString();
cawthron
parents:
diff changeset
  1196
			case script_open:
cawthron
parents:
diff changeset
  1197
				return this.csConfig.getScripts().getOpen().getCategory().toString();
cawthron
parents:
diff changeset
  1198
			case script_pointertoarrays:
cawthron
parents:
diff changeset
  1199
				return this.csConfig.getScripts().getPointertoarrays().getCategory().toString();
cawthron
parents:
diff changeset
  1200
			case script_pragmadisable:
cawthron
parents:
diff changeset
  1201
				return this.csConfig.getScripts().getPragmadisable().getCategory().toString();
cawthron
parents:
diff changeset
  1202
			case script_pragmamessage:
cawthron
parents:
diff changeset
  1203
				return this.csConfig.getScripts().getPragmamessage().getCategory().toString();
cawthron
parents:
diff changeset
  1204
			case script_pragmaother:
cawthron
parents:
diff changeset
  1205
				return this.csConfig.getScripts().getPragmaother().getCategory().toString();
cawthron
parents:
diff changeset
  1206
			case script_privateinheritance:
cawthron
parents:
diff changeset
  1207
				return this.csConfig.getScripts().getPrivateinheritance().getCategory().toString();
cawthron
parents:
diff changeset
  1208
			case script_pushaddrvar:
cawthron
parents:
diff changeset
  1209
				return this.csConfig.getScripts().getPushaddrvar().getCategory().toString();
cawthron
parents:
diff changeset
  1210
			case script_pushmember:
cawthron
parents:
diff changeset
  1211
				return this.csConfig.getScripts().getPushmember().getCategory().toString();
cawthron
parents:
diff changeset
  1212
			case script_readresource:
cawthron
parents:
diff changeset
  1213
				return this.csConfig.getScripts().getReadresource().getCategory().toString();
cawthron
parents:
diff changeset
  1214
			case script_resourcenotoncleanupstack:
cawthron
parents:
diff changeset
  1215
				return this.csConfig.getScripts().getResourcenotoncleanupstack().getCategory().toString();
cawthron
parents:
diff changeset
  1216
			case script_resourcesonheap:
cawthron
parents:
diff changeset
  1217
				return this.csConfig.getScripts().getResourcesonheap().getCategory().toString();
cawthron
parents:
diff changeset
  1218
			case script_returndescriptoroutofscope:
cawthron
parents:
diff changeset
  1219
				return this.csConfig.getScripts().getReturndescriptoroutofscope().getCategory().toString();
cawthron
parents:
diff changeset
  1220
			case script_rfs:
cawthron
parents:
diff changeset
  1221
				return this.csConfig.getScripts().getRfs().getCategory().toString();
cawthron
parents:
diff changeset
  1222
			case script_rssnames:
cawthron
parents:
diff changeset
  1223
				return this.csConfig.getScripts().getRssnames().getCategory().toString();
cawthron
parents:
diff changeset
  1224
			case script_stringliterals:
cawthron
parents:
diff changeset
  1225
				return this.csConfig.getScripts().getStringliterals().getCategory().toString();
cawthron
parents:
diff changeset
  1226
			case script_stringsinresourcefiles:
cawthron
parents:
diff changeset
  1227
				return this.csConfig.getScripts().getStringsinresourcefiles().getCategory().toString();
cawthron
parents:
diff changeset
  1228
			case script_struct:
cawthron
parents:
diff changeset
  1229
				return this.csConfig.getScripts().getStruct().getCategory().toString();
cawthron
parents:
diff changeset
  1230
			case script_tcclasses:
cawthron
parents:
diff changeset
  1231
				return this.csConfig.getScripts().getTcclasses().getCategory().toString();
cawthron
parents:
diff changeset
  1232
			case script_tclassdestructor:
cawthron
parents:
diff changeset
  1233
				return this.csConfig.getScripts().getTclassdestructor().getCategory().toString();
cawthron
parents:
diff changeset
  1234
			case script_todocomments:
cawthron
parents:
diff changeset
  1235
				return this.csConfig.getScripts().getTodocomments().getCategory().toString();
cawthron
parents:
diff changeset
  1236
			case script_trapcleanup:
cawthron
parents:
diff changeset
  1237
				return this.csConfig.getScripts().getTrapcleanup().getCategory().toString();
cawthron
parents:
diff changeset
  1238
			case script_trapeleave:
cawthron
parents:
diff changeset
  1239
				return this.csConfig.getScripts().getTrapeleave().getCategory().toString();
cawthron
parents:
diff changeset
  1240
			case script_traprunl:
cawthron
parents:
diff changeset
  1241
				return this.csConfig.getScripts().getTraprunl().getCategory().toString();
cawthron
parents:
diff changeset
  1242
			case script_trspassing:
cawthron
parents:
diff changeset
  1243
				return this.csConfig.getScripts().getTrspassing().getCategory().toString();
cawthron
parents:
diff changeset
  1244
			case script_uids:
cawthron
parents:
diff changeset
  1245
				return this.csConfig.getScripts().getUids().getCategory().toString();
cawthron
parents:
diff changeset
  1246
			case script_uncompressedaif:
cawthron
parents:
diff changeset
  1247
				return this.csConfig.getScripts().getUncompressedaif().getCategory().toString();
cawthron
parents:
diff changeset
  1248
			case script_uncompressedbmp:
cawthron
parents:
diff changeset
  1249
				return this.csConfig.getScripts().getUncompressedaif().getCategory().toString();
cawthron
parents:
diff changeset
  1250
			case script_unicodesource:
cawthron
parents:
diff changeset
  1251
				return this.csConfig.getScripts(). getUnicodesource().getCategory().toString();
cawthron
parents:
diff changeset
  1252
			case script_userafter:
cawthron
parents:
diff changeset
  1253
				return this.csConfig.getScripts().getUserafter().getCategory().toString();
cawthron
parents:
diff changeset
  1254
			case script_userfree:
cawthron
parents:
diff changeset
  1255
				return this.csConfig.getScripts().getUserfree().getCategory().toString();
cawthron
parents:
diff changeset
  1256
			case script_userWaitForRequest:
cawthron
parents:
diff changeset
  1257
				return this.csConfig.getScripts().getUserWaitForRequest().getCategory().toString();
cawthron
parents:
diff changeset
  1258
			case script_variablenames:
cawthron
parents:
diff changeset
  1259
				return this.csConfig.getScripts().getVariablenames().getCategory().toString();
cawthron
parents:
diff changeset
  1260
			case script_voidparameter:
cawthron
parents:
diff changeset
  1261
				return this.csConfig.getScripts().getVoidparameter().getCategory().toString();
cawthron
parents:
diff changeset
  1262
			case script_worryingcomments:
cawthron
parents:
diff changeset
  1263
				return this.csConfig.getScripts().getWorryingcomments().getCategory().toString();
cawthron
parents:
diff changeset
  1264
			case script_unknown:
cawthron
parents:
diff changeset
  1265
			default:
cawthron
parents:
diff changeset
  1266
				return "other";
cawthron
parents:
diff changeset
  1267
		}
cawthron
parents:
diff changeset
  1268
	}
cawthron
parents:
diff changeset
  1269
cawthron
parents:
diff changeset
  1270
	/**
cawthron
parents:
diff changeset
  1271
	 * Set the "category" attribute of a CodeScanner script element
cawthron
parents:
diff changeset
  1272
	 * @param script - script element containing the attribute
cawthron
parents:
diff changeset
  1273
	 * @param value - new attribute value
cawthron
parents:
diff changeset
  1274
	 */
cawthron
parents:
diff changeset
  1275
	public void setScriptCategory(CSScript script, String value) {
cawthron
parents:
diff changeset
  1276
		CategoryType category = CategoryType.get(value);
cawthron
parents:
diff changeset
  1277
		switch (script) {
cawthron
parents:
diff changeset
  1278
			case script_accessArrayElementWithoutCheck:
cawthron
parents:
diff changeset
  1279
				this.csConfig.getScripts().getAccessArrayElementWithoutCheck().setCategory(category);
cawthron
parents:
diff changeset
  1280
				break;
cawthron
parents:
diff changeset
  1281
			case script_accessArrayElementWithoutCheck2:
cawthron
parents:
diff changeset
  1282
				this.csConfig.getScripts().getAccessArrayElementWithoutCheck2().setCategory(category);
cawthron
parents:
diff changeset
  1283
				break;
cawthron
parents:
diff changeset
  1284
			case script_activestart:
cawthron
parents:
diff changeset
  1285
				this.csConfig.getScripts().getActivestart().setCategory(category);
cawthron
parents:
diff changeset
  1286
				break;
cawthron
parents:
diff changeset
  1287
			case script_activestop:
cawthron
parents:
diff changeset
  1288
				this.csConfig.getScripts().getActivestop().setCategory(category);
cawthron
parents:
diff changeset
  1289
				break;
cawthron
parents:
diff changeset
  1290
			case script_arraypassing:
cawthron
parents:
diff changeset
  1291
				this.csConfig.getScripts().getArraypassing().setCategory(category);
cawthron
parents:
diff changeset
  1292
				break;
cawthron
parents:
diff changeset
  1293
			case script_arrayptrcleanup:
cawthron
parents:
diff changeset
  1294
				this.csConfig.getScripts().getArrayptrcleanup().setCategory(category);
cawthron
parents:
diff changeset
  1295
				break;
cawthron
parents:
diff changeset
  1296
			case script_assertdebuginvariant:
cawthron
parents:
diff changeset
  1297
				this.csConfig.getScripts().getAssertdebuginvariant().setCategory(category);
cawthron
parents:
diff changeset
  1298
				break;
cawthron
parents:
diff changeset
  1299
			case script_baddefines:
cawthron
parents:
diff changeset
  1300
				this.csConfig.getScripts().getBaddefines().setCategory(category);
cawthron
parents:
diff changeset
  1301
				break;
cawthron
parents:
diff changeset
  1302
			case script_baseconstruct:
cawthron
parents:
diff changeset
  1303
				this.csConfig.getScripts().getBaseconstruct().setCategory(category);
cawthron
parents:
diff changeset
  1304
				break;
cawthron
parents:
diff changeset
  1305
			case script_callActiveObjectWithoutCheckingOrStopping:
cawthron
parents:
diff changeset
  1306
				this.csConfig.getScripts().getCallActiveObjectWithoutCheckingOrStopping().setCategory(category);
cawthron
parents:
diff changeset
  1307
				break;
cawthron
parents:
diff changeset
  1308
			case script_changenotification:
cawthron
parents:
diff changeset
  1309
				this.csConfig.getScripts().getChangenotification().setCategory(category);
cawthron
parents:
diff changeset
  1310
				break;
cawthron
parents:
diff changeset
  1311
			case script_cleanup:
cawthron
parents:
diff changeset
  1312
				this.csConfig.getScripts().getCleanup().setCategory(category);
cawthron
parents:
diff changeset
  1313
				break;
cawthron
parents:
diff changeset
  1314
			case script_commentcode:
cawthron
parents:
diff changeset
  1315
				this.csConfig.getScripts().getCommentcode().setCategory(category);
cawthron
parents:
diff changeset
  1316
				break;
cawthron
parents:
diff changeset
  1317
			case script_connect:
cawthron
parents:
diff changeset
  1318
				this.csConfig.getScripts().getConnect().setCategory(category);
cawthron
parents:
diff changeset
  1319
				break;
cawthron
parents:
diff changeset
  1320
			case script_ConnectAndDontCloseMemberVariable:
cawthron
parents:
diff changeset
  1321
				this.csConfig.getScripts().getConnectAndDontCloseMemberVariable().setCategory(category);
cawthron
parents:
diff changeset
  1322
				break;
cawthron
parents:
diff changeset
  1323
			case script_constnames:
cawthron
parents:
diff changeset
  1324
				this.csConfig.getScripts().getConstnames().setCategory(category);
cawthron
parents:
diff changeset
  1325
				break;
cawthron
parents:
diff changeset
  1326
			case script_consttdescptr:
cawthron
parents:
diff changeset
  1327
				this.csConfig.getScripts().getConsttdescptr().setCategory(category);
cawthron
parents:
diff changeset
  1328
				break;
cawthron
parents:
diff changeset
  1329
			case script_controlornull:
cawthron
parents:
diff changeset
  1330
				this.csConfig.getScripts().getControlornull().setCategory(category);
cawthron
parents:
diff changeset
  1331
				break;
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1332
			case script_crepository:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1333
				this.csConfig.getScripts().getCrepository().setCategory(category);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1334
				break;
2
cawthron
parents:
diff changeset
  1335
			case script_ctltargettype:
cawthron
parents:
diff changeset
  1336
				this.csConfig.getScripts().getCtltargettype().setCategory(category);
cawthron
parents:
diff changeset
  1337
				break;
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1338
			case script_customizableicons:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1339
				this.csConfig.getScripts().getCustomizableicons().setCategory(category);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1340
				break;
2
cawthron
parents:
diff changeset
  1341
			case script_debugrom:
cawthron
parents:
diff changeset
  1342
				this.csConfig.getScripts().getDebugrom().setCategory(category);
cawthron
parents:
diff changeset
  1343
				break;
cawthron
parents:
diff changeset
  1344
			case script_declarename:
cawthron
parents:
diff changeset
  1345
				this.csConfig.getScripts().getDeclarename().setCategory(category);
cawthron
parents:
diff changeset
  1346
				break;
cawthron
parents:
diff changeset
  1347
			case script_deleteMemberVariable:
cawthron
parents:
diff changeset
  1348
				this.csConfig.getScripts().getDeleteMemberVariable().setCategory(category);
cawthron
parents:
diff changeset
  1349
				break;
cawthron
parents:
diff changeset
  1350
			case script_destructor:
cawthron
parents:
diff changeset
  1351
				this.csConfig.getScripts().getDestructor().setCategory(category);
cawthron
parents:
diff changeset
  1352
				break;
cawthron
parents:
diff changeset
  1353
			case script_doubleSemiColon:
cawthron
parents:
diff changeset
  1354
				this.csConfig.getScripts().getDoubleSemiColon().setCategory(category);
cawthron
parents:
diff changeset
  1355
				break;
cawthron
parents:
diff changeset
  1356
			case script_driveletters:
cawthron
parents:
diff changeset
  1357
				this.csConfig.getScripts().getDriveletters().setCategory(category);
cawthron
parents:
diff changeset
  1358
				break;
cawthron
parents:
diff changeset
  1359
			case script_eikbuttons:
cawthron
parents:
diff changeset
  1360
				this.csConfig.getScripts().getEikbuttons().setCategory(category);
cawthron
parents:
diff changeset
  1361
				break;
cawthron
parents:
diff changeset
  1362
			case script_eikonenvstatic:
cawthron
parents:
diff changeset
  1363
				this.csConfig.getScripts().getEikonenvstatic().setCategory(category);
cawthron
parents:
diff changeset
  1364
				break;
cawthron
parents:
diff changeset
  1365
			case script_enummembers:
cawthron
parents:
diff changeset
  1366
				this.csConfig.getScripts().getEnummembers().setCategory(category);
cawthron
parents:
diff changeset
  1367
				break;
cawthron
parents:
diff changeset
  1368
			case script_enumnames:
cawthron
parents:
diff changeset
  1369
				this.csConfig.getScripts().getEnumnames().setCategory(category);
cawthron
parents:
diff changeset
  1370
				break;
cawthron
parents:
diff changeset
  1371
			case script_exportinline:
cawthron
parents:
diff changeset
  1372
				this.csConfig.getScripts().getExportinline().setCategory(category);
cawthron
parents:
diff changeset
  1373
				break;
cawthron
parents:
diff changeset
  1374
			case script_exportpurevirtual:
cawthron
parents:
diff changeset
  1375
				this.csConfig.getScripts().getExportpurevirtual().setCategory(category);
cawthron
parents:
diff changeset
  1376
				break;
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1377
			case script_flags:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1378
				this.csConfig.getScripts().getFlags().setCategory(category);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1379
				break;
2
cawthron
parents:
diff changeset
  1380
			case script_foff:
cawthron
parents:
diff changeset
  1381
				this.csConfig.getScripts().getFoff().setCategory(category);
cawthron
parents:
diff changeset
  1382
				break;
cawthron
parents:
diff changeset
  1383
			case script_forbiddenwords:
cawthron
parents:
diff changeset
  1384
				this.csConfig.getScripts().getForbiddenwords().setCategory(category);
cawthron
parents:
diff changeset
  1385
				break;
cawthron
parents:
diff changeset
  1386
			case script_forgottoputptroncleanupstack:
cawthron
parents:
diff changeset
  1387
				this.csConfig.getScripts().getForgottoputptroncleanupstack().setCategory(category);
cawthron
parents:
diff changeset
  1388
				break;
cawthron
parents:
diff changeset
  1389
			case script_friend:
cawthron
parents:
diff changeset
  1390
				this.csConfig.getScripts().getFriend().setCategory(category);
cawthron
parents:
diff changeset
  1391
				break;
cawthron
parents:
diff changeset
  1392
			case script_goto:
cawthron
parents:
diff changeset
  1393
				this.csConfig.getScripts().getGoto().setCategory(category);
cawthron
parents:
diff changeset
  1394
				break;
cawthron
parents:
diff changeset
  1395
			case script_ifassignments:
cawthron
parents:
diff changeset
  1396
				this.csConfig.getScripts().getIfassignments().setCategory(category);
cawthron
parents:
diff changeset
  1397
				break;
cawthron
parents:
diff changeset
  1398
			case script_ifpreprocessor:
cawthron
parents:
diff changeset
  1399
				this.csConfig.getScripts().getIfpreprocessor().setCategory(category);
cawthron
parents:
diff changeset
  1400
				break;
cawthron
parents:
diff changeset
  1401
			case script_inheritanceorder:
cawthron
parents:
diff changeset
  1402
				this.csConfig.getScripts().getInheritanceorder().setCategory(category);
cawthron
parents:
diff changeset
  1403
				break;
cawthron
parents:
diff changeset
  1404
			case script_intleaves:
cawthron
parents:
diff changeset
  1405
				this.csConfig.getScripts().getIntleaves().setCategory(category);
cawthron
parents:
diff changeset
  1406
				break;
cawthron
parents:
diff changeset
  1407
			case script_jmp:
cawthron
parents:
diff changeset
  1408
				this.csConfig.getScripts().getJmp().setCategory(category);
cawthron
parents:
diff changeset
  1409
				break;
cawthron
parents:
diff changeset
  1410
			case script_leave:
cawthron
parents:
diff changeset
  1411
				this.csConfig.getScripts().getLeave().setCategory(category);
cawthron
parents:
diff changeset
  1412
				break;
cawthron
parents:
diff changeset
  1413
			case script_LeaveNoError:
cawthron
parents:
diff changeset
  1414
				this.csConfig.getScripts().getLeaveNoError().setCategory(category);
cawthron
parents:
diff changeset
  1415
				break;
cawthron
parents:
diff changeset
  1416
			case script_leavingoperators:
cawthron
parents:
diff changeset
  1417
				this.csConfig.getScripts().getLeavingoperators().setCategory(category);
cawthron
parents:
diff changeset
  1418
				break;
cawthron
parents:
diff changeset
  1419
			case script_LFunctionCantLeave:
cawthron
parents:
diff changeset
  1420
				this.csConfig.getScripts().getLFunctionCantLeave().setCategory(category);
cawthron
parents:
diff changeset
  1421
				break;
cawthron
parents:
diff changeset
  1422
			case script_longlines: 
cawthron
parents:
diff changeset
  1423
				this.csConfig.getScripts().getLonglines().setCategory(category);
cawthron
parents:
diff changeset
  1424
				break;
cawthron
parents:
diff changeset
  1425
			case script_magicnumbers:
cawthron
parents:
diff changeset
  1426
				this.csConfig.getScripts().getMagicnumbers().setCategory(category);
cawthron
parents:
diff changeset
  1427
				break;
cawthron
parents:
diff changeset
  1428
			case script_mclassdestructor:
cawthron
parents:
diff changeset
  1429
				this.csConfig.getScripts().getMclassdestructor().setCategory(category);
cawthron
parents:
diff changeset
  1430
				break;
cawthron
parents:
diff changeset
  1431
			case script_memberlc:
cawthron
parents:
diff changeset
  1432
				this.csConfig.getScripts().getMemberlc().setCategory(category);
cawthron
parents:
diff changeset
  1433
				break;
cawthron
parents:
diff changeset
  1434
			case script_membervariablecallld:
cawthron
parents:
diff changeset
  1435
				this.csConfig.getScripts().getMembervariablecallld().setCategory(category);
cawthron
parents:
diff changeset
  1436
				break;
cawthron
parents:
diff changeset
  1437
			case script_missingcancel:
cawthron
parents:
diff changeset
  1438
				this.csConfig.getScripts().getMissingcancel().setCategory(category);
cawthron
parents:
diff changeset
  1439
				break;
cawthron
parents:
diff changeset
  1440
			case script_missingcclass:
cawthron
parents:
diff changeset
  1441
				this.csConfig.getScripts().getMissingcclass().setCategory(category);
cawthron
parents:
diff changeset
  1442
				break;
cawthron
parents:
diff changeset
  1443
			case script_mmpsourcepath:
cawthron
parents:
diff changeset
  1444
				this.csConfig.getScripts().getMmpsourcepath().setCategory(category);
cawthron
parents:
diff changeset
  1445
				break;
cawthron
parents:
diff changeset
  1446
			case script_multilangrsc:
cawthron
parents:
diff changeset
  1447
				this.csConfig.getScripts().getMultilangrsc().setCategory(category);
cawthron
parents:
diff changeset
  1448
				break;
cawthron
parents:
diff changeset
  1449
			case script_multipledeclarations:
cawthron
parents:
diff changeset
  1450
				this.csConfig.getScripts().getMultipledeclarations().setCategory(category);
cawthron
parents:
diff changeset
  1451
				break;
cawthron
parents:
diff changeset
  1452
			case script_multipleinheritance:
cawthron
parents:
diff changeset
  1453
				this.csConfig.getScripts().getMultipleinheritance().setCategory(category);
cawthron
parents:
diff changeset
  1454
				break;
cawthron
parents:
diff changeset
  1455
			case script_mydocs:
cawthron
parents:
diff changeset
  1456
				this.csConfig.getScripts().getMydocs().setCategory(category);
cawthron
parents:
diff changeset
  1457
				break;
cawthron
parents:
diff changeset
  1458
			case script_namespace:
cawthron
parents:
diff changeset
  1459
				this.csConfig.getScripts().getNamespace().setCategory(category);
cawthron
parents:
diff changeset
  1460
				break;
cawthron
parents:
diff changeset
  1461
			case script_newlreferences:
cawthron
parents:
diff changeset
  1462
				this.csConfig.getScripts().getNewlreferences().setCategory(category);
cawthron
parents:
diff changeset
  1463
				break;
cawthron
parents:
diff changeset
  1464
			case script_noleavetrap:
cawthron
parents:
diff changeset
  1465
				this.csConfig.getScripts().getNoleavetrap().setCategory(category);
cawthron
parents:
diff changeset
  1466
				break;
cawthron
parents:
diff changeset
  1467
			case script_nonconsthbufc:
cawthron
parents:
diff changeset
  1468
				this.csConfig.getScripts().getNonconsthbufc().setCategory(category);
cawthron
parents:
diff changeset
  1469
				break;
cawthron
parents:
diff changeset
  1470
			case script_nonconsttdesc:
cawthron
parents:
diff changeset
  1471
				this.csConfig.getScripts().getNonconsttdesc().setCategory(category);
cawthron
parents:
diff changeset
  1472
				break;
cawthron
parents:
diff changeset
  1473
			case script_nonleavenew:
cawthron
parents:
diff changeset
  1474
				this.csConfig.getScripts().getNonleavenew().setCategory(category);
cawthron
parents:
diff changeset
  1475
				break;
cawthron
parents:
diff changeset
  1476
			case script_nonunicodeskins:
cawthron
parents:
diff changeset
  1477
				this.csConfig.getScripts().getNonunicodeskins().setCategory(category);
cawthron
parents:
diff changeset
  1478
				break;
cawthron
parents:
diff changeset
  1479
			case script_null:
cawthron
parents:
diff changeset
  1480
				this.csConfig.getScripts().getNull().setCategory(category);
cawthron
parents:
diff changeset
  1481
				break;
cawthron
parents:
diff changeset
  1482
			case script_open:
cawthron
parents:
diff changeset
  1483
				this.csConfig.getScripts().getOpen().setCategory(category);
cawthron
parents:
diff changeset
  1484
				break;
cawthron
parents:
diff changeset
  1485
			case script_pointertoarrays:
cawthron
parents:
diff changeset
  1486
				this.csConfig.getScripts().getPointertoarrays().setCategory(category);
cawthron
parents:
diff changeset
  1487
				break;
cawthron
parents:
diff changeset
  1488
			case script_pragmadisable:
cawthron
parents:
diff changeset
  1489
				this.csConfig.getScripts().getPragmadisable().setCategory(category);
cawthron
parents:
diff changeset
  1490
				break;
cawthron
parents:
diff changeset
  1491
			case script_pragmamessage:
cawthron
parents:
diff changeset
  1492
				this.csConfig.getScripts().getPragmamessage().setCategory(category);
cawthron
parents:
diff changeset
  1493
				break;
cawthron
parents:
diff changeset
  1494
			case script_pragmaother:
cawthron
parents:
diff changeset
  1495
				this.csConfig.getScripts().getPragmaother().setCategory(category);
cawthron
parents:
diff changeset
  1496
				break;
cawthron
parents:
diff changeset
  1497
			case script_privateinheritance:
cawthron
parents:
diff changeset
  1498
				this.csConfig.getScripts().getPrivateinheritance().setCategory(category);
cawthron
parents:
diff changeset
  1499
				break;
cawthron
parents:
diff changeset
  1500
			case script_pushaddrvar:
cawthron
parents:
diff changeset
  1501
				this.csConfig.getScripts().getPushaddrvar().setCategory(category);
cawthron
parents:
diff changeset
  1502
				break;
cawthron
parents:
diff changeset
  1503
			case script_pushmember:
cawthron
parents:
diff changeset
  1504
				this.csConfig.getScripts().getPushmember().setCategory(category);
cawthron
parents:
diff changeset
  1505
				break;
cawthron
parents:
diff changeset
  1506
			case script_readresource:
cawthron
parents:
diff changeset
  1507
				this.csConfig.getScripts().getReadresource().setCategory(category);
cawthron
parents:
diff changeset
  1508
				break;
cawthron
parents:
diff changeset
  1509
			case script_resourcenotoncleanupstack:
cawthron
parents:
diff changeset
  1510
				this.csConfig.getScripts().getResourcenotoncleanupstack().setCategory(category);
cawthron
parents:
diff changeset
  1511
				break;
cawthron
parents:
diff changeset
  1512
			case script_resourcesonheap:
cawthron
parents:
diff changeset
  1513
				this.csConfig.getScripts().getResourcesonheap().setCategory(category);
cawthron
parents:
diff changeset
  1514
				break;
cawthron
parents:
diff changeset
  1515
			case script_returndescriptoroutofscope:
cawthron
parents:
diff changeset
  1516
				this.csConfig.getScripts().getReturndescriptoroutofscope().setCategory(category);
cawthron
parents:
diff changeset
  1517
				break;
cawthron
parents:
diff changeset
  1518
			case script_rfs:
cawthron
parents:
diff changeset
  1519
				this.csConfig.getScripts().getRfs().setCategory(category);
cawthron
parents:
diff changeset
  1520
				break;
cawthron
parents:
diff changeset
  1521
			case script_rssnames:
cawthron
parents:
diff changeset
  1522
				this.csConfig.getScripts().getRssnames().setCategory(category);
cawthron
parents:
diff changeset
  1523
				break;
cawthron
parents:
diff changeset
  1524
			case script_stringliterals:
cawthron
parents:
diff changeset
  1525
				this.csConfig.getScripts().getStringliterals().setCategory(category);
cawthron
parents:
diff changeset
  1526
				break;
cawthron
parents:
diff changeset
  1527
			case script_stringsinresourcefiles:
cawthron
parents:
diff changeset
  1528
				this.csConfig.getScripts().getStringsinresourcefiles().setCategory(category);
cawthron
parents:
diff changeset
  1529
				break;
cawthron
parents:
diff changeset
  1530
			case script_struct:
cawthron
parents:
diff changeset
  1531
				this.csConfig.getScripts().getStruct().setCategory(category);
cawthron
parents:
diff changeset
  1532
				break;
cawthron
parents:
diff changeset
  1533
			case script_tcclasses:
cawthron
parents:
diff changeset
  1534
				this.csConfig.getScripts().getTcclasses().setCategory(category);
cawthron
parents:
diff changeset
  1535
				break;
cawthron
parents:
diff changeset
  1536
			case script_tclassdestructor:
cawthron
parents:
diff changeset
  1537
				this.csConfig.getScripts().getTclassdestructor().setCategory(category);
cawthron
parents:
diff changeset
  1538
				break;
cawthron
parents:
diff changeset
  1539
			case script_todocomments:
cawthron
parents:
diff changeset
  1540
				this.csConfig.getScripts().getTodocomments().setCategory(category);
cawthron
parents:
diff changeset
  1541
				break;
cawthron
parents:
diff changeset
  1542
			case script_trapcleanup:
cawthron
parents:
diff changeset
  1543
				this.csConfig.getScripts().getTrapcleanup().setCategory(category);
cawthron
parents:
diff changeset
  1544
				break;
cawthron
parents:
diff changeset
  1545
			case script_trapeleave:
cawthron
parents:
diff changeset
  1546
				this.csConfig.getScripts().getTrapeleave().setCategory(category);
cawthron
parents:
diff changeset
  1547
				break;
cawthron
parents:
diff changeset
  1548
			case script_traprunl:
cawthron
parents:
diff changeset
  1549
				this.csConfig.getScripts().getTraprunl().setCategory(category);
cawthron
parents:
diff changeset
  1550
				break;
cawthron
parents:
diff changeset
  1551
			case script_trspassing:
cawthron
parents:
diff changeset
  1552
				this.csConfig.getScripts().getTrspassing().setCategory(category);
cawthron
parents:
diff changeset
  1553
				break;
cawthron
parents:
diff changeset
  1554
			case script_uids:
cawthron
parents:
diff changeset
  1555
				this.csConfig.getScripts().getUids().setCategory(category);
cawthron
parents:
diff changeset
  1556
				break;
cawthron
parents:
diff changeset
  1557
			case script_uncompressedaif:
cawthron
parents:
diff changeset
  1558
				this.csConfig.getScripts().getUncompressedaif().setCategory(category);
cawthron
parents:
diff changeset
  1559
				break;
cawthron
parents:
diff changeset
  1560
			case script_uncompressedbmp:
cawthron
parents:
diff changeset
  1561
				this.csConfig.getScripts().getUncompressedaif().setCategory(category);
cawthron
parents:
diff changeset
  1562
				break;
cawthron
parents:
diff changeset
  1563
			case script_unicodesource:
cawthron
parents:
diff changeset
  1564
				this.csConfig.getScripts(). getUnicodesource().setCategory(category);
cawthron
parents:
diff changeset
  1565
				break;
cawthron
parents:
diff changeset
  1566
			case script_userafter:
cawthron
parents:
diff changeset
  1567
				this.csConfig.getScripts().getUserafter().setCategory(category);
cawthron
parents:
diff changeset
  1568
				break;
cawthron
parents:
diff changeset
  1569
			case script_userfree:
cawthron
parents:
diff changeset
  1570
				this.csConfig.getScripts().getUserfree().setCategory(category);
cawthron
parents:
diff changeset
  1571
				break;
cawthron
parents:
diff changeset
  1572
			case script_userWaitForRequest:
cawthron
parents:
diff changeset
  1573
				this.csConfig.getScripts().getUserWaitForRequest().setCategory(category);
cawthron
parents:
diff changeset
  1574
				break;
cawthron
parents:
diff changeset
  1575
			case script_variablenames:
cawthron
parents:
diff changeset
  1576
				this.csConfig.getScripts().getVariablenames().setCategory(category);
cawthron
parents:
diff changeset
  1577
				break;
cawthron
parents:
diff changeset
  1578
			case script_voidparameter:
cawthron
parents:
diff changeset
  1579
				this.csConfig.getScripts().getVoidparameter().setCategory(category);
cawthron
parents:
diff changeset
  1580
				break;
cawthron
parents:
diff changeset
  1581
			case script_worryingcomments:
cawthron
parents:
diff changeset
  1582
				this.csConfig.getScripts().getWorryingcomments().setCategory(category);
cawthron
parents:
diff changeset
  1583
				break;
cawthron
parents:
diff changeset
  1584
			case script_unknown:
cawthron
parents:
diff changeset
  1585
			default:
cawthron
parents:
diff changeset
  1586
				break;
cawthron
parents:
diff changeset
  1587
		}
cawthron
parents:
diff changeset
  1588
	}
cawthron
parents:
diff changeset
  1589
cawthron
parents:
diff changeset
  1590
	/**
cawthron
parents:
diff changeset
  1591
	 * Retrieve the "severity" attribute of a CodeScanner script element
cawthron
parents:
diff changeset
  1592
	 * @param script - script element containing the attribute
cawthron
parents:
diff changeset
  1593
	 * @return attribute value
cawthron
parents:
diff changeset
  1594
	 */
cawthron
parents:
diff changeset
  1595
	public String getScriptSeverity(CSScript script) {
cawthron
parents:
diff changeset
  1596
		switch (script) {
cawthron
parents:
diff changeset
  1597
			case script_accessArrayElementWithoutCheck:
cawthron
parents:
diff changeset
  1598
				return this.csConfig.getScripts().getAccessArrayElementWithoutCheck().getSeverity().toString();
cawthron
parents:
diff changeset
  1599
			case script_accessArrayElementWithoutCheck2:
cawthron
parents:
diff changeset
  1600
				return this.csConfig.getScripts().getAccessArrayElementWithoutCheck2().getSeverity().toString();
cawthron
parents:
diff changeset
  1601
			case script_activestart:
cawthron
parents:
diff changeset
  1602
				return this.csConfig.getScripts().getActivestart().getSeverity().toString();
cawthron
parents:
diff changeset
  1603
			case script_activestop:
cawthron
parents:
diff changeset
  1604
				return this.csConfig.getScripts().getActivestop().getSeverity().toString();
cawthron
parents:
diff changeset
  1605
			case script_arraypassing:
cawthron
parents:
diff changeset
  1606
				return this.csConfig.getScripts().getArraypassing().getSeverity().toString();
cawthron
parents:
diff changeset
  1607
			case script_arrayptrcleanup:
cawthron
parents:
diff changeset
  1608
				return this.csConfig.getScripts().getArrayptrcleanup().getSeverity().toString();
cawthron
parents:
diff changeset
  1609
			case script_assertdebuginvariant:
cawthron
parents:
diff changeset
  1610
				return this.csConfig.getScripts().getAssertdebuginvariant().getSeverity().toString();
cawthron
parents:
diff changeset
  1611
			case script_baddefines:
cawthron
parents:
diff changeset
  1612
				return this.csConfig.getScripts().getBaddefines().getSeverity().toString();
cawthron
parents:
diff changeset
  1613
			case script_baseconstruct:
cawthron
parents:
diff changeset
  1614
				return this.csConfig.getScripts().getBaseconstruct().getSeverity().toString();
cawthron
parents:
diff changeset
  1615
			case script_callActiveObjectWithoutCheckingOrStopping:
cawthron
parents:
diff changeset
  1616
				return this.csConfig.getScripts().getCallActiveObjectWithoutCheckingOrStopping().getSeverity().toString();
cawthron
parents:
diff changeset
  1617
			case script_changenotification:
cawthron
parents:
diff changeset
  1618
				return this.csConfig.getScripts().getChangenotification().getSeverity().toString();
cawthron
parents:
diff changeset
  1619
			case script_cleanup:
cawthron
parents:
diff changeset
  1620
				return this.csConfig.getScripts().getCleanup().getSeverity().toString();
cawthron
parents:
diff changeset
  1621
			case script_commentcode:
cawthron
parents:
diff changeset
  1622
				return this.csConfig.getScripts().getCommentcode().getSeverity().toString();
cawthron
parents:
diff changeset
  1623
			case script_connect:
cawthron
parents:
diff changeset
  1624
				return this.csConfig.getScripts().getConnect().getSeverity().toString();
cawthron
parents:
diff changeset
  1625
			case script_ConnectAndDontCloseMemberVariable:
cawthron
parents:
diff changeset
  1626
				return this.csConfig.getScripts().getConnectAndDontCloseMemberVariable().getSeverity().toString();
cawthron
parents:
diff changeset
  1627
			case script_constnames:
cawthron
parents:
diff changeset
  1628
				return this.csConfig.getScripts().getConstnames().getSeverity().toString();
cawthron
parents:
diff changeset
  1629
			case script_consttdescptr:
cawthron
parents:
diff changeset
  1630
				return this.csConfig.getScripts().getConsttdescptr().getSeverity().toString();
cawthron
parents:
diff changeset
  1631
			case script_controlornull:
cawthron
parents:
diff changeset
  1632
				return this.csConfig.getScripts().getControlornull().getSeverity().toString();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1633
			case script_crepository:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1634
				return this.csConfig.getScripts().getCrepository().getSeverity().toString();
2
cawthron
parents:
diff changeset
  1635
			case script_ctltargettype:
cawthron
parents:
diff changeset
  1636
				return this.csConfig.getScripts().getCtltargettype().getSeverity().toString();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1637
			case script_customizableicons:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1638
				return this.csConfig.getScripts().getCustomizableicons().getSeverity().toString();
2
cawthron
parents:
diff changeset
  1639
			case script_debugrom:
cawthron
parents:
diff changeset
  1640
				return this.csConfig.getScripts().getDebugrom().getSeverity().toString();
cawthron
parents:
diff changeset
  1641
			case script_declarename:
cawthron
parents:
diff changeset
  1642
				return this.csConfig.getScripts().getDeclarename().getSeverity().toString();
cawthron
parents:
diff changeset
  1643
			case script_deleteMemberVariable:
cawthron
parents:
diff changeset
  1644
				return this.csConfig.getScripts().getDeleteMemberVariable().getSeverity().toString();
cawthron
parents:
diff changeset
  1645
			case script_destructor:
cawthron
parents:
diff changeset
  1646
				return this.csConfig.getScripts().getDestructor().getSeverity().toString();
cawthron
parents:
diff changeset
  1647
			case script_doubleSemiColon:
cawthron
parents:
diff changeset
  1648
				return this.csConfig.getScripts().getDoubleSemiColon().getSeverity().toString();
cawthron
parents:
diff changeset
  1649
			case script_driveletters:
cawthron
parents:
diff changeset
  1650
				return this.csConfig.getScripts().getDriveletters().getSeverity().toString();
cawthron
parents:
diff changeset
  1651
			case script_eikbuttons:
cawthron
parents:
diff changeset
  1652
				return this.csConfig.getScripts().getEikbuttons().getSeverity().toString();
cawthron
parents:
diff changeset
  1653
			case script_eikonenvstatic:
cawthron
parents:
diff changeset
  1654
				return this.csConfig.getScripts().getEikonenvstatic().getSeverity().toString();
cawthron
parents:
diff changeset
  1655
			case script_enummembers:
cawthron
parents:
diff changeset
  1656
				return this.csConfig.getScripts().getEnummembers().getSeverity().toString();
cawthron
parents:
diff changeset
  1657
			case script_enumnames:
cawthron
parents:
diff changeset
  1658
				return this.csConfig.getScripts().getEnumnames().getSeverity().toString();
cawthron
parents:
diff changeset
  1659
			case script_exportinline:
cawthron
parents:
diff changeset
  1660
				return this.csConfig.getScripts().getExportinline().getSeverity().toString();
cawthron
parents:
diff changeset
  1661
			case script_exportpurevirtual:
cawthron
parents:
diff changeset
  1662
				return this.csConfig.getScripts().getExportpurevirtual().getSeverity().toString();
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1663
			case script_flags:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1664
				return this.csConfig.getScripts().getFlags().getSeverity().toString();
2
cawthron
parents:
diff changeset
  1665
			case script_foff:
cawthron
parents:
diff changeset
  1666
				return this.csConfig.getScripts().getFoff().getSeverity().toString();
cawthron
parents:
diff changeset
  1667
			case script_forbiddenwords:
cawthron
parents:
diff changeset
  1668
				return this.csConfig.getScripts().getForbiddenwords().getSeverity().toString();
cawthron
parents:
diff changeset
  1669
			case script_forgottoputptroncleanupstack:
cawthron
parents:
diff changeset
  1670
				return this.csConfig.getScripts().getForgottoputptroncleanupstack().getSeverity().toString();
cawthron
parents:
diff changeset
  1671
			case script_friend:
cawthron
parents:
diff changeset
  1672
				return this.csConfig.getScripts().getFriend().getSeverity().toString();
cawthron
parents:
diff changeset
  1673
			case script_goto:
cawthron
parents:
diff changeset
  1674
				return this.csConfig.getScripts().getGoto().getSeverity().toString();
cawthron
parents:
diff changeset
  1675
			case script_ifassignments:
cawthron
parents:
diff changeset
  1676
				return this.csConfig.getScripts().getIfassignments().getSeverity().toString();
cawthron
parents:
diff changeset
  1677
			case script_ifpreprocessor:
cawthron
parents:
diff changeset
  1678
				return this.csConfig.getScripts().getIfpreprocessor().getSeverity().toString();
cawthron
parents:
diff changeset
  1679
			case script_inheritanceorder:
cawthron
parents:
diff changeset
  1680
				return this.csConfig.getScripts().getInheritanceorder().getSeverity().toString();
cawthron
parents:
diff changeset
  1681
			case script_intleaves:
cawthron
parents:
diff changeset
  1682
				return this.csConfig.getScripts().getIntleaves().getSeverity().toString();
cawthron
parents:
diff changeset
  1683
			case script_jmp:
cawthron
parents:
diff changeset
  1684
				return this.csConfig.getScripts().getJmp().getSeverity().toString();
cawthron
parents:
diff changeset
  1685
			case script_leave:
cawthron
parents:
diff changeset
  1686
				return this.csConfig.getScripts().getLeave().getSeverity().toString();
cawthron
parents:
diff changeset
  1687
			case script_LeaveNoError:
cawthron
parents:
diff changeset
  1688
				return this.csConfig.getScripts().getLeaveNoError().getSeverity().toString();
cawthron
parents:
diff changeset
  1689
			case script_leavingoperators:
cawthron
parents:
diff changeset
  1690
				return this.csConfig.getScripts().getLeavingoperators().getSeverity().toString();
cawthron
parents:
diff changeset
  1691
			case script_LFunctionCantLeave:
cawthron
parents:
diff changeset
  1692
				return this.csConfig.getScripts().getLFunctionCantLeave().getSeverity().toString();
cawthron
parents:
diff changeset
  1693
			case script_longlines: 
cawthron
parents:
diff changeset
  1694
				return this.csConfig.getScripts().getLonglines().getSeverity().toString();
cawthron
parents:
diff changeset
  1695
			case script_magicnumbers:
cawthron
parents:
diff changeset
  1696
				return this.csConfig.getScripts().getMagicnumbers().getSeverity().toString();
cawthron
parents:
diff changeset
  1697
			case script_mclassdestructor:
cawthron
parents:
diff changeset
  1698
				return this.csConfig.getScripts().getMclassdestructor().getSeverity().toString();
cawthron
parents:
diff changeset
  1699
			case script_memberlc:
cawthron
parents:
diff changeset
  1700
				return this.csConfig.getScripts().getMemberlc().getSeverity().toString();
cawthron
parents:
diff changeset
  1701
			case script_membervariablecallld:
cawthron
parents:
diff changeset
  1702
				return this.csConfig.getScripts().getMembervariablecallld().getSeverity().toString();
cawthron
parents:
diff changeset
  1703
			case script_missingcancel:
cawthron
parents:
diff changeset
  1704
				return this.csConfig.getScripts().getMissingcancel().getSeverity().toString();
cawthron
parents:
diff changeset
  1705
			case script_missingcclass:
cawthron
parents:
diff changeset
  1706
				return this.csConfig.getScripts().getMissingcclass().getSeverity().toString();
cawthron
parents:
diff changeset
  1707
			case script_mmpsourcepath:
cawthron
parents:
diff changeset
  1708
				return this.csConfig.getScripts().getMmpsourcepath().getSeverity().toString();
cawthron
parents:
diff changeset
  1709
			case script_multilangrsc:
cawthron
parents:
diff changeset
  1710
				return this.csConfig.getScripts().getMultilangrsc().getSeverity().toString();
cawthron
parents:
diff changeset
  1711
			case script_multipledeclarations:
cawthron
parents:
diff changeset
  1712
				return this.csConfig.getScripts().getMultipledeclarations().getSeverity().toString();
cawthron
parents:
diff changeset
  1713
			case script_multipleinheritance:
cawthron
parents:
diff changeset
  1714
				return this.csConfig.getScripts().getMultipleinheritance().getSeverity().toString();
cawthron
parents:
diff changeset
  1715
			case script_mydocs:
cawthron
parents:
diff changeset
  1716
				return this.csConfig.getScripts().getMydocs().getSeverity().toString();
cawthron
parents:
diff changeset
  1717
			case script_namespace:
cawthron
parents:
diff changeset
  1718
				return this.csConfig.getScripts().getNamespace().getSeverity().toString();
cawthron
parents:
diff changeset
  1719
			case script_newlreferences:
cawthron
parents:
diff changeset
  1720
				return this.csConfig.getScripts().getNewlreferences().getSeverity().toString();
cawthron
parents:
diff changeset
  1721
			case script_noleavetrap:
cawthron
parents:
diff changeset
  1722
				return this.csConfig.getScripts().getNoleavetrap().getSeverity().toString();
cawthron
parents:
diff changeset
  1723
			case script_nonconsthbufc:
cawthron
parents:
diff changeset
  1724
				return this.csConfig.getScripts().getNonconsthbufc().getSeverity().toString();
cawthron
parents:
diff changeset
  1725
			case script_nonconsttdesc:
cawthron
parents:
diff changeset
  1726
				return this.csConfig.getScripts().getNonconsttdesc().getSeverity().toString();
cawthron
parents:
diff changeset
  1727
			case script_nonleavenew:
cawthron
parents:
diff changeset
  1728
				return this.csConfig.getScripts().getNonleavenew().getSeverity().toString();
cawthron
parents:
diff changeset
  1729
			case script_nonunicodeskins:
cawthron
parents:
diff changeset
  1730
				return this.csConfig.getScripts().getNonunicodeskins().getSeverity().toString();
cawthron
parents:
diff changeset
  1731
			case script_null:
cawthron
parents:
diff changeset
  1732
				return this.csConfig.getScripts().getNull().getSeverity().toString();
cawthron
parents:
diff changeset
  1733
			case script_open:
cawthron
parents:
diff changeset
  1734
				return this.csConfig.getScripts().getOpen().getSeverity().toString();
cawthron
parents:
diff changeset
  1735
			case script_pointertoarrays:
cawthron
parents:
diff changeset
  1736
				return this.csConfig.getScripts().getPointertoarrays().getSeverity().toString();
cawthron
parents:
diff changeset
  1737
			case script_pragmadisable:
cawthron
parents:
diff changeset
  1738
				return this.csConfig.getScripts().getPragmadisable().getSeverity().toString();
cawthron
parents:
diff changeset
  1739
			case script_pragmamessage:
cawthron
parents:
diff changeset
  1740
				return this.csConfig.getScripts().getPragmamessage().getSeverity().toString();
cawthron
parents:
diff changeset
  1741
			case script_pragmaother:
cawthron
parents:
diff changeset
  1742
				return this.csConfig.getScripts().getPragmaother().getSeverity().toString();
cawthron
parents:
diff changeset
  1743
			case script_privateinheritance:
cawthron
parents:
diff changeset
  1744
				return this.csConfig.getScripts().getPrivateinheritance().getSeverity().toString();
cawthron
parents:
diff changeset
  1745
			case script_pushaddrvar:
cawthron
parents:
diff changeset
  1746
				return this.csConfig.getScripts().getPushaddrvar().getSeverity().toString();
cawthron
parents:
diff changeset
  1747
			case script_pushmember:
cawthron
parents:
diff changeset
  1748
				return this.csConfig.getScripts().getPushmember().getSeverity().toString();
cawthron
parents:
diff changeset
  1749
			case script_readresource:
cawthron
parents:
diff changeset
  1750
				return this.csConfig.getScripts().getReadresource().getSeverity().toString();
cawthron
parents:
diff changeset
  1751
			case script_resourcenotoncleanupstack:
cawthron
parents:
diff changeset
  1752
				return this.csConfig.getScripts().getResourcenotoncleanupstack().getSeverity().toString();
cawthron
parents:
diff changeset
  1753
			case script_resourcesonheap:
cawthron
parents:
diff changeset
  1754
				return this.csConfig.getScripts().getResourcesonheap().getSeverity().toString();
cawthron
parents:
diff changeset
  1755
			case script_returndescriptoroutofscope:
cawthron
parents:
diff changeset
  1756
				return this.csConfig.getScripts().getReturndescriptoroutofscope().getSeverity().toString();
cawthron
parents:
diff changeset
  1757
			case script_rfs:
cawthron
parents:
diff changeset
  1758
				return this.csConfig.getScripts().getRfs().getSeverity().toString();
cawthron
parents:
diff changeset
  1759
			case script_rssnames:
cawthron
parents:
diff changeset
  1760
				return this.csConfig.getScripts().getRssnames().getSeverity().toString();
cawthron
parents:
diff changeset
  1761
			case script_stringliterals:
cawthron
parents:
diff changeset
  1762
				return this.csConfig.getScripts().getStringliterals().getSeverity().toString();
cawthron
parents:
diff changeset
  1763
			case script_stringsinresourcefiles:
cawthron
parents:
diff changeset
  1764
				return this.csConfig.getScripts().getStringsinresourcefiles().getSeverity().toString();
cawthron
parents:
diff changeset
  1765
			case script_struct:
cawthron
parents:
diff changeset
  1766
				return this.csConfig.getScripts().getStruct().getSeverity().toString();
cawthron
parents:
diff changeset
  1767
			case script_tcclasses:
cawthron
parents:
diff changeset
  1768
				return this.csConfig.getScripts().getTcclasses().getSeverity().toString();
cawthron
parents:
diff changeset
  1769
			case script_tclassdestructor:
cawthron
parents:
diff changeset
  1770
				return this.csConfig.getScripts().getTclassdestructor().getSeverity().toString();
cawthron
parents:
diff changeset
  1771
			case script_todocomments:
cawthron
parents:
diff changeset
  1772
				return this.csConfig.getScripts().getTodocomments().getSeverity().toString();
cawthron
parents:
diff changeset
  1773
			case script_trapcleanup:
cawthron
parents:
diff changeset
  1774
				return this.csConfig.getScripts().getTrapcleanup().getSeverity().toString();
cawthron
parents:
diff changeset
  1775
			case script_trapeleave:
cawthron
parents:
diff changeset
  1776
				return this.csConfig.getScripts().getTrapeleave().getSeverity().toString();
cawthron
parents:
diff changeset
  1777
			case script_traprunl:
cawthron
parents:
diff changeset
  1778
				return this.csConfig.getScripts().getTraprunl().getSeverity().toString();
cawthron
parents:
diff changeset
  1779
			case script_trspassing:
cawthron
parents:
diff changeset
  1780
				return this.csConfig.getScripts().getTrspassing().getSeverity().toString();
cawthron
parents:
diff changeset
  1781
			case script_uids:
cawthron
parents:
diff changeset
  1782
				return this.csConfig.getScripts().getUids().getSeverity().toString();
cawthron
parents:
diff changeset
  1783
			case script_uncompressedaif:
cawthron
parents:
diff changeset
  1784
				return this.csConfig.getScripts().getUncompressedaif().getSeverity().toString();
cawthron
parents:
diff changeset
  1785
			case script_uncompressedbmp:
cawthron
parents:
diff changeset
  1786
				return this.csConfig.getScripts().getUncompressedaif().getSeverity().toString();
cawthron
parents:
diff changeset
  1787
			case script_unicodesource:
cawthron
parents:
diff changeset
  1788
				return this.csConfig.getScripts(). getUnicodesource().getSeverity().toString();
cawthron
parents:
diff changeset
  1789
			case script_userafter:
cawthron
parents:
diff changeset
  1790
				return this.csConfig.getScripts().getUserafter().getSeverity().toString();
cawthron
parents:
diff changeset
  1791
			case script_userfree:
cawthron
parents:
diff changeset
  1792
				return this.csConfig.getScripts().getUserfree().getSeverity().toString();
cawthron
parents:
diff changeset
  1793
			case script_userWaitForRequest:
cawthron
parents:
diff changeset
  1794
				return this.csConfig.getScripts().getUserWaitForRequest().getSeverity().toString();
cawthron
parents:
diff changeset
  1795
			case script_variablenames:
cawthron
parents:
diff changeset
  1796
				return this.csConfig.getScripts().getVariablenames().getSeverity().toString();
cawthron
parents:
diff changeset
  1797
			case script_voidparameter:
cawthron
parents:
diff changeset
  1798
				return this.csConfig.getScripts().getVoidparameter().getSeverity().toString();
cawthron
parents:
diff changeset
  1799
			case script_worryingcomments:
cawthron
parents:
diff changeset
  1800
				return this.csConfig.getScripts().getWorryingcomments().getSeverity().toString();
cawthron
parents:
diff changeset
  1801
			case script_unknown:
cawthron
parents:
diff changeset
  1802
			default:
cawthron
parents:
diff changeset
  1803
				return "high";
cawthron
parents:
diff changeset
  1804
		}
cawthron
parents:
diff changeset
  1805
	}
cawthron
parents:
diff changeset
  1806
cawthron
parents:
diff changeset
  1807
	/**
cawthron
parents:
diff changeset
  1808
	 * Set the "severity" attribute of a CodeScanner script element
cawthron
parents:
diff changeset
  1809
	 * @param script - script element containing the attribute
cawthron
parents:
diff changeset
  1810
	 * @param value - new attribute value
cawthron
parents:
diff changeset
  1811
	 */
cawthron
parents:
diff changeset
  1812
	public void setScriptSeverity(CSScript script, String value) {
cawthron
parents:
diff changeset
  1813
		SeverityType severity = SeverityType.get(value);
cawthron
parents:
diff changeset
  1814
		switch (script) {
cawthron
parents:
diff changeset
  1815
			case script_accessArrayElementWithoutCheck:
cawthron
parents:
diff changeset
  1816
				this.csConfig.getScripts().getAccessArrayElementWithoutCheck().setSeverity(severity);
cawthron
parents:
diff changeset
  1817
				break;
cawthron
parents:
diff changeset
  1818
			case script_accessArrayElementWithoutCheck2:
cawthron
parents:
diff changeset
  1819
				this.csConfig.getScripts().getAccessArrayElementWithoutCheck2().setSeverity(severity);
cawthron
parents:
diff changeset
  1820
				break;
cawthron
parents:
diff changeset
  1821
			case script_activestart:
cawthron
parents:
diff changeset
  1822
				this.csConfig.getScripts().getActivestart().setSeverity(severity);
cawthron
parents:
diff changeset
  1823
				break;
cawthron
parents:
diff changeset
  1824
			case script_activestop:
cawthron
parents:
diff changeset
  1825
				this.csConfig.getScripts().getActivestop().setSeverity(severity);
cawthron
parents:
diff changeset
  1826
				break;
cawthron
parents:
diff changeset
  1827
			case script_arraypassing:
cawthron
parents:
diff changeset
  1828
				this.csConfig.getScripts().getArraypassing().setSeverity(severity);
cawthron
parents:
diff changeset
  1829
				break;
cawthron
parents:
diff changeset
  1830
			case script_arrayptrcleanup:
cawthron
parents:
diff changeset
  1831
				this.csConfig.getScripts().getArrayptrcleanup().setSeverity(severity);
cawthron
parents:
diff changeset
  1832
				break;
cawthron
parents:
diff changeset
  1833
			case script_assertdebuginvariant:
cawthron
parents:
diff changeset
  1834
				this.csConfig.getScripts().getAssertdebuginvariant().setSeverity(severity);
cawthron
parents:
diff changeset
  1835
				break;
cawthron
parents:
diff changeset
  1836
			case script_baddefines:
cawthron
parents:
diff changeset
  1837
				this.csConfig.getScripts().getBaddefines().setSeverity(severity);
cawthron
parents:
diff changeset
  1838
				break;
cawthron
parents:
diff changeset
  1839
			case script_baseconstruct:
cawthron
parents:
diff changeset
  1840
				this.csConfig.getScripts().getBaseconstruct().setSeverity(severity);
cawthron
parents:
diff changeset
  1841
				break;
cawthron
parents:
diff changeset
  1842
			case script_callActiveObjectWithoutCheckingOrStopping:
cawthron
parents:
diff changeset
  1843
				this.csConfig.getScripts().getCallActiveObjectWithoutCheckingOrStopping().setSeverity(severity);
cawthron
parents:
diff changeset
  1844
				break;
cawthron
parents:
diff changeset
  1845
			case script_changenotification:
cawthron
parents:
diff changeset
  1846
				this.csConfig.getScripts().getChangenotification().setSeverity(severity);
cawthron
parents:
diff changeset
  1847
				break;
cawthron
parents:
diff changeset
  1848
			case script_cleanup:
cawthron
parents:
diff changeset
  1849
				this.csConfig.getScripts().getCleanup().setSeverity(severity);
cawthron
parents:
diff changeset
  1850
				break;
cawthron
parents:
diff changeset
  1851
			case script_commentcode:
cawthron
parents:
diff changeset
  1852
				this.csConfig.getScripts().getCommentcode().setSeverity(severity);
cawthron
parents:
diff changeset
  1853
				break;
cawthron
parents:
diff changeset
  1854
			case script_connect:
cawthron
parents:
diff changeset
  1855
				this.csConfig.getScripts().getConnect().setSeverity(severity);
cawthron
parents:
diff changeset
  1856
				break;
cawthron
parents:
diff changeset
  1857
			case script_ConnectAndDontCloseMemberVariable:
cawthron
parents:
diff changeset
  1858
				this.csConfig.getScripts().getConnectAndDontCloseMemberVariable().setSeverity(severity);
cawthron
parents:
diff changeset
  1859
				break;
cawthron
parents:
diff changeset
  1860
			case script_constnames:
cawthron
parents:
diff changeset
  1861
				this.csConfig.getScripts().getConstnames().setSeverity(severity);
cawthron
parents:
diff changeset
  1862
				break;
cawthron
parents:
diff changeset
  1863
			case script_consttdescptr:
cawthron
parents:
diff changeset
  1864
				this.csConfig.getScripts().getConsttdescptr().setSeverity(severity);
cawthron
parents:
diff changeset
  1865
				break;
cawthron
parents:
diff changeset
  1866
			case script_controlornull:
cawthron
parents:
diff changeset
  1867
				this.csConfig.getScripts().getControlornull().setSeverity(severity);
cawthron
parents:
diff changeset
  1868
				break;
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1869
			case script_crepository:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1870
				this.csConfig.getScripts().getCrepository().setSeverity(severity);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1871
				break;
2
cawthron
parents:
diff changeset
  1872
			case script_ctltargettype:
cawthron
parents:
diff changeset
  1873
				this.csConfig.getScripts().getCtltargettype().setSeverity(severity);
cawthron
parents:
diff changeset
  1874
				break;
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1875
			case script_customizableicons:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1876
				this.csConfig.getScripts().getCustomizableicons().setSeverity(severity);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1877
				break;
2
cawthron
parents:
diff changeset
  1878
			case script_debugrom:
cawthron
parents:
diff changeset
  1879
				this.csConfig.getScripts().getDebugrom().setSeverity(severity);
cawthron
parents:
diff changeset
  1880
				break;
cawthron
parents:
diff changeset
  1881
			case script_declarename:
cawthron
parents:
diff changeset
  1882
				this.csConfig.getScripts().getDeclarename().setSeverity(severity);
cawthron
parents:
diff changeset
  1883
				break;
cawthron
parents:
diff changeset
  1884
			case script_deleteMemberVariable:
cawthron
parents:
diff changeset
  1885
				this.csConfig.getScripts().getDeleteMemberVariable().setSeverity(severity);
cawthron
parents:
diff changeset
  1886
				break;
cawthron
parents:
diff changeset
  1887
			case script_destructor:
cawthron
parents:
diff changeset
  1888
				this.csConfig.getScripts().getDestructor().setSeverity(severity);
cawthron
parents:
diff changeset
  1889
				break;
cawthron
parents:
diff changeset
  1890
			case script_doubleSemiColon:
cawthron
parents:
diff changeset
  1891
				this.csConfig.getScripts().getDoubleSemiColon().setSeverity(severity);
cawthron
parents:
diff changeset
  1892
				break;
cawthron
parents:
diff changeset
  1893
			case script_driveletters:
cawthron
parents:
diff changeset
  1894
				this.csConfig.getScripts().getDriveletters().setSeverity(severity);
cawthron
parents:
diff changeset
  1895
				break;
cawthron
parents:
diff changeset
  1896
			case script_eikbuttons:
cawthron
parents:
diff changeset
  1897
				this.csConfig.getScripts().getEikbuttons().setSeverity(severity);
cawthron
parents:
diff changeset
  1898
				break;
cawthron
parents:
diff changeset
  1899
			case script_eikonenvstatic:
cawthron
parents:
diff changeset
  1900
				this.csConfig.getScripts().getEikonenvstatic().setSeverity(severity);
cawthron
parents:
diff changeset
  1901
				break;
cawthron
parents:
diff changeset
  1902
			case script_enummembers:
cawthron
parents:
diff changeset
  1903
				this.csConfig.getScripts().getEnummembers().setSeverity(severity);
cawthron
parents:
diff changeset
  1904
				break;
cawthron
parents:
diff changeset
  1905
			case script_enumnames:
cawthron
parents:
diff changeset
  1906
				this.csConfig.getScripts().getEnumnames().setSeverity(severity);
cawthron
parents:
diff changeset
  1907
				break;
cawthron
parents:
diff changeset
  1908
			case script_exportinline:
cawthron
parents:
diff changeset
  1909
				this.csConfig.getScripts().getExportinline().setSeverity(severity);
cawthron
parents:
diff changeset
  1910
				break;
cawthron
parents:
diff changeset
  1911
			case script_exportpurevirtual:
cawthron
parents:
diff changeset
  1912
				this.csConfig.getScripts().getExportpurevirtual().setSeverity(severity);
cawthron
parents:
diff changeset
  1913
				break;
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1914
			case script_flags:
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1915
				this.csConfig.getScripts().getFlags().setSeverity(severity);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  1916
				break;
2
cawthron
parents:
diff changeset
  1917
			case script_foff:
cawthron
parents:
diff changeset
  1918
				this.csConfig.getScripts().getFoff().setSeverity(severity);
cawthron
parents:
diff changeset
  1919
				break;
cawthron
parents:
diff changeset
  1920
			case script_forbiddenwords:
cawthron
parents:
diff changeset
  1921
				this.csConfig.getScripts().getForbiddenwords().setSeverity(severity);
cawthron
parents:
diff changeset
  1922
				break;
cawthron
parents:
diff changeset
  1923
			case script_forgottoputptroncleanupstack:
cawthron
parents:
diff changeset
  1924
				this.csConfig.getScripts().getForgottoputptroncleanupstack().setSeverity(severity);
cawthron
parents:
diff changeset
  1925
				break;
cawthron
parents:
diff changeset
  1926
			case script_friend:
cawthron
parents:
diff changeset
  1927
				this.csConfig.getScripts().getFriend().setSeverity(severity);
cawthron
parents:
diff changeset
  1928
				break;
cawthron
parents:
diff changeset
  1929
			case script_goto:
cawthron
parents:
diff changeset
  1930
				this.csConfig.getScripts().getGoto().setSeverity(severity);
cawthron
parents:
diff changeset
  1931
				break;
cawthron
parents:
diff changeset
  1932
			case script_ifassignments:
cawthron
parents:
diff changeset
  1933
				this.csConfig.getScripts().getIfassignments().setSeverity(severity);
cawthron
parents:
diff changeset
  1934
				break;
cawthron
parents:
diff changeset
  1935
			case script_ifpreprocessor:
cawthron
parents:
diff changeset
  1936
				this.csConfig.getScripts().getIfpreprocessor().setSeverity(severity);
cawthron
parents:
diff changeset
  1937
				break;
cawthron
parents:
diff changeset
  1938
			case script_inheritanceorder:
cawthron
parents:
diff changeset
  1939
				this.csConfig.getScripts().getInheritanceorder().setSeverity(severity);
cawthron
parents:
diff changeset
  1940
				break;
cawthron
parents:
diff changeset
  1941
			case script_intleaves:
cawthron
parents:
diff changeset
  1942
				this.csConfig.getScripts().getIntleaves().setSeverity(severity);
cawthron
parents:
diff changeset
  1943
				break;
cawthron
parents:
diff changeset
  1944
			case script_jmp:
cawthron
parents:
diff changeset
  1945
				this.csConfig.getScripts().getJmp().setSeverity(severity);
cawthron
parents:
diff changeset
  1946
				break;
cawthron
parents:
diff changeset
  1947
			case script_leave:
cawthron
parents:
diff changeset
  1948
				this.csConfig.getScripts().getLeave().setSeverity(severity);
cawthron
parents:
diff changeset
  1949
				break;
cawthron
parents:
diff changeset
  1950
			case script_LeaveNoError:
cawthron
parents:
diff changeset
  1951
				this.csConfig.getScripts().getLeaveNoError().setSeverity(severity);
cawthron
parents:
diff changeset
  1952
				break;
cawthron
parents:
diff changeset
  1953
			case script_leavingoperators:
cawthron
parents:
diff changeset
  1954
				this.csConfig.getScripts().getLeavingoperators().setSeverity(severity);
cawthron
parents:
diff changeset
  1955
				break;
cawthron
parents:
diff changeset
  1956
			case script_LFunctionCantLeave:
cawthron
parents:
diff changeset
  1957
				this.csConfig.getScripts().getLFunctionCantLeave().setSeverity(severity);
cawthron
parents:
diff changeset
  1958
				break;
cawthron
parents:
diff changeset
  1959
			case script_longlines: 
cawthron
parents:
diff changeset
  1960
				this.csConfig.getScripts().getLonglines().setSeverity(severity);
cawthron
parents:
diff changeset
  1961
				break;
cawthron
parents:
diff changeset
  1962
			case script_magicnumbers:
cawthron
parents:
diff changeset
  1963
				this.csConfig.getScripts().getMagicnumbers().setSeverity(severity);
cawthron
parents:
diff changeset
  1964
				break;
cawthron
parents:
diff changeset
  1965
			case script_mclassdestructor:
cawthron
parents:
diff changeset
  1966
				this.csConfig.getScripts().getMclassdestructor().setSeverity(severity);
cawthron
parents:
diff changeset
  1967
				break;
cawthron
parents:
diff changeset
  1968
			case script_memberlc:
cawthron
parents:
diff changeset
  1969
				this.csConfig.getScripts().getMemberlc().setSeverity(severity);
cawthron
parents:
diff changeset
  1970
				break;
cawthron
parents:
diff changeset
  1971
			case script_membervariablecallld:
cawthron
parents:
diff changeset
  1972
				this.csConfig.getScripts().getMembervariablecallld().setSeverity(severity);
cawthron
parents:
diff changeset
  1973
				break;
cawthron
parents:
diff changeset
  1974
			case script_missingcancel:
cawthron
parents:
diff changeset
  1975
				this.csConfig.getScripts().getMissingcancel().setSeverity(severity);
cawthron
parents:
diff changeset
  1976
				break;
cawthron
parents:
diff changeset
  1977
			case script_missingcclass:
cawthron
parents:
diff changeset
  1978
				this.csConfig.getScripts().getMissingcclass().setSeverity(severity);
cawthron
parents:
diff changeset
  1979
				break;
cawthron
parents:
diff changeset
  1980
			case script_mmpsourcepath:
cawthron
parents:
diff changeset
  1981
				this.csConfig.getScripts().getMmpsourcepath().setSeverity(severity);
cawthron
parents:
diff changeset
  1982
				break;
cawthron
parents:
diff changeset
  1983
			case script_multilangrsc:
cawthron
parents:
diff changeset
  1984
				this.csConfig.getScripts().getMultilangrsc().setSeverity(severity);
cawthron
parents:
diff changeset
  1985
				break;
cawthron
parents:
diff changeset
  1986
			case script_multipledeclarations:
cawthron
parents:
diff changeset
  1987
				this.csConfig.getScripts().getMultipledeclarations().setSeverity(severity);
cawthron
parents:
diff changeset
  1988
				break;
cawthron
parents:
diff changeset
  1989
			case script_multipleinheritance:
cawthron
parents:
diff changeset
  1990
				this.csConfig.getScripts().getMultipleinheritance().setSeverity(severity);
cawthron
parents:
diff changeset
  1991
				break;
cawthron
parents:
diff changeset
  1992
			case script_mydocs:
cawthron
parents:
diff changeset
  1993
				this.csConfig.getScripts().getMydocs().setSeverity(severity);
cawthron
parents:
diff changeset
  1994
				break;
cawthron
parents:
diff changeset
  1995
			case script_namespace:
cawthron
parents:
diff changeset
  1996
				this.csConfig.getScripts().getNamespace().setSeverity(severity);
cawthron
parents:
diff changeset
  1997
				break;
cawthron
parents:
diff changeset
  1998
			case script_newlreferences:
cawthron
parents:
diff changeset
  1999
				this.csConfig.getScripts().getNewlreferences().setSeverity(severity);
cawthron
parents:
diff changeset
  2000
				break;
cawthron
parents:
diff changeset
  2001
			case script_noleavetrap:
cawthron
parents:
diff changeset
  2002
				this.csConfig.getScripts().getNoleavetrap().setSeverity(severity);
cawthron
parents:
diff changeset
  2003
				break;
cawthron
parents:
diff changeset
  2004
			case script_nonconsthbufc:
cawthron
parents:
diff changeset
  2005
				this.csConfig.getScripts().getNonconsthbufc().setSeverity(severity);
cawthron
parents:
diff changeset
  2006
				break;
cawthron
parents:
diff changeset
  2007
			case script_nonconsttdesc:
cawthron
parents:
diff changeset
  2008
				this.csConfig.getScripts().getNonconsttdesc().setSeverity(severity);
cawthron
parents:
diff changeset
  2009
				break;
cawthron
parents:
diff changeset
  2010
			case script_nonleavenew:
cawthron
parents:
diff changeset
  2011
				this.csConfig.getScripts().getNonleavenew().setSeverity(severity);
cawthron
parents:
diff changeset
  2012
				break;
cawthron
parents:
diff changeset
  2013
			case script_nonunicodeskins:
cawthron
parents:
diff changeset
  2014
				this.csConfig.getScripts().getNonunicodeskins().setSeverity(severity);
cawthron
parents:
diff changeset
  2015
				break;
cawthron
parents:
diff changeset
  2016
			case script_null:
cawthron
parents:
diff changeset
  2017
				this.csConfig.getScripts().getNull().setSeverity(severity);
cawthron
parents:
diff changeset
  2018
				break;
cawthron
parents:
diff changeset
  2019
			case script_open:
cawthron
parents:
diff changeset
  2020
				this.csConfig.getScripts().getOpen().setSeverity(severity);
cawthron
parents:
diff changeset
  2021
				break;
cawthron
parents:
diff changeset
  2022
			case script_pointertoarrays:
cawthron
parents:
diff changeset
  2023
				this.csConfig.getScripts().getPointertoarrays().setSeverity(severity);
cawthron
parents:
diff changeset
  2024
				break;
cawthron
parents:
diff changeset
  2025
			case script_pragmadisable:
cawthron
parents:
diff changeset
  2026
				this.csConfig.getScripts().getPragmadisable().setSeverity(severity);
cawthron
parents:
diff changeset
  2027
				break;
cawthron
parents:
diff changeset
  2028
			case script_pragmamessage:
cawthron
parents:
diff changeset
  2029
				this.csConfig.getScripts().getPragmamessage().setSeverity(severity);
cawthron
parents:
diff changeset
  2030
				break;
cawthron
parents:
diff changeset
  2031
			case script_pragmaother:
cawthron
parents:
diff changeset
  2032
				this.csConfig.getScripts().getPragmaother().setSeverity(severity);
cawthron
parents:
diff changeset
  2033
				break;
cawthron
parents:
diff changeset
  2034
			case script_privateinheritance:
cawthron
parents:
diff changeset
  2035
				this.csConfig.getScripts().getPrivateinheritance().setSeverity(severity);
cawthron
parents:
diff changeset
  2036
				break;
cawthron
parents:
diff changeset
  2037
			case script_pushaddrvar:
cawthron
parents:
diff changeset
  2038
				this.csConfig.getScripts().getPushaddrvar().setSeverity(severity);
cawthron
parents:
diff changeset
  2039
				break;
cawthron
parents:
diff changeset
  2040
			case script_pushmember:
cawthron
parents:
diff changeset
  2041
				this.csConfig.getScripts().getPushmember().setSeverity(severity);
cawthron
parents:
diff changeset
  2042
				break;
cawthron
parents:
diff changeset
  2043
			case script_readresource:
cawthron
parents:
diff changeset
  2044
				this.csConfig.getScripts().getReadresource().setSeverity(severity);
cawthron
parents:
diff changeset
  2045
				break;
cawthron
parents:
diff changeset
  2046
			case script_resourcenotoncleanupstack:
cawthron
parents:
diff changeset
  2047
				this.csConfig.getScripts().getResourcenotoncleanupstack().setSeverity(severity);
cawthron
parents:
diff changeset
  2048
				break;
cawthron
parents:
diff changeset
  2049
			case script_resourcesonheap:
cawthron
parents:
diff changeset
  2050
				this.csConfig.getScripts().getResourcesonheap().setSeverity(severity);
cawthron
parents:
diff changeset
  2051
				break;
cawthron
parents:
diff changeset
  2052
			case script_returndescriptoroutofscope:
cawthron
parents:
diff changeset
  2053
				this.csConfig.getScripts().getReturndescriptoroutofscope().setSeverity(severity);
cawthron
parents:
diff changeset
  2054
				break;
cawthron
parents:
diff changeset
  2055
			case script_rfs:
cawthron
parents:
diff changeset
  2056
				this.csConfig.getScripts().getRfs().setSeverity(severity);
cawthron
parents:
diff changeset
  2057
				break;
cawthron
parents:
diff changeset
  2058
			case script_rssnames:
cawthron
parents:
diff changeset
  2059
				this.csConfig.getScripts().getRssnames().setSeverity(severity);
cawthron
parents:
diff changeset
  2060
				break;
cawthron
parents:
diff changeset
  2061
			case script_stringliterals:
cawthron
parents:
diff changeset
  2062
				this.csConfig.getScripts().getStringliterals().setSeverity(severity);
cawthron
parents:
diff changeset
  2063
				break;
cawthron
parents:
diff changeset
  2064
			case script_stringsinresourcefiles:
cawthron
parents:
diff changeset
  2065
				this.csConfig.getScripts().getStringsinresourcefiles().setSeverity(severity);
cawthron
parents:
diff changeset
  2066
				break;
cawthron
parents:
diff changeset
  2067
			case script_struct:
cawthron
parents:
diff changeset
  2068
				this.csConfig.getScripts().getStruct().setSeverity(severity);
cawthron
parents:
diff changeset
  2069
				break;
cawthron
parents:
diff changeset
  2070
			case script_tcclasses:
cawthron
parents:
diff changeset
  2071
				this.csConfig.getScripts().getTcclasses().setSeverity(severity);
cawthron
parents:
diff changeset
  2072
				break;
cawthron
parents:
diff changeset
  2073
			case script_tclassdestructor:
cawthron
parents:
diff changeset
  2074
				this.csConfig.getScripts().getTclassdestructor().setSeverity(severity);
cawthron
parents:
diff changeset
  2075
				break;
cawthron
parents:
diff changeset
  2076
			case script_todocomments:
cawthron
parents:
diff changeset
  2077
				this.csConfig.getScripts().getTodocomments().setSeverity(severity);
cawthron
parents:
diff changeset
  2078
				break;
cawthron
parents:
diff changeset
  2079
			case script_trapcleanup:
cawthron
parents:
diff changeset
  2080
				this.csConfig.getScripts().getTrapcleanup().setSeverity(severity);
cawthron
parents:
diff changeset
  2081
				break;
cawthron
parents:
diff changeset
  2082
			case script_trapeleave:
cawthron
parents:
diff changeset
  2083
				this.csConfig.getScripts().getTrapeleave().setSeverity(severity);
cawthron
parents:
diff changeset
  2084
				break;
cawthron
parents:
diff changeset
  2085
			case script_traprunl:
cawthron
parents:
diff changeset
  2086
				this.csConfig.getScripts().getTraprunl().setSeverity(severity);
cawthron
parents:
diff changeset
  2087
				break;
cawthron
parents:
diff changeset
  2088
			case script_trspassing:
cawthron
parents:
diff changeset
  2089
				this.csConfig.getScripts().getTrspassing().setSeverity(severity);
cawthron
parents:
diff changeset
  2090
				break;
cawthron
parents:
diff changeset
  2091
			case script_uids:
cawthron
parents:
diff changeset
  2092
				this.csConfig.getScripts().getUids().setSeverity(severity);
cawthron
parents:
diff changeset
  2093
				break;
cawthron
parents:
diff changeset
  2094
			case script_uncompressedaif:
cawthron
parents:
diff changeset
  2095
				this.csConfig.getScripts().getUncompressedaif().setSeverity(severity);
cawthron
parents:
diff changeset
  2096
				break;
cawthron
parents:
diff changeset
  2097
			case script_uncompressedbmp:
cawthron
parents:
diff changeset
  2098
				this.csConfig.getScripts().getUncompressedaif().setSeverity(severity);
cawthron
parents:
diff changeset
  2099
				break;
cawthron
parents:
diff changeset
  2100
			case script_unicodesource:
cawthron
parents:
diff changeset
  2101
				this.csConfig.getScripts(). getUnicodesource().setSeverity(severity);
cawthron
parents:
diff changeset
  2102
				break;
cawthron
parents:
diff changeset
  2103
			case script_userafter:
cawthron
parents:
diff changeset
  2104
				this.csConfig.getScripts().getUserafter().setSeverity(severity);
cawthron
parents:
diff changeset
  2105
				break;
cawthron
parents:
diff changeset
  2106
			case script_userfree:
cawthron
parents:
diff changeset
  2107
				this.csConfig.getScripts().getUserfree().setSeverity(severity);
cawthron
parents:
diff changeset
  2108
				break;
cawthron
parents:
diff changeset
  2109
			case script_userWaitForRequest:
cawthron
parents:
diff changeset
  2110
				this.csConfig.getScripts().getUserWaitForRequest().setSeverity(severity);
cawthron
parents:
diff changeset
  2111
				break;
cawthron
parents:
diff changeset
  2112
			case script_variablenames:
cawthron
parents:
diff changeset
  2113
				this.csConfig.getScripts().getVariablenames().setSeverity(severity);
cawthron
parents:
diff changeset
  2114
				break;
cawthron
parents:
diff changeset
  2115
			case script_voidparameter:
cawthron
parents:
diff changeset
  2116
				this.csConfig.getScripts().getVoidparameter().setSeverity(severity);
cawthron
parents:
diff changeset
  2117
				break;
cawthron
parents:
diff changeset
  2118
			case script_worryingcomments:
cawthron
parents:
diff changeset
  2119
				this.csConfig.getScripts().getWorryingcomments().setSeverity(severity);
cawthron
parents:
diff changeset
  2120
				break;
cawthron
parents:
diff changeset
  2121
			case script_unknown:
cawthron
parents:
diff changeset
  2122
			default:
cawthron
parents:
diff changeset
  2123
				break;
cawthron
parents:
diff changeset
  2124
		}
cawthron
parents:
diff changeset
  2125
	}
cawthron
parents:
diff changeset
  2126
cawthron
parents:
diff changeset
  2127
	/**
cawthron
parents:
diff changeset
  2128
	 * Retrieve the cclassIgnoreRE value of the missingcclass script
cawthron
parents:
diff changeset
  2129
	 * @return cclassIgnoreRE
cawthron
parents:
diff changeset
  2130
	 */
cawthron
parents:
diff changeset
  2131
	public String getScriptCClassIgnore() {
cawthron
parents:
diff changeset
  2132
		return this.csConfig.getScripts().getMissingcclass().getCclassIgnoreRE();
cawthron
parents:
diff changeset
  2133
	}
cawthron
parents:
diff changeset
  2134
cawthron
parents:
diff changeset
  2135
	/**
cawthron
parents:
diff changeset
  2136
	 * Set the cclassIgnoreRE value of the missingcclass script
cawthron
parents:
diff changeset
  2137
	 * @param value - new cclassIgnoreRE value
cawthron
parents:
diff changeset
  2138
	 */
cawthron
parents:
diff changeset
  2139
	public void setScriptCClassIgnore(String value) {
cawthron
parents:
diff changeset
  2140
		this.csConfig.getScripts().getMissingcclass().setCclassIgnoreRE(value);
cawthron
parents:
diff changeset
  2141
	}
cawthron
parents:
diff changeset
  2142
cawthron
parents:
diff changeset
  2143
	/**
cawthron
parents:
diff changeset
  2144
	 * Retrieve the wordsRE value of the forbiddenwords script
cawthron
parents:
diff changeset
  2145
	 * @return wordsRE
cawthron
parents:
diff changeset
  2146
	 */
cawthron
parents:
diff changeset
  2147
	public String getScriptForbiddenWords() {
cawthron
parents:
diff changeset
  2148
		return this.csConfig.getScripts().getForbiddenwords().getWordsRE();
cawthron
parents:
diff changeset
  2149
	}
cawthron
parents:
diff changeset
  2150
cawthron
parents:
diff changeset
  2151
	/**
cawthron
parents:
diff changeset
  2152
	 * Set the wordsRE value of the forbiddenwords script
cawthron
parents:
diff changeset
  2153
	 * @param value - new wordsRE value
cawthron
parents:
diff changeset
  2154
	 */
cawthron
parents:
diff changeset
  2155
	public void setScriptForbiddenWords(String value) {
cawthron
parents:
diff changeset
  2156
		this.csConfig.getScripts().getForbiddenwords().setWordsRE(value);
cawthron
parents:
diff changeset
  2157
	}
cawthron
parents:
diff changeset
  2158
cawthron
parents:
diff changeset
  2159
	/**
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2160
	 * Retrieve the iconsRE value of the customizableicons script
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2161
	 * @return iconsRE
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2162
	 */
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2163
	public String getScriptIcons() {
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2164
		return this.csConfig.getScripts().getCustomizableicons().getIconsRE();
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2165
	}
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2166
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2167
	/**
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2168
	 * Set the iconsRE value of the customizableicons script
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2169
	 * @param value - new iconsRE value
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2170
	 */
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2171
	public void setScriptIcons(String value)	 {
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2172
		this.csConfig.getScripts().getCustomizableicons().setIconsRE(value);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2173
	}
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2174
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2175
	/**
2
cawthron
parents:
diff changeset
  2176
	 * Retrieve the LFunctionIgnoreRE value of the LFunctionCantLeave script
cawthron
parents:
diff changeset
  2177
	 * @return LFunctionIgnoreRE
cawthron
parents:
diff changeset
  2178
	 */
cawthron
parents:
diff changeset
  2179
	public String getScriptLFunctionIgnore() {
cawthron
parents:
diff changeset
  2180
		return this.csConfig.getScripts().getLFunctionCantLeave().getLFunctionIgnoreRE();
cawthron
parents:
diff changeset
  2181
	}
cawthron
parents:
diff changeset
  2182
cawthron
parents:
diff changeset
  2183
	/**
cawthron
parents:
diff changeset
  2184
	 * Set the LFunctionIgnoreRE value of the LFunctionCantLeave script
cawthron
parents:
diff changeset
  2185
	 * @param value - new LFunctionIgnoreRE value
cawthron
parents:
diff changeset
  2186
	 */
cawthron
parents:
diff changeset
  2187
	public void setScriptLFunctionIgnore(String value) {
cawthron
parents:
diff changeset
  2188
		this.csConfig.getScripts().getLFunctionCantLeave().setLFunctionIgnoreRE(value);
cawthron
parents:
diff changeset
  2189
	}
cawthron
parents:
diff changeset
  2190
cawthron
parents:
diff changeset
  2191
	/**
cawthron
parents:
diff changeset
  2192
	 * Retrieve the "length" attribute of the longlines script
cawthron
parents:
diff changeset
  2193
	 * @return attribute value
cawthron
parents:
diff changeset
  2194
	 */
cawthron
parents:
diff changeset
  2195
	public int getScriptLongLinesLength() {
cawthron
parents:
diff changeset
  2196
		return this.csConfig.getScripts().getLonglines().getLength();
cawthron
parents:
diff changeset
  2197
	}
cawthron
parents:
diff changeset
  2198
cawthron
parents:
diff changeset
  2199
	/**
cawthron
parents:
diff changeset
  2200
	 * Set the "length" attribute of the longlines script
cawthron
parents:
diff changeset
  2201
	 * @param value - new attribute value
cawthron
parents:
diff changeset
  2202
	 */
cawthron
parents:
diff changeset
  2203
	public void setScriptLongLinesLength(int value) {
cawthron
parents:
diff changeset
  2204
		this.csConfig.getScripts().getLonglines().setLength(value);
cawthron
parents:
diff changeset
  2205
	}
cawthron
parents:
diff changeset
  2206
	
cawthron
parents:
diff changeset
  2207
	/**
cawthron
parents:
diff changeset
  2208
	 * Retrieve the openIgnoreRE value of the open script
cawthron
parents:
diff changeset
  2209
	 * @return openIgnoreRE
cawthron
parents:
diff changeset
  2210
	 */
cawthron
parents:
diff changeset
  2211
	public String getScriptOpenIgnore() {
cawthron
parents:
diff changeset
  2212
		return this.csConfig.getScripts().getOpen().getOpenIgnoreRE();
cawthron
parents:
diff changeset
  2213
	}
cawthron
parents:
diff changeset
  2214
cawthron
parents:
diff changeset
  2215
	/**
cawthron
parents:
diff changeset
  2216
	 * Set the openIgnoreRE value of the open script
cawthron
parents:
diff changeset
  2217
	 * @param value - new openIgnoreRE value
cawthron
parents:
diff changeset
  2218
	 */
cawthron
parents:
diff changeset
  2219
	public void setScriptOpenIgnore(String value) {
cawthron
parents:
diff changeset
  2220
		this.csConfig.getScripts().getOpen().setOpenIgnoreRE(value);
cawthron
parents:
diff changeset
  2221
	}
cawthron
parents:
diff changeset
  2222
cawthron
parents:
diff changeset
  2223
	/**
cawthron
parents:
diff changeset
  2224
	 * Retrieve the worryRE value of the worryingcomments script
cawthron
parents:
diff changeset
  2225
	 * @return worryRE
cawthron
parents:
diff changeset
  2226
	 */
cawthron
parents:
diff changeset
  2227
	public String getScriptWorryingComments() {
cawthron
parents:
diff changeset
  2228
		return this.csConfig.getScripts().getWorryingcomments().getWorryRE();
cawthron
parents:
diff changeset
  2229
	}
cawthron
parents:
diff changeset
  2230
cawthron
parents:
diff changeset
  2231
	/**
cawthron
parents:
diff changeset
  2232
	 * Set the worryRE value of the worryingcomments script
cawthron
parents:
diff changeset
  2233
	 * @param value - new worryRE value
cawthron
parents:
diff changeset
  2234
	 */
cawthron
parents:
diff changeset
  2235
	public void setScriptWorryingComments(String value) {
cawthron
parents:
diff changeset
  2236
		this.csConfig.getScripts().getWorryingcomments().setWorryRE(value);
cawthron
parents:
diff changeset
  2237
	}
cawthron
parents:
diff changeset
  2238
cawthron
parents:
diff changeset
  2239
	/**
cawthron
parents:
diff changeset
  2240
	 * Retrieve the "enabled" attribute of a CodeScanner script category element
cawthron
parents:
diff changeset
  2241
	 * @param category - script category element containing the attribute
cawthron
parents:
diff changeset
  2242
	 * @return attribute value
cawthron
parents:
diff changeset
  2243
	 */
cawthron
parents:
diff changeset
  2244
	public boolean getCategoryEnabled(CSCategory category) {
cawthron
parents:
diff changeset
  2245
		switch (category) {
cawthron
parents:
diff changeset
  2246
			 case category_legal:
cawthron
parents:
diff changeset
  2247
				 return this.csConfig.getCategories().getLegal().isEnable();
cawthron
parents:
diff changeset
  2248
			 case category_panic:
cawthron
parents:
diff changeset
  2249
				 return this.csConfig.getCategories().getPanic().isEnable();
cawthron
parents:
diff changeset
  2250
			 case category_canpanic:
cawthron
parents:
diff changeset
  2251
				 return this.csConfig.getCategories().getCanpanic().isEnable();
cawthron
parents:
diff changeset
  2252
			 case category_functionality:
cawthron
parents:
diff changeset
  2253
				 return this.csConfig.getCategories().getFunctionality().isEnable();
cawthron
parents:
diff changeset
  2254
			 case category_localisation:
cawthron
parents:
diff changeset
  2255
				 return this.csConfig.getCategories().getLocalisation().isEnable();
cawthron
parents:
diff changeset
  2256
			 case category_performance:
cawthron
parents:
diff changeset
  2257
				 return this.csConfig.getCategories().getPerformance().isEnable();
cawthron
parents:
diff changeset
  2258
			 case category_codingstandards:
cawthron
parents:
diff changeset
  2259
				 return this.csConfig.getCategories().getCodingstandards().isEnable();
cawthron
parents:
diff changeset
  2260
			 case category_documentation:
cawthron
parents:
diff changeset
  2261
				 return this.csConfig.getCategories().getDocumentation().isEnable();
cawthron
parents:
diff changeset
  2262
			 case category_codereview:
cawthron
parents:
diff changeset
  2263
				 return this.csConfig.getCategories().getCodereview().isEnable();
cawthron
parents:
diff changeset
  2264
			 case category_other:
cawthron
parents:
diff changeset
  2265
				 return this.csConfig.getCategories().getOther().isEnable();
cawthron
parents:
diff changeset
  2266
			 default:
cawthron
parents:
diff changeset
  2267
				 return true;
cawthron
parents:
diff changeset
  2268
		}
cawthron
parents:
diff changeset
  2269
	}
cawthron
parents:
diff changeset
  2270
cawthron
parents:
diff changeset
  2271
	/**
cawthron
parents:
diff changeset
  2272
	 * Set the "enabled" attribute of a CodeScanner script category element
cawthron
parents:
diff changeset
  2273
	 * @param category - script category element containing the attribute
cawthron
parents:
diff changeset
  2274
	 * @param value - new attribute value
cawthron
parents:
diff changeset
  2275
	 */
cawthron
parents:
diff changeset
  2276
	public void setCategoryEnabled(CSCategory category, boolean value) {
cawthron
parents:
diff changeset
  2277
		switch (category) {
cawthron
parents:
diff changeset
  2278
			 case category_legal:
cawthron
parents:
diff changeset
  2279
				this.csConfig.getCategories().getLegal().setEnable(value);
cawthron
parents:
diff changeset
  2280
				break;
cawthron
parents:
diff changeset
  2281
			 case category_panic:
cawthron
parents:
diff changeset
  2282
				this.csConfig.getCategories().getPanic().setEnable(value);
cawthron
parents:
diff changeset
  2283
				break;
cawthron
parents:
diff changeset
  2284
			 case category_canpanic:
cawthron
parents:
diff changeset
  2285
				this.csConfig.getCategories().getCanpanic().setEnable(value);
cawthron
parents:
diff changeset
  2286
				break;
cawthron
parents:
diff changeset
  2287
			 case category_functionality:
cawthron
parents:
diff changeset
  2288
				this.csConfig.getCategories().getFunctionality().setEnable(value);
cawthron
parents:
diff changeset
  2289
				break;
cawthron
parents:
diff changeset
  2290
			 case category_localisation:
cawthron
parents:
diff changeset
  2291
				this.csConfig.getCategories().getLocalisation().setEnable(value);
cawthron
parents:
diff changeset
  2292
				break;
cawthron
parents:
diff changeset
  2293
			 case category_performance:
cawthron
parents:
diff changeset
  2294
				this.csConfig.getCategories().getPerformance().setEnable(value);
cawthron
parents:
diff changeset
  2295
				break;
cawthron
parents:
diff changeset
  2296
			 case category_codingstandards:
cawthron
parents:
diff changeset
  2297
				this.csConfig.getCategories().getCodingstandards().setEnable(value);
cawthron
parents:
diff changeset
  2298
				break;
cawthron
parents:
diff changeset
  2299
			 case category_documentation:
cawthron
parents:
diff changeset
  2300
				this.csConfig.getCategories().getDocumentation().setEnable(value);
cawthron
parents:
diff changeset
  2301
				break;
cawthron
parents:
diff changeset
  2302
			 case category_codereview:
cawthron
parents:
diff changeset
  2303
				this.csConfig.getCategories().getCodereview().setEnable(value);
cawthron
parents:
diff changeset
  2304
				break;
cawthron
parents:
diff changeset
  2305
			 case category_other:
cawthron
parents:
diff changeset
  2306
				this.csConfig.getCategories().getOther().setEnable(value);
cawthron
parents:
diff changeset
  2307
				break;
cawthron
parents:
diff changeset
  2308
		}
cawthron
parents:
diff changeset
  2309
	}
cawthron
parents:
diff changeset
  2310
cawthron
parents:
diff changeset
  2311
	/**
cawthron
parents:
diff changeset
  2312
	 * Retrieve the "enabled" attribute of a CodeScanner script severity element
cawthron
parents:
diff changeset
  2313
	 * @param severity - script severity element containing the attribute
cawthron
parents:
diff changeset
  2314
	 * @return attribute value
cawthron
parents:
diff changeset
  2315
	 */
cawthron
parents:
diff changeset
  2316
	public boolean getSeverityEnabled(CSSeverity severity) {
cawthron
parents:
diff changeset
  2317
		switch (severity) {
cawthron
parents:
diff changeset
  2318
			 case severity_high:
cawthron
parents:
diff changeset
  2319
				 return this.csConfig.getSeverities().getHigh().isEnable();
cawthron
parents:
diff changeset
  2320
			 case severity_medium:
cawthron
parents:
diff changeset
  2321
				 return this.csConfig.getSeverities().getMedium().isEnable();
cawthron
parents:
diff changeset
  2322
			 case severity_low:
cawthron
parents:
diff changeset
  2323
				 return this.csConfig.getSeverities().getLow().isEnable();
cawthron
parents:
diff changeset
  2324
			 default:
cawthron
parents:
diff changeset
  2325
				 return true;
cawthron
parents:
diff changeset
  2326
		}
cawthron
parents:
diff changeset
  2327
	}
cawthron
parents:
diff changeset
  2328
cawthron
parents:
diff changeset
  2329
	/**
cawthron
parents:
diff changeset
  2330
	 * Set the "enabled" attribute of a CodeScanner script severity element
cawthron
parents:
diff changeset
  2331
	 * @param severity - script severity element containing the attribute
cawthron
parents:
diff changeset
  2332
	 * @param value - new attribute value
cawthron
parents:
diff changeset
  2333
	 */
cawthron
parents:
diff changeset
  2334
	public void setSeverityEnabled(CSSeverity severity, boolean value) {
cawthron
parents:
diff changeset
  2335
		switch (severity) {
cawthron
parents:
diff changeset
  2336
			 case severity_high:
cawthron
parents:
diff changeset
  2337
				 this.csConfig.getSeverities().getHigh().setEnable(value);
cawthron
parents:
diff changeset
  2338
				 break;
cawthron
parents:
diff changeset
  2339
			 case severity_medium:
cawthron
parents:
diff changeset
  2340
				 this.csConfig.getSeverities().getMedium().setEnable(value);
cawthron
parents:
diff changeset
  2341
				 break;
cawthron
parents:
diff changeset
  2342
			 case severity_low:
cawthron
parents:
diff changeset
  2343
				 this.csConfig.getSeverities().getLow().setEnable(value);
cawthron
parents:
diff changeset
  2344
				 break;
cawthron
parents:
diff changeset
  2345
		}
cawthron
parents:
diff changeset
  2346
	}
cawthron
parents:
diff changeset
  2347
cawthron
parents:
diff changeset
  2348
	/**
cawthron
parents:
diff changeset
  2349
	 * Create the default arguments element.
cawthron
parents:
diff changeset
  2350
	 */
cawthron
parents:
diff changeset
  2351
	private ArgumentsType createDefaultArguments() {
cawthron
parents:
diff changeset
  2352
		ArgumentsType arguments = CSConfigFactory.eINSTANCE.createArgumentsType();
cawthron
parents:
diff changeset
  2353
		EList<String> inputArgumentList = arguments.getInput();
cawthron
parents:
diff changeset
  2354
		inputArgumentList.clear();
cawthron
parents:
diff changeset
  2355
		arguments.setLxr(null);
cawthron
parents:
diff changeset
  2356
		arguments.setLxrversion(null);
cawthron
parents:
diff changeset
  2357
		arguments.setOutputformat(null);
cawthron
parents:
diff changeset
  2358
		arguments.setTimestampedoutput(null);
cawthron
parents:
diff changeset
  2359
		return arguments;
cawthron
parents:
diff changeset
  2360
	}
cawthron
parents:
diff changeset
  2361
	
cawthron
parents:
diff changeset
  2362
	/**
cawthron
parents:
diff changeset
  2363
	 * Create the default categories element.
cawthron
parents:
diff changeset
  2364
	 */
cawthron
parents:
diff changeset
  2365
	private CategoriesType createDefaultCategories() {
cawthron
parents:
diff changeset
  2366
		CategoriesType categories = CSConfigFactory.eINSTANCE.createCategoriesType();
cawthron
parents:
diff changeset
  2367
cawthron
parents:
diff changeset
  2368
		CanpanicType category_Canpanic = CSConfigFactory.eINSTANCE.createCanpanicType();
cawthron
parents:
diff changeset
  2369
		category_Canpanic.setEnable(true);
cawthron
parents:
diff changeset
  2370
		categories.setCanpanic(category_Canpanic);
cawthron
parents:
diff changeset
  2371
cawthron
parents:
diff changeset
  2372
		CodereviewType category_Codereview = CSConfigFactory.eINSTANCE.createCodereviewType();
cawthron
parents:
diff changeset
  2373
		category_Codereview.setEnable(true);
cawthron
parents:
diff changeset
  2374
		categories.setCodereview(category_Codereview);
cawthron
parents:
diff changeset
  2375
cawthron
parents:
diff changeset
  2376
		CodingstandardsType category_Codingstandards = CSConfigFactory.eINSTANCE.createCodingstandardsType();
cawthron
parents:
diff changeset
  2377
		category_Codingstandards.setEnable(true);
cawthron
parents:
diff changeset
  2378
		categories.setCodingstandards(category_Codingstandards);
cawthron
parents:
diff changeset
  2379
cawthron
parents:
diff changeset
  2380
		DocumentationType category_Documentation = CSConfigFactory.eINSTANCE.createDocumentationType();
cawthron
parents:
diff changeset
  2381
		category_Documentation.setEnable(true);
cawthron
parents:
diff changeset
  2382
		categories.setDocumentation(category_Documentation);
cawthron
parents:
diff changeset
  2383
cawthron
parents:
diff changeset
  2384
		FunctionalityType category_Functionality = CSConfigFactory.eINSTANCE.createFunctionalityType();
cawthron
parents:
diff changeset
  2385
		category_Functionality.setEnable(true);
cawthron
parents:
diff changeset
  2386
		categories.setFunctionality(category_Functionality);
cawthron
parents:
diff changeset
  2387
cawthron
parents:
diff changeset
  2388
		LegalType category_Legal = CSConfigFactory.eINSTANCE.createLegalType();
cawthron
parents:
diff changeset
  2389
		category_Legal.setEnable(true);
cawthron
parents:
diff changeset
  2390
		categories.setLegal(category_Legal);
cawthron
parents:
diff changeset
  2391
cawthron
parents:
diff changeset
  2392
		LocalisationType category_Localisation = CSConfigFactory.eINSTANCE.createLocalisationType();
cawthron
parents:
diff changeset
  2393
		category_Localisation.setEnable(true);
cawthron
parents:
diff changeset
  2394
		categories.setLocalisation(category_Localisation);
cawthron
parents:
diff changeset
  2395
cawthron
parents:
diff changeset
  2396
		OtherType category_Other = CSConfigFactory.eINSTANCE.createOtherType();
cawthron
parents:
diff changeset
  2397
		category_Other.setEnable(true);
cawthron
parents:
diff changeset
  2398
		categories.setOther(category_Other);
cawthron
parents:
diff changeset
  2399
cawthron
parents:
diff changeset
  2400
		PanicType category_Panic = CSConfigFactory.eINSTANCE.createPanicType();
cawthron
parents:
diff changeset
  2401
		category_Panic.setEnable(true);
cawthron
parents:
diff changeset
  2402
		categories.setPanic(category_Panic);
cawthron
parents:
diff changeset
  2403
cawthron
parents:
diff changeset
  2404
		PerformanceType category_Performance = CSConfigFactory.eINSTANCE.createPerformanceType();
cawthron
parents:
diff changeset
  2405
		category_Performance.setEnable(true);
cawthron
parents:
diff changeset
  2406
		categories.setPerformance(category_Performance);
cawthron
parents:
diff changeset
  2407
cawthron
parents:
diff changeset
  2408
		return categories;
cawthron
parents:
diff changeset
  2409
	}
cawthron
parents:
diff changeset
  2410
cawthron
parents:
diff changeset
  2411
	/**
cawthron
parents:
diff changeset
  2412
	 * Create the default customrules element.
cawthron
parents:
diff changeset
  2413
	 * @return
cawthron
parents:
diff changeset
  2414
	 */
cawthron
parents:
diff changeset
  2415
	private CustomrulesType createDefaultCustomRules() {
cawthron
parents:
diff changeset
  2416
		CustomrulesType customRules = CSConfigFactory.eINSTANCE.createCustomrulesType();
cawthron
parents:
diff changeset
  2417
		EList<CustomruleType> customRuleList = customRules.getCustomrule();
cawthron
parents:
diff changeset
  2418
		customRuleList.clear();
cawthron
parents:
diff changeset
  2419
		return customRules;
cawthron
parents:
diff changeset
  2420
	}
cawthron
parents:
diff changeset
  2421
cawthron
parents:
diff changeset
  2422
	/**
cawthron
parents:
diff changeset
  2423
	 * Create the default scripts element.
cawthron
parents:
diff changeset
  2424
	 */
cawthron
parents:
diff changeset
  2425
	private ScriptsType createDefaultScripts() {
cawthron
parents:
diff changeset
  2426
		ScriptsType scripts = CSConfigFactory.eINSTANCE.createScriptsType();
cawthron
parents:
diff changeset
  2427
cawthron
parents:
diff changeset
  2428
		AccessArrayElementWithoutCheckType script_AccessArrayElementWithoutCheck = CSConfigFactory.eINSTANCE.createAccessArrayElementWithoutCheckType();
cawthron
parents:
diff changeset
  2429
		script_AccessArrayElementWithoutCheck.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2430
		script_AccessArrayElementWithoutCheck.setEnable(true);
cawthron
parents:
diff changeset
  2431
		script_AccessArrayElementWithoutCheck.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2432
		scripts.setAccessArrayElementWithoutCheck(script_AccessArrayElementWithoutCheck);
cawthron
parents:
diff changeset
  2433
cawthron
parents:
diff changeset
  2434
		AccessArrayElementWithoutCheck2Type script_AccessArrayElementWithoutCheck2 = CSConfigFactory.eINSTANCE.createAccessArrayElementWithoutCheck2Type();
cawthron
parents:
diff changeset
  2435
		script_AccessArrayElementWithoutCheck2.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2436
		script_AccessArrayElementWithoutCheck2.setEnable(true);
cawthron
parents:
diff changeset
  2437
		script_AccessArrayElementWithoutCheck2.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2438
		scripts.setAccessArrayElementWithoutCheck2(script_AccessArrayElementWithoutCheck2);
cawthron
parents:
diff changeset
  2439
cawthron
parents:
diff changeset
  2440
		ActivestartType script_Activestart = CSConfigFactory.eINSTANCE.createActivestartType();
cawthron
parents:
diff changeset
  2441
		script_Activestart.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2442
		script_Activestart.setEnable(true);
cawthron
parents:
diff changeset
  2443
		script_Activestart.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2444
		scripts.setActivestart(script_Activestart);
cawthron
parents:
diff changeset
  2445
cawthron
parents:
diff changeset
  2446
		ActivestopType script_Activestop = CSConfigFactory.eINSTANCE.createActivestopType();
cawthron
parents:
diff changeset
  2447
		script_Activestop.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2448
		script_Activestop.setEnable(true);
cawthron
parents:
diff changeset
  2449
		script_Activestop.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2450
		scripts.setActivestop(script_Activestop);
cawthron
parents:
diff changeset
  2451
cawthron
parents:
diff changeset
  2452
		ArraypassingType script_Arraypassing = CSConfigFactory.eINSTANCE.createArraypassingType();
cawthron
parents:
diff changeset
  2453
		script_Arraypassing.setCategory(CategoryType.PERFORMANCE);
cawthron
parents:
diff changeset
  2454
		script_Arraypassing.setEnable(true);
cawthron
parents:
diff changeset
  2455
		script_Arraypassing.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2456
		scripts.setArraypassing(script_Arraypassing);
cawthron
parents:
diff changeset
  2457
cawthron
parents:
diff changeset
  2458
		ArrayptrcleanupType script_Arrayptrcleanup = CSConfigFactory.eINSTANCE.createArrayptrcleanupType();
cawthron
parents:
diff changeset
  2459
		script_Arrayptrcleanup.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2460
		script_Arrayptrcleanup.setEnable(true);
cawthron
parents:
diff changeset
  2461
		script_Arrayptrcleanup.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2462
		scripts.setArrayptrcleanup(script_Arrayptrcleanup);
cawthron
parents:
diff changeset
  2463
cawthron
parents:
diff changeset
  2464
		AssertdebuginvariantType script_Assertdebuginvariant = CSConfigFactory.eINSTANCE.createAssertdebuginvariantType();
cawthron
parents:
diff changeset
  2465
		script_Assertdebuginvariant.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2466
		script_Assertdebuginvariant.setEnable(true);
cawthron
parents:
diff changeset
  2467
		script_Assertdebuginvariant.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2468
		scripts.setAssertdebuginvariant(script_Assertdebuginvariant);
cawthron
parents:
diff changeset
  2469
cawthron
parents:
diff changeset
  2470
		BaddefinesType script_Baddefines = CSConfigFactory.eINSTANCE.createBaddefinesType();
cawthron
parents:
diff changeset
  2471
		script_Baddefines.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2472
		script_Baddefines.setEnable(true);
cawthron
parents:
diff changeset
  2473
		script_Baddefines.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2474
		scripts.setBaddefines(script_Baddefines);
cawthron
parents:
diff changeset
  2475
cawthron
parents:
diff changeset
  2476
		BaseconstructType script_Baseconstruct = CSConfigFactory.eINSTANCE.createBaseconstructType();
cawthron
parents:
diff changeset
  2477
		script_Baseconstruct.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2478
		script_Baseconstruct.setEnable(true);
cawthron
parents:
diff changeset
  2479
		script_Baseconstruct.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2480
		scripts.setBaseconstruct(script_Baseconstruct);
cawthron
parents:
diff changeset
  2481
cawthron
parents:
diff changeset
  2482
		CallActiveObjectWithoutCheckingOrStoppingType script_CallActiveObjectWithoutCheckingOrStopping = CSConfigFactory.eINSTANCE.createCallActiveObjectWithoutCheckingOrStoppingType();
cawthron
parents:
diff changeset
  2483
		script_CallActiveObjectWithoutCheckingOrStopping.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2484
		script_CallActiveObjectWithoutCheckingOrStopping.setEnable(true);
cawthron
parents:
diff changeset
  2485
		script_CallActiveObjectWithoutCheckingOrStopping.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2486
		scripts.setCallActiveObjectWithoutCheckingOrStopping(script_CallActiveObjectWithoutCheckingOrStopping);
cawthron
parents:
diff changeset
  2487
cawthron
parents:
diff changeset
  2488
		ChangenotificationType script_Changenotification = CSConfigFactory.eINSTANCE.createChangenotificationType();
cawthron
parents:
diff changeset
  2489
		script_Changenotification.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2490
		script_Changenotification.setEnable(true);
cawthron
parents:
diff changeset
  2491
		script_Changenotification.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2492
		scripts.setChangenotification(script_Changenotification);
cawthron
parents:
diff changeset
  2493
cawthron
parents:
diff changeset
  2494
		CleanupType script_Cleanup = CSConfigFactory.eINSTANCE.createCleanupType();
cawthron
parents:
diff changeset
  2495
		script_Cleanup.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2496
		script_Cleanup.setEnable(true);
cawthron
parents:
diff changeset
  2497
		script_Cleanup.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2498
		scripts.setCleanup(script_Cleanup);
cawthron
parents:
diff changeset
  2499
cawthron
parents:
diff changeset
  2500
		CommentcodeType script_Commentcode = CSConfigFactory.eINSTANCE.createCommentcodeType();
cawthron
parents:
diff changeset
  2501
		script_Commentcode.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2502
		script_Commentcode.setEnable(true);
cawthron
parents:
diff changeset
  2503
		script_Commentcode.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2504
		scripts.setCommentcode(script_Commentcode);
cawthron
parents:
diff changeset
  2505
cawthron
parents:
diff changeset
  2506
		ConnectType script_Connect = CSConfigFactory.eINSTANCE.createConnectType();
cawthron
parents:
diff changeset
  2507
		script_Connect.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2508
		script_Connect.setEnable(true);
cawthron
parents:
diff changeset
  2509
		script_Connect.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2510
		scripts.setConnect(script_Connect);
cawthron
parents:
diff changeset
  2511
cawthron
parents:
diff changeset
  2512
		ConnectAndDontCloseMemberVariableType script_ConnectAndDontCloseMemberVariable = CSConfigFactory.eINSTANCE.createConnectAndDontCloseMemberVariableType();
cawthron
parents:
diff changeset
  2513
		script_ConnectAndDontCloseMemberVariable.setCategory(CategoryType.FUNCTIONALITY);
cawthron
parents:
diff changeset
  2514
		script_ConnectAndDontCloseMemberVariable.setEnable(true);
cawthron
parents:
diff changeset
  2515
		script_ConnectAndDontCloseMemberVariable.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2516
		scripts.setConnectAndDontCloseMemberVariable(script_ConnectAndDontCloseMemberVariable);
cawthron
parents:
diff changeset
  2517
cawthron
parents:
diff changeset
  2518
		ConstnamesType script_Constnames = CSConfigFactory.eINSTANCE.createConstnamesType();
cawthron
parents:
diff changeset
  2519
		script_Constnames.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2520
		script_Constnames.setEnable(true);
cawthron
parents:
diff changeset
  2521
		script_Constnames.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2522
		scripts.setConstnames(script_Constnames);
cawthron
parents:
diff changeset
  2523
cawthron
parents:
diff changeset
  2524
		ConsttdescptrType script_Consttdescptr = CSConfigFactory.eINSTANCE.createConsttdescptrType();
cawthron
parents:
diff changeset
  2525
		script_Consttdescptr.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2526
		script_Consttdescptr.setEnable(true);
cawthron
parents:
diff changeset
  2527
		script_Consttdescptr.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2528
		scripts.setConsttdescptr(script_Consttdescptr);
cawthron
parents:
diff changeset
  2529
cawthron
parents:
diff changeset
  2530
		ControlornullType script_Controlornull = CSConfigFactory.eINSTANCE.createControlornullType();
cawthron
parents:
diff changeset
  2531
		script_Controlornull.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2532
		script_Controlornull.setEnable(true);
cawthron
parents:
diff changeset
  2533
		script_Controlornull.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2534
		scripts.setControlornull(script_Controlornull);
cawthron
parents:
diff changeset
  2535
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2536
		CrepositoryType script_Crepository = CSConfigFactory.eINSTANCE.createCrepositoryType();
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2537
		script_Crepository.setCategory(CategoryType.OTHER);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2538
		script_Crepository.setEnable(true);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2539
		script_Crepository.setSeverity(SeverityType.LOW);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2540
		scripts.setCrepository(script_Crepository);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2541
2
cawthron
parents:
diff changeset
  2542
		CtltargettypeType script_Ctltargettype = CSConfigFactory.eINSTANCE.createCtltargettypeType();
cawthron
parents:
diff changeset
  2543
		script_Ctltargettype.setCategory(CategoryType.FUNCTIONALITY);
cawthron
parents:
diff changeset
  2544
		script_Ctltargettype.setEnable(true);
cawthron
parents:
diff changeset
  2545
		script_Ctltargettype.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2546
		scripts.setCtltargettype(script_Ctltargettype);
cawthron
parents:
diff changeset
  2547
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2548
		CustomizableiconsType script_Customizableicons = CSConfigFactory.eINSTANCE.createCustomizableiconsType();
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2549
		script_Customizableicons.setCategory(CategoryType.OTHER);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2550
		script_Customizableicons.setEnable(true);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2551
		script_Customizableicons.setSeverity(SeverityType.LOW);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2552
		//script_Customizableicons.setIconsRE("");
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2553
		scripts.setCustomizableicons(script_Customizableicons);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2554
2
cawthron
parents:
diff changeset
  2555
		DebugromType script_Debugrom = CSConfigFactory.eINSTANCE.createDebugromType();
cawthron
parents:
diff changeset
  2556
		script_Debugrom.setCategory(CategoryType.PERFORMANCE);
cawthron
parents:
diff changeset
  2557
		script_Debugrom.setEnable(true);
cawthron
parents:
diff changeset
  2558
		script_Debugrom.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2559
		scripts.setDebugrom(script_Debugrom);
cawthron
parents:
diff changeset
  2560
cawthron
parents:
diff changeset
  2561
		DeclarenameType script_Declarename = CSConfigFactory.eINSTANCE.createDeclarenameType();
cawthron
parents:
diff changeset
  2562
		script_Declarename.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2563
		script_Declarename.setEnable(true);
cawthron
parents:
diff changeset
  2564
		script_Declarename.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2565
		scripts.setDeclarename(script_Declarename);
cawthron
parents:
diff changeset
  2566
cawthron
parents:
diff changeset
  2567
		DeleteMemberVariableType script_DeleteMemberVariable = CSConfigFactory.eINSTANCE.createDeleteMemberVariableType();
cawthron
parents:
diff changeset
  2568
		script_DeleteMemberVariable.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2569
		script_DeleteMemberVariable.setEnable(true);
cawthron
parents:
diff changeset
  2570
		script_DeleteMemberVariable.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2571
		scripts.setDeleteMemberVariable(script_DeleteMemberVariable);
cawthron
parents:
diff changeset
  2572
cawthron
parents:
diff changeset
  2573
		DestructorType script_Destructor = CSConfigFactory.eINSTANCE.createDestructorType();
cawthron
parents:
diff changeset
  2574
		script_Destructor.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2575
		script_Destructor.setEnable(true);
cawthron
parents:
diff changeset
  2576
		script_Destructor.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2577
		scripts.setDestructor(script_Destructor);
cawthron
parents:
diff changeset
  2578
cawthron
parents:
diff changeset
  2579
		DoubleSemiColonType script_DoubleSemiColon = CSConfigFactory.eINSTANCE.createDoubleSemiColonType();
cawthron
parents:
diff changeset
  2580
		script_DoubleSemiColon.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2581
		script_DoubleSemiColon.setEnable(true);
cawthron
parents:
diff changeset
  2582
		script_DoubleSemiColon.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2583
		scripts.setDoubleSemiColon(script_DoubleSemiColon);
cawthron
parents:
diff changeset
  2584
cawthron
parents:
diff changeset
  2585
		DrivelettersType script_Driveletters = CSConfigFactory.eINSTANCE.createDrivelettersType();
cawthron
parents:
diff changeset
  2586
		script_Driveletters.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2587
		script_Driveletters.setEnable(true);
cawthron
parents:
diff changeset
  2588
		script_Driveletters.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2589
		scripts.setDriveletters(script_Driveletters);
cawthron
parents:
diff changeset
  2590
cawthron
parents:
diff changeset
  2591
		EikbuttonsType script_Eikbuttons = CSConfigFactory.eINSTANCE.createEikbuttonsType();
cawthron
parents:
diff changeset
  2592
		script_Eikbuttons.setCategory(CategoryType.LOCALISATION);
cawthron
parents:
diff changeset
  2593
		script_Eikbuttons.setEnable(true);
cawthron
parents:
diff changeset
  2594
		script_Eikbuttons.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2595
		scripts.setEikbuttons(script_Eikbuttons);
cawthron
parents:
diff changeset
  2596
cawthron
parents:
diff changeset
  2597
		EikonenvstaticType script_Eikonenvstatic = CSConfigFactory.eINSTANCE.createEikonenvstaticType();
cawthron
parents:
diff changeset
  2598
		script_Eikonenvstatic.setCategory(CategoryType.PERFORMANCE);
cawthron
parents:
diff changeset
  2599
		script_Eikonenvstatic.setEnable(true);
cawthron
parents:
diff changeset
  2600
		script_Eikonenvstatic.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2601
		scripts.setEikonenvstatic(script_Eikonenvstatic);
cawthron
parents:
diff changeset
  2602
cawthron
parents:
diff changeset
  2603
		EnummembersType script_Enummembers = CSConfigFactory.eINSTANCE.createEnummembersType();
cawthron
parents:
diff changeset
  2604
		script_Enummembers.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2605
		script_Enummembers.setEnable(true);
cawthron
parents:
diff changeset
  2606
		script_Enummembers.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2607
		scripts.setEnummembers(script_Enummembers);
cawthron
parents:
diff changeset
  2608
cawthron
parents:
diff changeset
  2609
		EnumnamesType script_Enumnames = CSConfigFactory.eINSTANCE.createEnumnamesType();
cawthron
parents:
diff changeset
  2610
		script_Enumnames.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2611
		script_Enumnames.setEnable(true);
cawthron
parents:
diff changeset
  2612
		script_Enumnames.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2613
		scripts.setEnumnames(script_Enumnames);
cawthron
parents:
diff changeset
  2614
cawthron
parents:
diff changeset
  2615
		ExportinlineType script_Exportinline = CSConfigFactory.eINSTANCE.createExportinlineType();
cawthron
parents:
diff changeset
  2616
		script_Exportinline.setCategory(CategoryType.FUNCTIONALITY);
cawthron
parents:
diff changeset
  2617
		script_Exportinline.setEnable(true);
cawthron
parents:
diff changeset
  2618
		script_Exportinline.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2619
		scripts.setExportinline(script_Exportinline);
cawthron
parents:
diff changeset
  2620
cawthron
parents:
diff changeset
  2621
		ExportpurevirtualType script_Exportpurevirtual = CSConfigFactory.eINSTANCE.createExportpurevirtualType();
cawthron
parents:
diff changeset
  2622
		script_Exportpurevirtual.setCategory(CategoryType.FUNCTIONALITY);
cawthron
parents:
diff changeset
  2623
		script_Exportpurevirtual.setEnable(true);
cawthron
parents:
diff changeset
  2624
		script_Exportpurevirtual.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2625
		scripts.setExportpurevirtual(script_Exportpurevirtual);
cawthron
parents:
diff changeset
  2626
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2627
		FlagsType script_Flags = CSConfigFactory.eINSTANCE.createFlagsType();
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2628
		script_Flags.setCategory(CategoryType.OTHER);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2629
		script_Flags.setEnable(true);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2630
		script_Flags.setSeverity(SeverityType.LOW);
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
  2631
		scripts.setFlags(script_Flags);
2
cawthron
parents:
diff changeset
  2632
cawthron
parents:
diff changeset
  2633
		FoffType script_Foff = CSConfigFactory.eINSTANCE.createFoffType();
cawthron
parents:
diff changeset
  2634
		script_Foff.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2635
		script_Foff.setEnable(true);
cawthron
parents:
diff changeset
  2636
		script_Foff.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2637
		scripts.setFoff(script_Foff);
cawthron
parents:
diff changeset
  2638
cawthron
parents:
diff changeset
  2639
		ForbiddenwordsType script_Forbiddenwords = CSConfigFactory.eINSTANCE.createForbiddenwordsType();
cawthron
parents:
diff changeset
  2640
		script_Forbiddenwords.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2641
		script_Forbiddenwords.setEnable(true);
cawthron
parents:
diff changeset
  2642
		script_Forbiddenwords.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2643
		script_Forbiddenwords.setWordsRE("Typhoon|Hurricane|Epoc|Nokia Mobile Phones|NMP");
cawthron
parents:
diff changeset
  2644
		scripts.setForbiddenwords(script_Forbiddenwords);
cawthron
parents:
diff changeset
  2645
cawthron
parents:
diff changeset
  2646
		ForgottoputptroncleanupstackType script_Forgottoputptroncleanupstack = CSConfigFactory.eINSTANCE.createForgottoputptroncleanupstackType();
cawthron
parents:
diff changeset
  2647
		script_Forgottoputptroncleanupstack.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2648
		script_Forgottoputptroncleanupstack.setEnable(true);
cawthron
parents:
diff changeset
  2649
		script_Forgottoputptroncleanupstack.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2650
		scripts.setForgottoputptroncleanupstack(script_Forgottoputptroncleanupstack);
cawthron
parents:
diff changeset
  2651
cawthron
parents:
diff changeset
  2652
		FriendType script_Friend = CSConfigFactory.eINSTANCE.createFriendType();
cawthron
parents:
diff changeset
  2653
		script_Friend.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2654
		script_Friend.setEnable(true);
cawthron
parents:
diff changeset
  2655
		script_Friend.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2656
		scripts.setFriend(script_Friend);
cawthron
parents:
diff changeset
  2657
cawthron
parents:
diff changeset
  2658
		GotoType script_Goto = CSConfigFactory.eINSTANCE.createGotoType();
cawthron
parents:
diff changeset
  2659
		script_Goto.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2660
		script_Goto.setEnable(true);
cawthron
parents:
diff changeset
  2661
		script_Goto.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2662
		scripts.setGoto(script_Goto);
cawthron
parents:
diff changeset
  2663
cawthron
parents:
diff changeset
  2664
		IfassignmentsType script_Ifassignments = CSConfigFactory.eINSTANCE.createIfassignmentsType();
cawthron
parents:
diff changeset
  2665
		script_Ifassignments.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2666
		script_Ifassignments.setEnable(true);
cawthron
parents:
diff changeset
  2667
		script_Ifassignments.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2668
		scripts.setIfassignments(script_Ifassignments);
cawthron
parents:
diff changeset
  2669
cawthron
parents:
diff changeset
  2670
		IfpreprocessorType script_Ifpreprocessor = CSConfigFactory.eINSTANCE.createIfpreprocessorType();
cawthron
parents:
diff changeset
  2671
		script_Ifpreprocessor.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2672
		script_Ifpreprocessor.setEnable(true);
cawthron
parents:
diff changeset
  2673
		script_Ifpreprocessor.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2674
		scripts.setIfpreprocessor(script_Ifpreprocessor);
cawthron
parents:
diff changeset
  2675
cawthron
parents:
diff changeset
  2676
		InheritanceorderType script_Inheritanceorder = CSConfigFactory.eINSTANCE.createInheritanceorderType();
cawthron
parents:
diff changeset
  2677
		script_Inheritanceorder.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2678
		script_Inheritanceorder.setEnable(true);
cawthron
parents:
diff changeset
  2679
		script_Inheritanceorder.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2680
		scripts.setInheritanceorder(script_Inheritanceorder);
cawthron
parents:
diff changeset
  2681
cawthron
parents:
diff changeset
  2682
		IntleavesType script_Intleaves = CSConfigFactory.eINSTANCE.createIntleavesType();
cawthron
parents:
diff changeset
  2683
		script_Intleaves.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2684
		script_Intleaves.setEnable(true);
cawthron
parents:
diff changeset
  2685
		script_Intleaves.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2686
		scripts.setIntleaves(script_Intleaves);
cawthron
parents:
diff changeset
  2687
cawthron
parents:
diff changeset
  2688
		JmpType script_Jmp = CSConfigFactory.eINSTANCE.createJmpType();
cawthron
parents:
diff changeset
  2689
		script_Jmp.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2690
		script_Jmp.setEnable(true);
cawthron
parents:
diff changeset
  2691
		script_Jmp.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2692
		scripts.setJmp(script_Jmp);
cawthron
parents:
diff changeset
  2693
cawthron
parents:
diff changeset
  2694
		LeaveType script_Leave = CSConfigFactory.eINSTANCE.createLeaveType();
cawthron
parents:
diff changeset
  2695
		script_Leave.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2696
		script_Leave.setEnable(true);
cawthron
parents:
diff changeset
  2697
		script_Leave.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2698
		scripts.setLeave(script_Leave);
cawthron
parents:
diff changeset
  2699
cawthron
parents:
diff changeset
  2700
		LeaveNoErrorType script_LeaveNoError = CSConfigFactory.eINSTANCE.createLeaveNoErrorType();
cawthron
parents:
diff changeset
  2701
		script_LeaveNoError.setCategory(CategoryType.FUNCTIONALITY);
cawthron
parents:
diff changeset
  2702
		script_LeaveNoError.setEnable(true);
cawthron
parents:
diff changeset
  2703
		script_LeaveNoError.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2704
		scripts.setLeaveNoError(script_LeaveNoError);
cawthron
parents:
diff changeset
  2705
cawthron
parents:
diff changeset
  2706
		LeavingoperatorsType script_Leavingoperators = CSConfigFactory.eINSTANCE.createLeavingoperatorsType();
cawthron
parents:
diff changeset
  2707
		script_Leavingoperators.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2708
		script_Leavingoperators.setEnable(true);
cawthron
parents:
diff changeset
  2709
		script_Leavingoperators.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2710
		scripts.setLeavingoperators(script_Leavingoperators);
cawthron
parents:
diff changeset
  2711
cawthron
parents:
diff changeset
  2712
		LFunctionCantLeaveType script_LFunctionCantLeave = CSConfigFactory.eINSTANCE.createLFunctionCantLeaveType();
cawthron
parents:
diff changeset
  2713
		script_LFunctionCantLeave.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2714
		script_LFunctionCantLeave.setEnable(true);
cawthron
parents:
diff changeset
  2715
		script_LFunctionCantLeave.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2716
		script_LFunctionCantLeave.setLFunctionIgnoreRE("RunL");
cawthron
parents:
diff changeset
  2717
		scripts.setLFunctionCantLeave(script_LFunctionCantLeave);
cawthron
parents:
diff changeset
  2718
cawthron
parents:
diff changeset
  2719
		LonglinesType script_Longlines = CSConfigFactory.eINSTANCE.createLonglinesType();
cawthron
parents:
diff changeset
  2720
		script_Longlines.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2721
		script_Longlines.setEnable(true);
cawthron
parents:
diff changeset
  2722
		script_Longlines.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2723
		script_Longlines.setLength(160);
cawthron
parents:
diff changeset
  2724
		scripts.setLonglines(script_Longlines);
cawthron
parents:
diff changeset
  2725
cawthron
parents:
diff changeset
  2726
		MagicnumbersType script_Magicnumbers = CSConfigFactory.eINSTANCE.createMagicnumbersType();
cawthron
parents:
diff changeset
  2727
		script_Magicnumbers.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2728
		script_Magicnumbers.setEnable(true);
cawthron
parents:
diff changeset
  2729
		script_Magicnumbers.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2730
		scripts.setMagicnumbers(script_Magicnumbers);
cawthron
parents:
diff changeset
  2731
cawthron
parents:
diff changeset
  2732
		MclassdestructorType script_Mclassdestructor = CSConfigFactory.eINSTANCE.createMclassdestructorType();
cawthron
parents:
diff changeset
  2733
		script_Mclassdestructor.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2734
		script_Mclassdestructor.setEnable(true);
cawthron
parents:
diff changeset
  2735
		script_Mclassdestructor.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2736
		scripts.setMclassdestructor(script_Mclassdestructor);
cawthron
parents:
diff changeset
  2737
cawthron
parents:
diff changeset
  2738
		MemberlcType script_Memberlc = CSConfigFactory.eINSTANCE.createMemberlcType();
cawthron
parents:
diff changeset
  2739
		script_Memberlc.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2740
		script_Memberlc.setEnable(true);
cawthron
parents:
diff changeset
  2741
		script_Memberlc.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2742
		scripts.setMemberlc(script_Memberlc);
cawthron
parents:
diff changeset
  2743
cawthron
parents:
diff changeset
  2744
		MembervariablecallldType script_Membervariablecallld = CSConfigFactory.eINSTANCE.createMembervariablecallldType();
cawthron
parents:
diff changeset
  2745
		script_Membervariablecallld.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2746
		script_Membervariablecallld.setEnable(true);
cawthron
parents:
diff changeset
  2747
		script_Membervariablecallld.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2748
		scripts.setMembervariablecallld(script_Membervariablecallld);
cawthron
parents:
diff changeset
  2749
cawthron
parents:
diff changeset
  2750
		MissingcancelType script_Missingcancel = CSConfigFactory.eINSTANCE.createMissingcancelType();
cawthron
parents:
diff changeset
  2751
		script_Missingcancel.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2752
		script_Missingcancel.setEnable(true);
cawthron
parents:
diff changeset
  2753
		script_Missingcancel.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2754
		scripts.setMissingcancel(script_Missingcancel);
cawthron
parents:
diff changeset
  2755
cawthron
parents:
diff changeset
  2756
		MissingcclassType script_Missingcclass = CSConfigFactory.eINSTANCE.createMissingcclassType();
cawthron
parents:
diff changeset
  2757
		script_Missingcclass.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2758
		script_Missingcclass.setEnable(true);
cawthron
parents:
diff changeset
  2759
		script_Missingcclass.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2760
		script_Missingcclass.setCclassIgnoreRE("CBase");
cawthron
parents:
diff changeset
  2761
		scripts.setMissingcclass(script_Missingcclass);
cawthron
parents:
diff changeset
  2762
cawthron
parents:
diff changeset
  2763
		MmpsourcepathType script_Mmpsourcepath = CSConfigFactory.eINSTANCE.createMmpsourcepathType();
cawthron
parents:
diff changeset
  2764
		script_Mmpsourcepath.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2765
		script_Mmpsourcepath.setEnable(true);
cawthron
parents:
diff changeset
  2766
		script_Mmpsourcepath.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2767
		scripts.setMmpsourcepath(script_Mmpsourcepath);
cawthron
parents:
diff changeset
  2768
cawthron
parents:
diff changeset
  2769
		MultilangrscType script_Multilangrsc = CSConfigFactory.eINSTANCE.createMultilangrscType();
cawthron
parents:
diff changeset
  2770
		script_Multilangrsc.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2771
		script_Multilangrsc.setEnable(true);
cawthron
parents:
diff changeset
  2772
		script_Multilangrsc.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2773
		scripts.setMultilangrsc(script_Multilangrsc);
cawthron
parents:
diff changeset
  2774
cawthron
parents:
diff changeset
  2775
		MultipledeclarationsType script_Multipledeclarations = CSConfigFactory.eINSTANCE.createMultipledeclarationsType();
cawthron
parents:
diff changeset
  2776
		script_Multipledeclarations.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2777
		script_Multipledeclarations.setEnable(true);
cawthron
parents:
diff changeset
  2778
		script_Multipledeclarations.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2779
		scripts.setMultipledeclarations(script_Multipledeclarations);
cawthron
parents:
diff changeset
  2780
cawthron
parents:
diff changeset
  2781
		MultipleinheritanceType script_Multipleinheritance = CSConfigFactory.eINSTANCE.createMultipleinheritanceType();
cawthron
parents:
diff changeset
  2782
		script_Multipleinheritance.setCategory(CategoryType.FUNCTIONALITY);
cawthron
parents:
diff changeset
  2783
		script_Multipleinheritance.setEnable(true);
cawthron
parents:
diff changeset
  2784
		script_Multipleinheritance.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2785
		scripts.setMultipleinheritance(script_Multipleinheritance);
cawthron
parents:
diff changeset
  2786
cawthron
parents:
diff changeset
  2787
		MydocsType script_Mydocs = CSConfigFactory.eINSTANCE.createMydocsType();
cawthron
parents:
diff changeset
  2788
		script_Mydocs.setCategory(CategoryType.FUNCTIONALITY);
cawthron
parents:
diff changeset
  2789
		script_Mydocs.setEnable(true);
cawthron
parents:
diff changeset
  2790
		script_Mydocs.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2791
		scripts.setMydocs(script_Mydocs);
cawthron
parents:
diff changeset
  2792
cawthron
parents:
diff changeset
  2793
		NamespaceType script_Namespace = CSConfigFactory.eINSTANCE.createNamespaceType();
cawthron
parents:
diff changeset
  2794
		script_Namespace.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2795
		script_Namespace.setEnable(true);
cawthron
parents:
diff changeset
  2796
		script_Namespace.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2797
		scripts.setNamespace(script_Namespace);
cawthron
parents:
diff changeset
  2798
cawthron
parents:
diff changeset
  2799
		NewlreferencesType script_Newlreferences = CSConfigFactory.eINSTANCE.createNewlreferencesType();
cawthron
parents:
diff changeset
  2800
		script_Newlreferences.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2801
		script_Newlreferences.setEnable(true);
cawthron
parents:
diff changeset
  2802
		script_Newlreferences.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2803
		scripts.setNewlreferences(script_Newlreferences);
cawthron
parents:
diff changeset
  2804
cawthron
parents:
diff changeset
  2805
		NoleavetrapType script_Noleavetrap = CSConfigFactory.eINSTANCE.createNoleavetrapType();
cawthron
parents:
diff changeset
  2806
		script_Noleavetrap.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2807
		script_Noleavetrap.setEnable(true);
cawthron
parents:
diff changeset
  2808
		script_Noleavetrap.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2809
		scripts.setNoleavetrap(script_Noleavetrap);
cawthron
parents:
diff changeset
  2810
cawthron
parents:
diff changeset
  2811
		NonconsthbufcType script_Nonconsthbufc = CSConfigFactory.eINSTANCE.createNonconsthbufcType();
cawthron
parents:
diff changeset
  2812
		script_Nonconsthbufc.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2813
		script_Nonconsthbufc.setEnable(true);
cawthron
parents:
diff changeset
  2814
		script_Nonconsthbufc.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2815
		scripts.setNonconsthbufc(script_Nonconsthbufc);
cawthron
parents:
diff changeset
  2816
cawthron
parents:
diff changeset
  2817
		NonconsttdescType script_Nonconsttdesc = CSConfigFactory.eINSTANCE.createNonconsttdescType();
cawthron
parents:
diff changeset
  2818
		script_Nonconsttdesc.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2819
		script_Nonconsttdesc.setEnable(true);
cawthron
parents:
diff changeset
  2820
		script_Nonconsttdesc.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2821
		scripts.setNonconsttdesc(script_Nonconsttdesc);
cawthron
parents:
diff changeset
  2822
cawthron
parents:
diff changeset
  2823
		NonleavenewType script_Nonleavenew = CSConfigFactory.eINSTANCE.createNonleavenewType();
cawthron
parents:
diff changeset
  2824
		script_Nonleavenew.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2825
		script_Nonleavenew.setEnable(true);
cawthron
parents:
diff changeset
  2826
		script_Nonleavenew.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2827
		scripts.setNonleavenew(script_Nonleavenew);
cawthron
parents:
diff changeset
  2828
cawthron
parents:
diff changeset
  2829
		NonunicodeskinsType script_Nonunicodeskins = CSConfigFactory.eINSTANCE.createNonunicodeskinsType();
cawthron
parents:
diff changeset
  2830
		script_Nonunicodeskins.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2831
		script_Nonunicodeskins.setEnable(true);
cawthron
parents:
diff changeset
  2832
		script_Nonunicodeskins.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2833
		scripts.setNonunicodeskins(script_Nonunicodeskins);
cawthron
parents:
diff changeset
  2834
cawthron
parents:
diff changeset
  2835
		NullType script_Null = CSConfigFactory.eINSTANCE.createNullType();
cawthron
parents:
diff changeset
  2836
		script_Null.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2837
		script_Null.setEnable(true);
cawthron
parents:
diff changeset
  2838
		script_Null.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2839
		scripts.setNull(script_Null);
cawthron
parents:
diff changeset
  2840
cawthron
parents:
diff changeset
  2841
		OpenType script_Open = CSConfigFactory.eINSTANCE.createOpenType();
cawthron
parents:
diff changeset
  2842
		script_Open.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2843
		script_Open.setEnable(true);
cawthron
parents:
diff changeset
  2844
		script_Open.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2845
		script_Open.setOpenIgnoreRE("RDesReadStream|RDesWriteStream");
cawthron
parents:
diff changeset
  2846
		scripts.setOpen(script_Open);
cawthron
parents:
diff changeset
  2847
cawthron
parents:
diff changeset
  2848
		PointertoarraysType script_Pointertoarrays = CSConfigFactory.eINSTANCE.createPointertoarraysType();
cawthron
parents:
diff changeset
  2849
		script_Pointertoarrays.setCategory(CategoryType.PERFORMANCE);
cawthron
parents:
diff changeset
  2850
		script_Pointertoarrays.setEnable(true);
cawthron
parents:
diff changeset
  2851
		script_Pointertoarrays.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2852
		scripts.setPointertoarrays(script_Pointertoarrays);
cawthron
parents:
diff changeset
  2853
cawthron
parents:
diff changeset
  2854
		PragmadisableType script_Pragmadisable = CSConfigFactory.eINSTANCE.createPragmadisableType();
cawthron
parents:
diff changeset
  2855
		script_Pragmadisable.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2856
		script_Pragmadisable.setEnable(true);
cawthron
parents:
diff changeset
  2857
		script_Pragmadisable.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2858
		scripts.setPragmadisable(script_Pragmadisable);
cawthron
parents:
diff changeset
  2859
cawthron
parents:
diff changeset
  2860
		PragmamessageType script_Pragmamessage = CSConfigFactory.eINSTANCE.createPragmamessageType();
cawthron
parents:
diff changeset
  2861
		script_Pragmamessage.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2862
		script_Pragmamessage.setEnable(true);
cawthron
parents:
diff changeset
  2863
		script_Pragmamessage.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2864
		scripts.setPragmamessage(script_Pragmamessage);
cawthron
parents:
diff changeset
  2865
cawthron
parents:
diff changeset
  2866
		PragmaotherType script_Pragmaother = CSConfigFactory.eINSTANCE.createPragmaotherType();
cawthron
parents:
diff changeset
  2867
		script_Pragmaother.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2868
		script_Pragmaother.setEnable(true);
cawthron
parents:
diff changeset
  2869
		script_Pragmaother.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2870
		scripts.setPragmaother(script_Pragmaother);
cawthron
parents:
diff changeset
  2871
cawthron
parents:
diff changeset
  2872
		PrivateinheritanceType script_Privateinheritance = CSConfigFactory.eINSTANCE.createPrivateinheritanceType();
cawthron
parents:
diff changeset
  2873
		script_Privateinheritance.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2874
		script_Privateinheritance.setEnable(true);
cawthron
parents:
diff changeset
  2875
		script_Privateinheritance.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2876
		scripts.setPrivateinheritance(script_Privateinheritance);
cawthron
parents:
diff changeset
  2877
cawthron
parents:
diff changeset
  2878
		PushaddrvarType script_Pushaddrvar = CSConfigFactory.eINSTANCE.createPushaddrvarType();
cawthron
parents:
diff changeset
  2879
		script_Pushaddrvar.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2880
		script_Pushaddrvar.setEnable(true);
cawthron
parents:
diff changeset
  2881
		script_Pushaddrvar.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2882
		scripts.setPushaddrvar(script_Pushaddrvar);
cawthron
parents:
diff changeset
  2883
cawthron
parents:
diff changeset
  2884
		PushmemberType script_Pushmember = CSConfigFactory.eINSTANCE.createPushmemberType();
cawthron
parents:
diff changeset
  2885
		script_Pushmember.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2886
		script_Pushmember.setEnable(true);
cawthron
parents:
diff changeset
  2887
		script_Pushmember.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2888
		scripts.setPushmember(script_Pushmember);
cawthron
parents:
diff changeset
  2889
cawthron
parents:
diff changeset
  2890
		ReadresourceType script_Readresource = CSConfigFactory.eINSTANCE.createReadresourceType();
cawthron
parents:
diff changeset
  2891
		script_Readresource.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2892
		script_Readresource.setEnable(true);
cawthron
parents:
diff changeset
  2893
		script_Readresource.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2894
		scripts.setReadresource(script_Readresource);
cawthron
parents:
diff changeset
  2895
cawthron
parents:
diff changeset
  2896
		ResourcenotoncleanupstackType script_Resourcenotoncleanupstack = CSConfigFactory.eINSTANCE.createResourcenotoncleanupstackType();
cawthron
parents:
diff changeset
  2897
		script_Resourcenotoncleanupstack.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2898
		script_Resourcenotoncleanupstack.setEnable(true);
cawthron
parents:
diff changeset
  2899
		script_Resourcenotoncleanupstack.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2900
		scripts.setResourcenotoncleanupstack(script_Resourcenotoncleanupstack);
cawthron
parents:
diff changeset
  2901
cawthron
parents:
diff changeset
  2902
		ResourcesonheapType script_Resourcesonheap = CSConfigFactory.eINSTANCE.createResourcesonheapType();
cawthron
parents:
diff changeset
  2903
		script_Resourcesonheap.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2904
		script_Resourcesonheap.setEnable(true);
cawthron
parents:
diff changeset
  2905
		script_Resourcesonheap.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2906
		scripts.setResourcesonheap(script_Resourcesonheap);
cawthron
parents:
diff changeset
  2907
cawthron
parents:
diff changeset
  2908
		ReturndescriptoroutofscopeType script_Returndescriptoroutofscope = CSConfigFactory.eINSTANCE.createReturndescriptoroutofscopeType();
cawthron
parents:
diff changeset
  2909
		script_Returndescriptoroutofscope.setCategory(CategoryType.CANPANIC);
cawthron
parents:
diff changeset
  2910
		script_Returndescriptoroutofscope.setEnable(true);
cawthron
parents:
diff changeset
  2911
		script_Returndescriptoroutofscope.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2912
		scripts.setReturndescriptoroutofscope(script_Returndescriptoroutofscope);
cawthron
parents:
diff changeset
  2913
cawthron
parents:
diff changeset
  2914
		RfsType script_Rfs = CSConfigFactory.eINSTANCE.createRfsType();
cawthron
parents:
diff changeset
  2915
		script_Rfs.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2916
		script_Rfs.setEnable(true);
cawthron
parents:
diff changeset
  2917
		script_Rfs.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2918
		scripts.setRfs(script_Rfs);
cawthron
parents:
diff changeset
  2919
cawthron
parents:
diff changeset
  2920
		RssnamesType script_Rssnames = CSConfigFactory.eINSTANCE.createRssnamesType();
cawthron
parents:
diff changeset
  2921
		script_Rssnames.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2922
		script_Rssnames.setEnable(true);
cawthron
parents:
diff changeset
  2923
		script_Rssnames.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2924
		scripts.setRssnames(script_Rssnames);
cawthron
parents:
diff changeset
  2925
cawthron
parents:
diff changeset
  2926
		StringliteralsType script_Stringliterals = CSConfigFactory.eINSTANCE.createStringliteralsType();
cawthron
parents:
diff changeset
  2927
		script_Stringliterals.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2928
		script_Stringliterals.setEnable(true);
cawthron
parents:
diff changeset
  2929
		script_Stringliterals.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2930
		scripts.setStringliterals(script_Stringliterals);
cawthron
parents:
diff changeset
  2931
cawthron
parents:
diff changeset
  2932
		StringsinresourcefilesType script_Stringsinresourcefiles = CSConfigFactory.eINSTANCE.createStringsinresourcefilesType();
cawthron
parents:
diff changeset
  2933
		script_Stringsinresourcefiles.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2934
		script_Stringsinresourcefiles.setEnable(true);
cawthron
parents:
diff changeset
  2935
		script_Stringsinresourcefiles.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2936
		scripts.setStringsinresourcefiles(script_Stringsinresourcefiles);
cawthron
parents:
diff changeset
  2937
cawthron
parents:
diff changeset
  2938
		StructType script_Struct = CSConfigFactory.eINSTANCE.createStructType();
cawthron
parents:
diff changeset
  2939
		script_Struct.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2940
		script_Struct.setEnable(true);
cawthron
parents:
diff changeset
  2941
		script_Struct.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2942
		scripts.setStruct(script_Struct);
cawthron
parents:
diff changeset
  2943
cawthron
parents:
diff changeset
  2944
		TcclassesType script_Tcclasses = CSConfigFactory.eINSTANCE.createTcclassesType();
cawthron
parents:
diff changeset
  2945
		script_Tcclasses.setCategory(CategoryType.FUNCTIONALITY);
cawthron
parents:
diff changeset
  2946
		script_Tcclasses.setEnable(true);
cawthron
parents:
diff changeset
  2947
		script_Tcclasses.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2948
		scripts.setTcclasses(script_Tcclasses);
cawthron
parents:
diff changeset
  2949
cawthron
parents:
diff changeset
  2950
		TclassdestructorType script_Tclassdestructor = CSConfigFactory.eINSTANCE.createTclassdestructorType();
cawthron
parents:
diff changeset
  2951
		script_Tclassdestructor.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2952
		script_Tclassdestructor.setEnable(true);
cawthron
parents:
diff changeset
  2953
		script_Tclassdestructor.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2954
		scripts.setTclassdestructor(script_Tclassdestructor);
cawthron
parents:
diff changeset
  2955
cawthron
parents:
diff changeset
  2956
		TodocommentsType script_Todocomments = CSConfigFactory.eINSTANCE.createTodocommentsType();
cawthron
parents:
diff changeset
  2957
		script_Todocomments.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2958
		script_Todocomments.setEnable(true);
cawthron
parents:
diff changeset
  2959
		script_Todocomments.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2960
		scripts.setTodocomments(script_Todocomments);
cawthron
parents:
diff changeset
  2961
cawthron
parents:
diff changeset
  2962
		TrapcleanupType script_Trapcleanup = CSConfigFactory.eINSTANCE.createTrapcleanupType();
cawthron
parents:
diff changeset
  2963
		script_Trapcleanup.setCategory(CategoryType.PANIC);
cawthron
parents:
diff changeset
  2964
		script_Trapcleanup.setEnable(true);
cawthron
parents:
diff changeset
  2965
		script_Trapcleanup.setSeverity(SeverityType.HIGH);
cawthron
parents:
diff changeset
  2966
		scripts.setTrapcleanup(script_Trapcleanup);
cawthron
parents:
diff changeset
  2967
cawthron
parents:
diff changeset
  2968
		TrapeleaveType script_Trapeleave = CSConfigFactory.eINSTANCE.createTrapeleaveType();
cawthron
parents:
diff changeset
  2969
		script_Trapeleave.setCategory(CategoryType.PERFORMANCE);
cawthron
parents:
diff changeset
  2970
		script_Trapeleave.setEnable(true);
cawthron
parents:
diff changeset
  2971
		script_Trapeleave.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2972
		scripts.setTrapeleave(script_Trapeleave);
cawthron
parents:
diff changeset
  2973
cawthron
parents:
diff changeset
  2974
		TraprunlType script_Traprunl = CSConfigFactory.eINSTANCE.createTraprunlType();
cawthron
parents:
diff changeset
  2975
		script_Traprunl.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  2976
		script_Traprunl.setEnable(true);
cawthron
parents:
diff changeset
  2977
		script_Traprunl.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2978
		scripts.setTraprunl(script_Traprunl);
cawthron
parents:
diff changeset
  2979
cawthron
parents:
diff changeset
  2980
		TrspassingType script_Trspassing = CSConfigFactory.eINSTANCE.createTrspassingType();
cawthron
parents:
diff changeset
  2981
		script_Trspassing.setCategory(CategoryType.FUNCTIONALITY);
cawthron
parents:
diff changeset
  2982
		script_Trspassing.setEnable(true);
cawthron
parents:
diff changeset
  2983
		script_Trspassing.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2984
		scripts.setTrspassing(script_Trspassing);
cawthron
parents:
diff changeset
  2985
cawthron
parents:
diff changeset
  2986
		UidsType script_Uids = CSConfigFactory.eINSTANCE.createUidsType();
cawthron
parents:
diff changeset
  2987
		script_Uids.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  2988
		script_Uids.setEnable(true);
cawthron
parents:
diff changeset
  2989
		script_Uids.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  2990
		scripts.setUids(script_Uids);
cawthron
parents:
diff changeset
  2991
cawthron
parents:
diff changeset
  2992
		UncompressedaifType script_Uncompressedaif = CSConfigFactory.eINSTANCE.createUncompressedaifType();
cawthron
parents:
diff changeset
  2993
		script_Uncompressedaif.setCategory(CategoryType.PERFORMANCE);
cawthron
parents:
diff changeset
  2994
		script_Uncompressedaif.setEnable(true);
cawthron
parents:
diff changeset
  2995
		script_Uncompressedaif.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  2996
		scripts.setUncompressedaif(script_Uncompressedaif);
cawthron
parents:
diff changeset
  2997
cawthron
parents:
diff changeset
  2998
		UncompressedbmpType script_Uncompressedbmp = CSConfigFactory.eINSTANCE.createUncompressedbmpType();
cawthron
parents:
diff changeset
  2999
		script_Uncompressedbmp.setCategory(CategoryType.PERFORMANCE);
cawthron
parents:
diff changeset
  3000
		script_Uncompressedbmp.setEnable(true);
cawthron
parents:
diff changeset
  3001
		script_Uncompressedbmp.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  3002
		scripts.setUncompressedbmp(script_Uncompressedbmp);
cawthron
parents:
diff changeset
  3003
cawthron
parents:
diff changeset
  3004
		UnicodesourceType script_Unicodesource = CSConfigFactory.eINSTANCE.createUnicodesourceType();
cawthron
parents:
diff changeset
  3005
		script_Unicodesource.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  3006
		script_Unicodesource.setEnable(true);
cawthron
parents:
diff changeset
  3007
		script_Unicodesource.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  3008
		scripts.setUnicodesource(script_Unicodesource);
cawthron
parents:
diff changeset
  3009
cawthron
parents:
diff changeset
  3010
		UserafterType script_Userafter = CSConfigFactory.eINSTANCE.createUserafterType();
cawthron
parents:
diff changeset
  3011
		script_Userafter.setCategory(CategoryType.PERFORMANCE);
cawthron
parents:
diff changeset
  3012
		script_Userafter.setEnable(true);
cawthron
parents:
diff changeset
  3013
		script_Userafter.setSeverity(SeverityType.MEDIUM);
cawthron
parents:
diff changeset
  3014
		scripts.setUserafter(script_Userafter);
cawthron
parents:
diff changeset
  3015
cawthron
parents:
diff changeset
  3016
		UserfreeType script_Userfree = CSConfigFactory.eINSTANCE.createUserfreeType();
cawthron
parents:
diff changeset
  3017
		script_Userfree.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  3018
		script_Userfree.setEnable(true);
cawthron
parents:
diff changeset
  3019
		script_Userfree.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  3020
		scripts.setUserfree(script_Userfree);
cawthron
parents:
diff changeset
  3021
cawthron
parents:
diff changeset
  3022
		UserWaitForRequestType script_UserWaitForRequest = CSConfigFactory.eINSTANCE.createUserWaitForRequestType();
cawthron
parents:
diff changeset
  3023
		script_UserWaitForRequest.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  3024
		script_UserWaitForRequest.setEnable(true);
cawthron
parents:
diff changeset
  3025
		script_UserWaitForRequest.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  3026
		scripts.setUserWaitForRequest(script_UserWaitForRequest);
cawthron
parents:
diff changeset
  3027
cawthron
parents:
diff changeset
  3028
		VariablenamesType script_Variablenames = CSConfigFactory.eINSTANCE.createVariablenamesType();
cawthron
parents:
diff changeset
  3029
		script_Variablenames.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  3030
		script_Variablenames.setEnable(true);
cawthron
parents:
diff changeset
  3031
		script_Variablenames.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  3032
		scripts.setVariablenames(script_Variablenames);
cawthron
parents:
diff changeset
  3033
cawthron
parents:
diff changeset
  3034
		VoidparameterType script_Voidparameter = CSConfigFactory.eINSTANCE.createVoidparameterType();
cawthron
parents:
diff changeset
  3035
		script_Voidparameter.setCategory(CategoryType.CODINGSTANDARDS);
cawthron
parents:
diff changeset
  3036
		script_Voidparameter.setEnable(true);
cawthron
parents:
diff changeset
  3037
		script_Voidparameter.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  3038
		scripts.setVoidparameter(script_Voidparameter);
cawthron
parents:
diff changeset
  3039
cawthron
parents:
diff changeset
  3040
		WorryingcommentsType script_Worryingcomments = CSConfigFactory.eINSTANCE.createWorryingcommentsType();
cawthron
parents:
diff changeset
  3041
		script_Worryingcomments.setCategory(CategoryType.CODEREVIEW);
cawthron
parents:
diff changeset
  3042
		script_Worryingcomments.setEnable(true);
cawthron
parents:
diff changeset
  3043
		script_Worryingcomments.setSeverity(SeverityType.LOW);
cawthron
parents:
diff changeset
  3044
		script_Worryingcomments.setWorryRE("kludge|workaround|\\scrap|hack");
cawthron
parents:
diff changeset
  3045
		scripts.setWorryingcomments(script_Worryingcomments);
cawthron
parents:
diff changeset
  3046
cawthron
parents:
diff changeset
  3047
		return scripts;
cawthron
parents:
diff changeset
  3048
	}
cawthron
parents:
diff changeset
  3049
	
cawthron
parents:
diff changeset
  3050
	/**
cawthron
parents:
diff changeset
  3051
	 * Create the default severities element.
cawthron
parents:
diff changeset
  3052
	 */
cawthron
parents:
diff changeset
  3053
	private SeveritiesType createDefaultSeverities() {
cawthron
parents:
diff changeset
  3054
		SeveritiesType severities = CSConfigFactory.eINSTANCE.createSeveritiesType();
cawthron
parents:
diff changeset
  3055
		
cawthron
parents:
diff changeset
  3056
		HighType severity_High = CSConfigFactory.eINSTANCE.createHighType();
cawthron
parents:
diff changeset
  3057
		severity_High.setEnable(true);
cawthron
parents:
diff changeset
  3058
		severities.setHigh(severity_High);
cawthron
parents:
diff changeset
  3059
		
cawthron
parents:
diff changeset
  3060
		MediumType severity_Medium = CSConfigFactory.eINSTANCE.createMediumType();
cawthron
parents:
diff changeset
  3061
		severity_Medium.setEnable(true);
cawthron
parents:
diff changeset
  3062
		severities.setMedium(severity_Medium);
cawthron
parents:
diff changeset
  3063
		
cawthron
parents:
diff changeset
  3064
		LowType severity_Low = CSConfigFactory.eINSTANCE.createLowType();
cawthron
parents:
diff changeset
  3065
		severity_Low.setEnable(true);
cawthron
parents:
diff changeset
  3066
		severities.setLow(severity_Low);
cawthron
parents:
diff changeset
  3067
		
cawthron
parents:
diff changeset
  3068
		return severities;
cawthron
parents:
diff changeset
  3069
	}
cawthron
parents:
diff changeset
  3070
cawthron
parents:
diff changeset
  3071
	/**
cawthron
parents:
diff changeset
  3072
	 * Create the default sources element.
cawthron
parents:
diff changeset
  3073
	 */
cawthron
parents:
diff changeset
  3074
	private SourcesType createDefaultSources() {
cawthron
parents:
diff changeset
  3075
		SourcesType sources = CSConfigFactory.eINSTANCE.createSourcesType();
cawthron
parents:
diff changeset
  3076
		EList<String> excludeList = sources.getExclude();
cawthron
parents:
diff changeset
  3077
		String[] defaultFileFilters = new String[] {
cawthron
parents:
diff changeset
  3078
				".*\\.au",
cawthron
parents:
diff changeset
  3079
				".*\\.avi",
cawthron
parents:
diff changeset
  3080
				".*\\.bat",
cawthron
parents:
diff changeset
  3081
				".*\\.bin",
cawthron
parents:
diff changeset
  3082
				".*\\.bmp",
cawthron
parents:
diff changeset
  3083
				".*\\.cmd",
cawthron
parents:
diff changeset
  3084
				".*\\.dll",
cawthron
parents:
diff changeset
  3085
				".*\\.doc",
cawthron
parents:
diff changeset
  3086
				".*\\.exe",
cawthron
parents:
diff changeset
  3087
				".*\\.gif",
cawthron
parents:
diff changeset
  3088
				".*\\.jpg",
cawthron
parents:
diff changeset
  3089
				".*\\.lib",
cawthron
parents:
diff changeset
  3090
				".*\\.log",
cawthron
parents:
diff changeset
  3091
				".*\\.mbm",
cawthron
parents:
diff changeset
  3092
				".*\\.mp3",
cawthron
parents:
diff changeset
  3093
				".*\\.mpg",
cawthron
parents:
diff changeset
  3094
				".*\\.png",
cawthron
parents:
diff changeset
  3095
				".*\\.raw",
cawthron
parents:
diff changeset
  3096
				".*\\.rtf",
cawthron
parents:
diff changeset
  3097
				".*\\.tif",
cawthron
parents:
diff changeset
  3098
				".*\\.wav",
cawthron
parents:
diff changeset
  3099
				".*\\.wbmp",
cawthron
parents:
diff changeset
  3100
				".*\\.wmf",
cawthron
parents:
diff changeset
  3101
				".*\\.xls",
cawthron
parents:
diff changeset
  3102
				".*\\.zip"
cawthron
parents:
diff changeset
  3103
			};
cawthron
parents:
diff changeset
  3104
		for (int i = 0; i < defaultFileFilters.length; i++) {
cawthron
parents:
diff changeset
  3105
			excludeList.add(defaultFileFilters[i]);
cawthron
parents:
diff changeset
  3106
		}
cawthron
parents:
diff changeset
  3107
		return sources;
cawthron
parents:
diff changeset
  3108
	}
cawthron
parents:
diff changeset
  3109
cawthron
parents:
diff changeset
  3110
	/**
cawthron
parents:
diff changeset
  3111
	 * Create an error dialog when failed to load from CodeScanner configuration file.
cawthron
parents:
diff changeset
  3112
	 */
cawthron
parents:
diff changeset
  3113
	private void loadConfigError(String fileName, String errorMessage) {
cawthron
parents:
diff changeset
  3114
		IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
cawthron
parents:
diff changeset
  3115
		if (workbenchWindow != null) {
cawthron
parents:
diff changeset
  3116
			MessageDialog.openError(workbenchWindow.getShell(), 
cawthron
parents:
diff changeset
  3117
				Messages.getString("CSConfigSettings.LoadConfigErrorTitle"), 
cawthron
parents:
diff changeset
  3118
				Messages.getString("CSConfigSettings.LoadConfigErrorMessage") + fileName + ": " + errorMessage);
cawthron
parents:
diff changeset
  3119
		}
cawthron
parents:
diff changeset
  3120
	}
cawthron
parents:
diff changeset
  3121
cawthron
parents:
diff changeset
  3122
	/**
cawthron
parents:
diff changeset
  3123
	 * Create an error dialog when failed to save CodeScanner configuration to file.
cawthron
parents:
diff changeset
  3124
	 */
cawthron
parents:
diff changeset
  3125
	private void saveConfigError(String fileName, String errorMessage) {
cawthron
parents:
diff changeset
  3126
		IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
cawthron
parents:
diff changeset
  3127
		if (workbenchWindow != null) {
cawthron
parents:
diff changeset
  3128
			MessageDialog.openError(workbenchWindow.getShell(), 
cawthron
parents:
diff changeset
  3129
				Messages.getString("CSConfigSettings.SaveConfigErrorTitle"), 
cawthron
parents:
diff changeset
  3130
				Messages.getString("CSConfigSettings.SaveConfigErrorMessage") + fileName + ": " + errorMessage);
cawthron
parents:
diff changeset
  3131
		}
cawthron
parents:
diff changeset
  3132
	}
cawthron
parents:
diff changeset
  3133
cawthron
parents:
diff changeset
  3134
}