diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml deleted file mode 100644 index f4205bf8c..000000000 --- a/.github/workflows/code_quality.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Qodana 🔭 -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - -jobs: - qodana: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - name: Qodana Scan 🔭 - uses: JetBrains/qodana-action@v2023.2.8 - env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} - with: - args: --baseline,qodana.sarif.json - upload-result: true diff --git a/README.md b/README.md index fda08d119..72bdb5e6d 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/minerva) ![GitHub contributors](https://img.shields.io/github/contributors/Pale-Blue-Dot-97/Minerva?) [![CodeFactor](https://www.codefactor.io/repository/github/pale-blue-dot-97/minerva/badge)](https://www.codefactor.io/repository/github/pale-blue-dot-97/minerva) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/f961aed541494e4db7317bead5f84fef)](https://app.codacy.com/gh/Pale-Blue-Dot-97/Minerva/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) ![tests](https://github.com/Pale-Blue-Dot-97/Minerva/actions/workflows/tests.yml/badge.svg) [![Read the Docs](https://img.shields.io/readthedocs/smp?)](https://pale-blue-dot-97.github.io/Minerva/) -[![Qodana](https://github.com/Pale-Blue-Dot-97/Minerva/actions/workflows/code_quality.yml/badge.svg)](https://github.com/Pale-Blue-Dot-97/Minerva/actions/workflows/code_quality.yml) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Pale-Blue-Dot-97/Minerva/main.svg)](https://results.pre-commit.ci/latest/github/Pale-Blue-Dot-97/Minerva/main) diff --git a/docs/docs_readme.md b/docs/docs_readme.md index fda08d119..72bdb5e6d 100644 --- a/docs/docs_readme.md +++ b/docs/docs_readme.md @@ -5,9 +5,9 @@ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/minerva) ![GitHub contributors](https://img.shields.io/github/contributors/Pale-Blue-Dot-97/Minerva?) [![CodeFactor](https://www.codefactor.io/repository/github/pale-blue-dot-97/minerva/badge)](https://www.codefactor.io/repository/github/pale-blue-dot-97/minerva) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/f961aed541494e4db7317bead5f84fef)](https://app.codacy.com/gh/Pale-Blue-Dot-97/Minerva/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) ![tests](https://github.com/Pale-Blue-Dot-97/Minerva/actions/workflows/tests.yml/badge.svg) [![Read the Docs](https://img.shields.io/readthedocs/smp?)](https://pale-blue-dot-97.github.io/Minerva/) -[![Qodana](https://github.com/Pale-Blue-Dot-97/Minerva/actions/workflows/code_quality.yml/badge.svg)](https://github.com/Pale-Blue-Dot-97/Minerva/actions/workflows/code_quality.yml) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Pale-Blue-Dot-97/Minerva/main.svg)](https://results.pre-commit.ci/latest/github/Pale-Blue-Dot-97/Minerva/main) diff --git a/minerva/datasets/factory.py b/minerva/datasets/factory.py index 75913b123..543b019a7 100644 --- a/minerva/datasets/factory.py +++ b/minerva/datasets/factory.py @@ -111,7 +111,7 @@ def make_dataset( def get_subdataset( this_dataset_params: Dict[str, Any], key: str - ) -> Tuple[Callable[..., GeoDataset], str]: + ) -> Tuple[Callable[..., GeoDataset], List[str]]: # Get the params for this sub-dataset. sub_dataset_params = this_dataset_params[key] @@ -121,12 +121,11 @@ def get_subdataset( ) # Construct the path to the sub-dataset's files. - sub_dataset_path: Path = ( - universal_path(data_directory) / sub_dataset_params["paths"] + sub_dataset_paths = utils.compile_dataset_paths( + universal_path(data_directory), sub_dataset_params["paths"] ) - sub_dataset_path = sub_dataset_path.absolute() - return _sub_dataset, str(sub_dataset_path) + return _sub_dataset, sub_dataset_paths def create_subdataset( dataset_class: Callable[..., GeoDataset], @@ -135,8 +134,10 @@ def create_subdataset( _transformations: Optional[Any], ) -> GeoDataset: copy_params = deepcopy(subdataset_params) + if "crs" in copy_params["params"]: copy_params["params"]["crs"] = CRS.from_epsg(copy_params["params"]["crs"]) + if sample_pairs: return PairedDataset( dataset_class, @@ -169,7 +170,7 @@ def create_subdataset( master_transforms: Optional[Any] = None for area_key in type_dataset_params.keys(): # If any of these keys are present, this must be a parameter set for a singular dataset at this level. - if area_key in ("module", "name", "params", "root", "paths"): + if area_key in ("module", "name", "params", "paths"): multi_datasets_exist = False continue @@ -361,10 +362,11 @@ def make_loaders( rank: int = 0, world_size: int = 1, p_dist: bool = False, + task_name: Optional[str] = None, **params, ) -> Tuple[ - Dict[str, DataLoader[Iterable[Any]]], - Dict[str, int], + Union[Dict[str, DataLoader[Iterable[Any]]], DataLoader[Iterable[Any]]], + Union[Dict[str, int], int], List[Tuple[int, int]], Dict[Any, Any], ]: @@ -375,6 +377,8 @@ def make_loaders( world_size (int): Total number of processes across all nodes. For use with :class:`~torch.nn.parallel.DistributedDataParallel`. p_dist (bool): Print to screen the distribution of classes within each dataset. + task_name (str): Optional; If specified, only create the loaders for this task, + overwriting experiment-wode parameters with those found in this task's params if found. Keyword Args: batch_size (int): Number of samples in each batch to be returned by the DataLoaders. @@ -402,41 +406,51 @@ def make_loaders( * The class distribution of the entire dataset, sorted from largest to smallest class. * Unused and updated kwargs. """ + task_params = params + if task_name is not None: + task_params = params["tasks"][task_name] + # Gets out the parameters for the DataLoaders from params. - dataloader_params: Dict[Any, Any] = params["loader_params"] - dataset_params: Dict[str, Any] = params["dataset_params"] - batch_size: int = params["batch_size"] + dataloader_params: Dict[Any, Any] = utils.fallback_params( + "loader_params", task_params, params + ) + dataset_params: Dict[str, Any] = utils.fallback_params( + "dataset_params", task_params, params + ) + batch_size: int = utils.fallback_params("batch_size", task_params, params) - model_type = params["model_type"] + model_type = utils.fallback_params("model_type", task_params, params) class_dist: List[Tuple[int, int]] = [(0, 0)] new_classes: Dict[int, str] = {} new_colours: Dict[int, str] = {} forwards: Dict[int, int] = {} - sample_pairs: Union[bool, Any] = params.get("sample_pairs", False) + sample_pairs: Union[bool, Any] = utils.fallback_params( + "sample_pairs", task_params, params, False + ) if not isinstance(sample_pairs, bool): sample_pairs = False + elim = utils.fallback_params("elim", task_params, params, False) + if not utils.check_substrings_in_string(model_type, "siamese"): # Load manifest from cache for this dataset. - manifest = get_manifest(get_manifest_path()) + manifest = get_manifest(get_manifest_path(), task_name) class_dist = utils.modes_from_manifest(manifest) # Finds the empty classes and returns modified classes, a dict to convert between the old and new systems # and new colours. new_classes, forwards, new_colours = utils.load_data_specs( - class_dist=class_dist, elim=params.get("elim", False) + class_dist=class_dist, + elim=elim, ) - # Inits dicts to hold the variables and lists for train, validation and test. - n_batches = {} - loaders = {} + n_batches: Union[Dict[str, int], int] + loaders: Union[Dict[str, DataLoader[Iterable[Any]]], DataLoader[Iterable[Any]]] - for mode in dataset_params.keys(): - if params.get("elim", False) and not utils.check_substrings_in_string( - model_type, "siamese" - ): + if "sampler" in dataset_params.keys(): + if elim and not utils.check_substrings_in_string(model_type, "siamese"): class_transform = { "ClassTransform": { "module": "minerva.transforms", @@ -444,52 +458,98 @@ def make_loaders( } } - if type(dataset_params[mode]["mask"].get("transforms")) != dict: - dataset_params[mode]["mask"]["transforms"] = class_transform + if type(dataset_params["mask"].get("transforms")) != dict: + dataset_params["mask"]["transforms"] = class_transform else: - dataset_params[mode]["mask"]["transforms"][ + dataset_params["mask"]["transforms"][ "ClassTransform" ] = class_transform["ClassTransform"] - sampler_params: Dict[str, Any] = dataset_params[mode]["sampler"] + sampler_params: Dict[str, Any] = dataset_params["sampler"] # Calculates number of batches. - n_batches[mode] = int(sampler_params["params"]["length"] / batch_size) + n_batches = int(sampler_params["params"]["length"] / batch_size) # --+ MAKE DATASETS +=========================================================================================+ - print(f"CREATING {mode} DATASET") - loaders[mode] = construct_dataloader( + print(f"CREATING {task_name} DATASET") + loaders = construct_dataloader( params["dir"]["data"], - dataset_params[mode], + dataset_params, sampler_params, dataloader_params, batch_size, - collator_params=params["collator"], + collator_params=utils.fallback_params("collator", task_params, params), rank=rank, world_size=world_size, - sample_pairs=sample_pairs if mode == "train" else False, + sample_pairs=sample_pairs, ) print("DONE") + else: + # Inits dicts to hold the variables and lists for train, validation and test. + n_batches = {} + loaders = {} + + for mode in dataset_params.keys(): + if elim and not utils.check_substrings_in_string(model_type, "siamese"): + class_transform = { + "ClassTransform": { + "module": "minerva.transforms", + "transform": forwards, + } + } + + if type(dataset_params[mode]["mask"].get("transforms")) != dict: + dataset_params[mode]["mask"]["transforms"] = class_transform + else: + dataset_params[mode]["mask"]["transforms"][ + "ClassTransform" + ] = class_transform["ClassTransform"] + + mode_sampler_params: Dict[str, Any] = dataset_params[mode]["sampler"] + + # Calculates number of batches. + n_batches[mode] = int(mode_sampler_params["params"]["length"] / batch_size) + + # --+ MAKE DATASETS +=====================================================================================+ + print(f"CREATING {mode} DATASET") + loaders[mode] = construct_dataloader( + params["dir"]["data"], + dataset_params[mode], + mode_sampler_params, + dataloader_params, + batch_size, + collator_params=utils.fallback_params("collator", task_params, params), + rank=rank, + world_size=world_size, + sample_pairs=sample_pairs if mode == "train" else False, + ) + print("DONE") + if not utils.check_substrings_in_string(model_type, "siamese"): # Transform class dist if elimination of classes has occurred. - if params.get("elim", False): + if elim: class_dist = utils.class_dist_transform(class_dist, forwards) # Prints class distribution in a pretty text format using tabulate to stdout. if p_dist: utils.print_class_dist(class_dist) - params["n_classes"] = len(new_classes) - model_params_params = params["model_params"].get("params", {}) - model_params_params["n_classes"] = len(new_classes) - params["model_params"]["params"] = model_params_params - params["classes"] = new_classes - params["colours"] = new_colours + task_params["n_classes"] = len(new_classes) + model_params = utils.fallback_params("model_params", task_params, params, {}) + model_params["n_classes"] = len(new_classes) - params["max_pixel_value"] = IMAGERY_CONFIG["data_specs"]["max_value"] + if "model_params" in task_params: + task_params["model_params"]["params"] = model_params + else: + task_params["model_params"] = {"params": model_params} - return loaders, n_batches, class_dist, params + task_params["classes"] = new_classes + task_params["colours"] = new_colours + + task_params["max_pixel_value"] = IMAGERY_CONFIG["data_specs"]["max_value"] + + return loaders, n_batches, class_dist, task_params def get_manifest_path() -> str: @@ -501,7 +561,9 @@ def get_manifest_path() -> str: return str(Path(CACHE_DIR, f"{utils.get_dataset_name()}_Manifest.csv")) -def get_manifest(manifest_path: Union[str, Path]) -> DataFrame: +def get_manifest( + manifest_path: Union[str, Path], task_name: Optional[str] = None +) -> DataFrame: """Attempts to return the :class:`~pandas.DataFrame` located at ``manifest_path``. If a ``csv`` file is not found at ``manifest_path``, the manifest is constructed from @@ -519,6 +581,7 @@ def get_manifest(manifest_path: Union[str, Path]) -> DataFrame: Args: manifest_path (str | ~pathlib.Path): Path (including filename and extension) to the manifest saved as a ``csv``. + task_name (str): Optional; Name of the task to which the dataset to create a manifest of belongs to. Returns: ~pandas.DataFrame: Manifest either loaded from ``manifest_path`` or created from parameters in :data:`CONFIG`. @@ -532,9 +595,7 @@ def get_manifest(manifest_path: Union[str, Path]) -> DataFrame: print("CONSTRUCTING MISSING MANIFEST") mf_config = CONFIG.copy() - mf_config["dataloader_params"] = CONFIG["loader_params"] - - manifest = make_manifest(mf_config) + manifest = make_manifest(mf_config, task_name) print(f"MANIFEST TO FILE -----> {manifest_path}") path = manifest_path.parent @@ -546,44 +607,76 @@ def get_manifest(manifest_path: Union[str, Path]) -> DataFrame: return manifest -def make_manifest(mf_config: Dict[Any, Any]) -> DataFrame: +def make_manifest( + mf_config: Dict[Any, Any], task_name: Optional[str] = None +) -> DataFrame: """Constructs a manifest of the dataset detailing each sample therein. The dataset to construct a manifest of is defined by the ``data_config`` value in the config. Args: mf_config (dict[~typing.Any, ~typing.Any]): Config to use to construct the manifest with. + task_name (str): Optional; Name of the task to which the dataset to create a manifest of belongs to. Returns: ~pandas.DataFrame: The completed manifest as a :class:`~pandas.DataFrame`. """ - batch_size: int = mf_config["batch_size"] - dataloader_params: Dict[str, Any] = mf_config["dataloader_params"] - dataset_params: Dict[str, Any] = mf_config["dataset_params"] - collator_params: Dict[str, Any] = mf_config["collator"] + + def delete_class_transform(params: Dict[str, Any]) -> None: + if "transforms" in params["mask"]: + if isinstance(params["mask"]["transforms"], dict): + if "ClassTransform" in params["mask"]["transforms"]: + del params["mask"]["transforms"]["ClassTransform"] + + task_params = mf_config + if task_name is not None: + task_params = mf_config["tasks"][task_name] + + batch_size: int = utils.fallback_params("batch_size", task_params, mf_config) + loader_params: Dict[str, Any] = utils.fallback_params( + "loader_params", task_params, mf_config + ) + dataset_params: Dict[str, Any] = utils.fallback_params( + "dataset_params", task_params, mf_config + ) + collator_params: Dict[str, Any] = utils.fallback_params( + "collator_params", task_params, mf_config + ) + sampler_params = dataset_params["sampler"] # Ensure there are no errant `ClassTransform` transforms in the parameters from previous runs. # A `ClassTransform` can only be defined with a correct manifest so we cannot use an old one to # sample the dataset. We need the original, un-transformed labels. - for mode in dataset_params.keys(): - if "transforms" in dataset_params[mode]["mask"]: - if isinstance(dataset_params[mode]["mask"]["transforms"], dict): - if "ClassTransform" in dataset_params[mode]["mask"]["transforms"]: - del dataset_params[mode]["mask"]["transforms"]["ClassTransform"] - - keys = list(dataset_params.keys()) - print("CONSTRUCTING DATASET") - - sampler_params = dataset_params[keys[0]]["sampler"] - - loader = construct_dataloader( - mf_config["dir"]["data"], - dataset_params[keys[0]], - sampler_params, - dataloader_params, - batch_size, - collator_params=collator_params, - ) + if "sampler" in dataset_params.keys(): + delete_class_transform(dataset_params) + + print("CONSTRUCTING DATASET") + + loader = construct_dataloader( + mf_config["dir"]["data"], + dataset_params, + sampler_params, + loader_params, + batch_size, + collator_params=collator_params, + ) + else: + for mode in dataset_params.keys(): + delete_class_transform(dataset_params[mode]) + + keys = list(dataset_params.keys()) + sampler_params = dataset_params[keys[0]]["sampler"] + + print("CONSTRUCTING DATASET") + + loader = construct_dataloader( + mf_config["dir"]["data"], + dataset_params[keys[0]], + sampler_params, + loader_params, + batch_size, + collator_params=collator_params, + ) print("FETCHING SAMPLES") df = DataFrame() diff --git a/minerva/datasets/paired.py b/minerva/datasets/paired.py index 40ec8e60e..5a90c6e17 100644 --- a/minerva/datasets/paired.py +++ b/minerva/datasets/paired.py @@ -109,10 +109,10 @@ def __init__( key.name: kwargs[key.name] for key in super_sig if key.name in kwargs } - if issubclass(dataset, RasterDataset): # type: ignore[arg-type] - # This is very sketchy but an unavoidable workaround due to TorchGeo's behaviour. - RasterDataset.filename_glob = dataset.filename_glob # type: ignore[attr-defined] - RasterDataset.filename_regex = dataset.filename_regex # type: ignore[attr-defined] + # Make sure PairedDataset has access to the `all_bands` attribute of the dataset. + # Needed for a subset of the bands to be selected if so desired. + if hasattr(dataset, "all_bands"): + self.all_bands = dataset.all_bands super().__init__(*args, **super_kwargs) self.dataset = dataset(*args, **kwargs) diff --git a/minerva/inbuilt_cfgs/example_3rd_party.yml b/minerva/inbuilt_cfgs/example_3rd_party.yml index c71482888..565508cdd 100644 --- a/minerva/inbuilt_cfgs/example_3rd_party.yml +++ b/minerva/inbuilt_cfgs/example_3rd_party.yml @@ -38,9 +38,9 @@ elim: false # Eliminates empty classes from schema. balance: false # Balances dataset classes. # ---+ Loss and Optimisers +--------------------------------------------------- -loss_func: CrossEntropyLoss # Name of the loss function to use. -lr: 1.0E-2 # Learning rate of optimiser. -optim_func: SGD # Name of the optimiser function. +loss_func: &loss_func CrossEntropyLoss # Name of the loss function to use. +lr: 1.0E-2 # Learning rate of optimiser. +optim_func: SGD # Name of the optimiser function. # ---+ Model Parameters +------------------------------------------------------ model_params: @@ -57,6 +57,7 @@ optim_params: # ---+ Loss Function Parameters +---------------------------------------------- loss_params: + name: *loss_func params: # ---+ Dataloader Parameters +------------------------------------------------- @@ -71,9 +72,9 @@ project: pytest # Define the project name for wandb. wandb_dir: /test/tmp/wandb # Directory to store wandb logs locally. # ---+ Minerva Inbuilt Logging Functions +------------------------------------- -logger: STGLogger -metrics: SPMetrics -model_io: sup_tg +# task_logger: SupervisedTaskLogger +# step_logger: SupervisedGeoStepLogger +# model_io: sup_tg record_int: true # Store integer results in memory. record_float: true # Store floating point results too. Beware memory overload! @@ -83,106 +84,121 @@ collator: module: torchgeo.datasets name: stack_samples -# === DATASET PARAMETERS ====================================================== -dataset_params: - # Training Dataset - train: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 120 - - image: - transforms: - ToRGB: - module: minerva.transforms - - images_1: +# === TASKS =================================================================== +tasks: + fit-train: + type: StandardEpoch + train: true + record_float: true + + # ---+ Dataset Parameters +-------------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 120 + + image: + transforms: + ToRGB: + module: minerva.transforms + + images_1: + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + image2: + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + transforms: + SingleLabel: + module: minerva.transforms + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + fit-val: + type: StandardEpoch + train: true + record_float: true + + # ---+ Dataset Parameters +-------------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 32 + + image: + transforms: + ToRGB: + module: minerva.transforms module: minerva.datasets.__testing name: TstImgDataset paths: NAIP params: res: 1.0 - image2: + mask: + transforms: + SingleLabel: + module: minerva.transforms + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + test-test: + type: StandardEpoch + train: true + record_float: true + + # ---+ Dataset Parameters +-------------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 32 + + image: + transforms: + ToRGB: + module: minerva.transforms module: minerva.datasets.__testing name: TstImgDataset paths: NAIP params: res: 1.0 - mask: - transforms: - SingleLabel: - module: minerva.transforms - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Validation Dataset - val: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 32 - - image: - transforms: - ToRGB: - module: minerva.transforms - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - transforms: - SingleLabel: - module: minerva.transforms - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Test Dataset - test: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 32 - - image: - transforms: - ToRGB: - module: minerva.transforms - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - transforms: - SingleLabel: - module: minerva.transforms - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 + mask: + transforms: + SingleLabel: + module: minerva.transforms + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 # === PLOTTING OPTIONS ======================================================== plots: diff --git a/minerva/inbuilt_cfgs/example_CNN_config.yml b/minerva/inbuilt_cfgs/example_CNN_config.yml index 02c047b28..af408a4a1 100644 --- a/minerva/inbuilt_cfgs/example_CNN_config.yml +++ b/minerva/inbuilt_cfgs/example_CNN_config.yml @@ -32,15 +32,15 @@ n_classes: &n_classes 8 # Number of classes in dataset. # ---+ Experiment Execution +-------------------------------------------------- max_epochs: 3 # Maximum number of training epochs. -elim: true # Eliminates empty classes from schema. -balance: true # Balances dataset classes. +elim: false # Eliminates empty classes from schema. +balance: false # Balances dataset classes. pre_train: false # Activate pre-training mode. fine_tune: false # Activate fine-tuning mode. # ---+ Loss and Optimisers +--------------------------------------------------- -loss_func: CrossEntropyLoss # Name of the loss function to use. -lr: 1.0E-3 # Learning rate of optimiser. -optim_func: SGD # Name of the optimiser function. +loss_func: &loss_func CrossEntropyLoss # Name of the loss function to use. +lr: 1.0E-3 # Learning rate of optimiser. +optim_func: SGD # Name of the optimiser function. # ---+ Model Parameters +------------------------------------------------------ model_params: @@ -55,6 +55,7 @@ optim_params: # ---+ Loss Function Parameters +---------------------------------------------- loss_params: + name: *loss_func params: # ---+ Dataloader Parameters +------------------------------------------------- @@ -69,8 +70,7 @@ wandb_dir: /test/tmp/wandb # Directory to store wandb logs locally. # === MODEL IO & LOGGING ====================================================== # ---+ Minerva Inbuilt Logging Functions +------------------------------------- -logger: STGLogger -metrics: SPMetrics +task_logger: SupervisedTaskLogger model_io: sup_tg record_int: true # Store integer results in memory. @@ -81,102 +81,110 @@ collator: module: torchgeo.datasets name: stack_samples -# === DATASET PARAMETERS ====================================================== -dataset_params: - # Training Dataset - train: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 320 - - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - mask: - transforms: - SingleLabel: - module: minerva.transforms - mode: modal - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Validation Dataset - val: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 80 - - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - transforms: - SingleLabel: - module: minerva.transforms - mode: modal - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Test Dataset - test: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 160 - - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - transforms: - SingleLabel: - module: minerva.transforms - mode: modal - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 +# === TASKS =================================================================== +tasks: + fit-train: + type: StandardEpoch + train: true + record_float: true + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 320 + + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + mask: + transforms: + SingleLabel: + module: minerva.transforms + mode: modal + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + fit-val: + type: StandardEpoch + train: false + record_float: true + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 80 + + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + transforms: + SingleLabel: + module: minerva.transforms + mode: modal + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + test-test: + type: StandardEpoch + record_float: true + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 160 + + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + transforms: + SingleLabel: + module: minerva.transforms + mode: modal + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 # === PLOTTING OPTIONS ======================================================== plots: diff --git a/minerva/inbuilt_cfgs/example_GeoCLR_config.yml b/minerva/inbuilt_cfgs/example_GeoCLR_config.yml index c9d721e8c..879889571 100644 --- a/minerva/inbuilt_cfgs/example_GeoCLR_config.yml +++ b/minerva/inbuilt_cfgs/example_GeoCLR_config.yml @@ -37,7 +37,7 @@ pre_train: true # Activate pre-training mode. fine_tune: false # Activate fine-tuning mode. # ---+ Loss and Optimisers +--------------------------------------------------- -loss_func: NTXentLoss # Name of the loss function to use. +loss_func: &loss_func NTXentLoss # Name of the loss function to use. lr: 1.0E-2 # Learning rate of optimiser. optim_func: SGD # Name of the optimiser function. @@ -60,6 +60,7 @@ optim_params: # ---+ Loss Function Parameters +---------------------------------------------- loss_params: + name: *loss_func module: lightly.loss params: temperature: 0.5 @@ -75,11 +76,6 @@ project: pytest # Define the project name for wandb. wandb_dir: /test/tmp/wandb # Directory to store wandb logs locally. # === MODEL IO & LOGGING ====================================================== -# ---+ Minerva Inbuilt Logging Functions +------------------------------------- -logger: SSLLogger -metrics: SSLMetrics -model_io: ssl_pair_tg - record_int: true # Store integer results in memory. record_float: true # Store floating point results too. Beware memory overload! @@ -88,104 +84,163 @@ collator: module: torchgeo.datasets name: stack_samples -# === DATASET PARAMETERS ====================================================== -dataset_params: - # Training Dataset - train: - sampler: - module: minerva.samplers - name: RandomPairGeoSampler - roi: false - params: - size: *patch_size - length: 120 - max_r: *max_r - - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - RandomApply: - p: 0.25 - RandomResizedCrop: +# === TASKS =================================================================== +tasks: + fit-train: + type: StandardEpoch + train: true + record_float: true + sample_pairs: true + + # ---+ Minerva Inbuilt Logging Functions +------------------------- + task_logger: SSLTaskLogger + step_logger: + name: SSLStepLogger + model_io: ssl_pair_tg + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + sampler: + module: minerva.samplers + name: RandomPairGeoSampler + roi: false + params: + size: *patch_size + length: 120 + max_r: *max_r + + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + RandomApply: + p: 0.25 + RandomResizedCrop: + module: torchvision.transforms + size: *patch_size + DetachedColorJitter: + module: minerva.transforms + brightness: 0.8 + contrast: 0.8 + saturation: 0.8 + hue: 0.2 + RandomHorizontalFlip: + module: torchvision.transforms + RandomVerticalFlip: + module: torchvision.transforms + GaussianBlur: module: torchvision.transforms + kernel_size: 25 + + image1: + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + image2: + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + fit-val: + type: WeightedKNN + train: false + sample_pairs: false + n_classes: 8 + + # ---+ Minerva Inbuilt Logging Functions +------------------------- + task_logger: SSLTaskLogger + step_logger: + name: KNNStepLogger + model_io: ssl_pair_tg + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + features: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 32 + + image: + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + test: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: size: *patch_size - DetachedColorJitter: - module: minerva.transforms - brightness: 0.8 - contrast: 0.8 - saturation: 0.8 - hue: 0.2 - RandomHorizontalFlip: - module: torchvision.transforms - RandomVerticalFlip: - module: torchvision.transforms - GaussianBlur: - module: torchvision.transforms - kernel_size: 25 - - image1: + length: 32 + + image: + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + test-test: + type: StandardEpoch + train: false + record_float: true + sample_pairs: false + n_classes: 8 + + # ---+ Minerva Inbuilt Logging Functions +------------------------- + task_logger: SupervisedTaskLogger + model_io: sup_tg + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 32 + + image: module: minerva.datasets.__testing name: TstImgDataset paths: NAIP params: res: 1.0 - image2: + + mask: module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP + name: TstMaskDataset + paths: Chesapeake7 params: res: 1.0 - # Validation Dataset - val: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 32 - - image: - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Test Dataset - test: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 32 - - image: - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - # === PLOTTING OPTIONS ======================================================== plots: History: true # Plot of the training and validation metrics over epochs. diff --git a/minerva/inbuilt_cfgs/example_GeoSimConvNet.yml b/minerva/inbuilt_cfgs/example_GeoSimConvNet.yml index abdcc5862..593abae0b 100644 --- a/minerva/inbuilt_cfgs/example_GeoSimConvNet.yml +++ b/minerva/inbuilt_cfgs/example_GeoSimConvNet.yml @@ -39,15 +39,15 @@ pre_train: true # Activate pre-training mode. fine_tune: false # Activate fine-tuning mode. # ---+ Loss and Optimisers +--------------------------------------------------- -loss_func: SegBarlowTwinsLoss # Name of the loss function to use. -lr: 1.0E-3 # Learning rate of optimiser. -optim_func: SGD # Name of the optimiser function. +loss_func: &loss_func SegBarlowTwinsLoss # Name of the loss function to use. +lr: 1.0E-3 # Learning rate of optimiser. +optim_func: SGD # Name of the optimiser function. # ---+ SSL/ Siamese Options +-------------------------------------------------- sample_pairs: true # Activates Siamese paired sampling. -max_r: &max_r 56 # Max distance between patches within a Siamese pair. -knn_k: 5 # Top-k most similar images used to predict image for KNN val -val_freq: 2 # Validation epoch every ``val_freq`` training epochs. +max_r: &max_r 320 # Max distance between patches within a pair. +knn_k: 5 # Top-k most similar images to predict image for KNN val +val_freq: 2 # Validation epoch every ``val_freq`` training epochs. # ---+ Model Parameters +------------------------------------------------------ model_params: @@ -61,6 +61,7 @@ optim_params: # ---+ Loss Function Parameters +---------------------------------------------- loss_params: + name: *loss_func module: minerva.loss params: @@ -75,11 +76,6 @@ project: pytest # Define the project name for wandb. wandb_dir: *wandb_dir # === MODEL IO & LOGGING ====================================================== -# ---+ Minerva Inbuilt Logging Functions +------------------------------------- -logger: SSLLogger -metrics: SSLMetrics -model_io: ssl_pair_tg - record_int: true # Store integer results in memory. record_float: false # Store floating point results too. Beware memory overload! @@ -88,104 +84,155 @@ collator: module: torchgeo.datasets name: stack_samples -# === DATASET PARAMETERS ====================================================== -dataset_params: - # Training Dataset - train: - sampler: - module: minerva.samplers - name: RandomPairGeoSampler - roi: false - params: - size: *patch_size - length: 120 - max_r: *max_r - - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - RandomApply: - p: 0.25 - RandomResizedCrop: +# === TASKS =================================================================== +tasks: + fit-train: + type: StandardEpoch + train: true + record_float: true + sample_pairs: true + + # ---+ Minerva Inbuilt Logging Functions +------------------------- + task_logger: SSLTaskLogger + model_io: ssl_pair_tg + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + sampler: + module: minerva.samplers + name: RandomPairGeoSampler + roi: false + params: + size: *patch_size + length: 120 + max_r: *max_r + + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + RandomApply: + p: 0.25 + RandomResizedCrop: + module: torchvision.transforms + size: *patch_size + DetachedColorJitter: + module: minerva.transforms + brightness: 0.8 + contrast: 0.8 + saturation: 0.8 + hue: 0.2 + RandomHorizontalFlip: + module: torchvision.transforms + RandomVerticalFlip: + module: torchvision.transforms + GaussianBlur: module: torchvision.transforms + kernel_size: 25 + + module: minerva.datasets + name: SSL4EOS12Sentinel2 + paths: SSL4EO-S12 + params: + res: 10.0 + crs: 25832 + bands: [B1, B2, B3, B8A] + + fit-val: + type: WeightedKNN + train: false + record_float: true + sample_pairs: false + + # ---+ Minerva Inbuilt Logging Functions +------------------------- + task_logger: SSLTaskLogger + step_logger: + name: KNNStepLogger + model_io: ssl_pair_tg + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + features: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: size: *patch_size - DetachedColorJitter: - module: minerva.transforms - brightness: 0.8 - contrast: 0.8 - saturation: 0.8 - hue: 0.2 - RandomHorizontalFlip: - module: torchvision.transforms - RandomVerticalFlip: - module: torchvision.transforms - GaussianBlur: - module: torchvision.transforms - kernel_size: 25 - - image1: + length: 32 + + image: + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + test: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 32 + + image: + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + test-test: + type: StandardEpoch + train: false + record_float: true + sample_pairs: false + + # ---+ Minerva Inbuilt Logging Functions +------------------------- + task_logger: SSLTaskLogger + model_io: ssl_pair_tg + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 32 + + image: module: minerva.datasets.__testing name: TstImgDataset paths: NAIP params: res: 1.0 - image2: + + mask: module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP + name: TstMaskDataset + paths: Chesapeake7 params: res: 1.0 - # Validation Dataset - val: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 32 - - image: - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Test Dataset - test: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 32 - - image: - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - # === PLOTTING OPTIONS ======================================================== plots: History: true # Plot of the training and validation metrics over epochs. diff --git a/minerva/inbuilt_cfgs/example_UNetR_config.yml b/minerva/inbuilt_cfgs/example_UNetR_config.yml index 4efecea6d..26757019f 100644 --- a/minerva/inbuilt_cfgs/example_UNetR_config.yml +++ b/minerva/inbuilt_cfgs/example_UNetR_config.yml @@ -31,16 +31,16 @@ input_size: &input_size [4, 224, 224] # patch_size plus leading channel dim. n_classes: &n_classes 8 # Number of classes in dataset. # ---+ Experiment Execution +-------------------------------------------------- -max_epochs: 5 # Maximum number of training epochs. +max_epochs: 5 # Maximum number of training epochs. elim: true # Eliminates empty classes from schema. balance: true # Balances dataset classes. pre_train: false # Activate pre-training mode. fine_tune: false # Activate fine-tuning mode. # ---+ Loss and Optimisers +--------------------------------------------------- -loss_func: CrossEntropyLoss # Name of the loss function to use. -lr: 1.0E-3 # Learning rate of optimiser. -optim_func: SGD # Name of the optimiser function. +loss_func: &loss_func CrossEntropyLoss # Name of the loss function to use. +lr: 1.0E-3 # Learning rate of optimiser. +optim_func: SGD # Name of the optimiser function. # ---+ Model Parameters +------------------------------------------------------ model_params: @@ -57,6 +57,7 @@ optim_params: # ---+ Loss Function Parameters +---------------------------------------------- loss_params: + name: *loss_func params: # ---+ Dataloader Parameters +------------------------------------------------- @@ -71,9 +72,9 @@ wandb_dir: /test/tmp/wandb # Directory to store wandb logs locally. # === MODEL IO & LOGGING ====================================================== # ---+ Minerva Inbuilt Logging Functions +------------------------------------- -logger: STGLogger -metrics: SPMetrics -model_io: sup_tg +# task_logger: SupervisedTaskLogger +# step_logger: SupervisedGeoStepLogger +# model_io: sup_tg record_int: true # Store integer results in memory. record_float: false # Store floating point results too. Beware memory overload! @@ -83,87 +84,102 @@ collator: module: torchgeo.datasets name: stack_samples -# === DATASET PARAMETERS ====================================================== -dataset_params: - # Training Dataset - train: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 320 - - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - mask: - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Validation Dataset - val: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 80 - - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - mask: - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Test Dataset - test: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 160 - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - mask: - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 +# === TASKS =================================================================== +tasks: + fit-train: + type: StandardEpoch + train: true + record_float: true + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 320 + + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + mask: + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + fit-val: + type: StandardEpoch + train: true + record_float: true + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 80 + + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + mask: + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + test-test: + type: StandardEpoch + train: true + record_float: true + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 160 + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + mask: + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 # === PLOTTING OPTIONS ======================================================== plots: diff --git a/minerva/inbuilt_cfgs/example_autoencoder_config.yml b/minerva/inbuilt_cfgs/example_autoencoder_config.yml index cd874fa21..b048f4a09 100644 --- a/minerva/inbuilt_cfgs/example_autoencoder_config.yml +++ b/minerva/inbuilt_cfgs/example_autoencoder_config.yml @@ -39,9 +39,9 @@ fine_tune: false # Activate fine-tuning mode. autoencoder_data_key: mask # ---+ Loss and Optimisers +--------------------------------------------------- -loss_func: CrossEntropyLoss # Name of the loss function to use. -lr: 1.0E-3 # Learning rate of optimiser. -optim_func: SGD # Name of the optimiser function. +loss_func: &loss_func CrossEntropyLoss # Name of the loss function to use. +lr: 1.0E-3 # Learning rate of optimiser. +optim_func: SGD # Name of the optimiser function. # ---+ Model Parameters +------------------------------------------------------ model_params: @@ -58,6 +58,7 @@ optim_params: # ---+ Loss Function Parameters +---------------------------------------------- loss_params: + name: *loss_func params: # ---+ Dataloader Parameters +------------------------------------------------- @@ -72,8 +73,9 @@ wandb_dir: /test/tmp/wandb # Directory to store wandb logs locally. # === MODEL IO & LOGGING ====================================================== # ---+ Minerva Inbuilt Logging Functions +------------------------------------- -logger: STGLogger -metrics: SPMetrics +task_logger: SupervisedTaskLogger +step_logger: + name: SupervisedGeoStepLogger model_io: autoencoder_io record_int: true # Store integer results in memory. @@ -84,91 +86,106 @@ collator: module: torchgeo.datasets name: stack_samples -# === DATASET PARAMETERS ====================================================== -dataset_params: - # Training Dataset - train: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 32 - - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Validation Dataset - val: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 16 - - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Test Dataset - test: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 16 - - image: - transforms: - Normalise: - module: minerva.transforms - norm_value: 255 - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 +# === TASKS =================================================================== +tasks: + fit-train: + type: StandardEpoch + train: true + record_float: true + + # ---+ Dataset Parameters +-------------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 36 + + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + fit-val: + type: StandardEpoch + train: true + record_float: true + + # ---+ Dataset Parameters +-------------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 18 + + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + test-test: + type: StandardEpoch + train: true + record_float: true + + # ---+ Dataset Parameters +-------------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 18 + + image: + transforms: + Normalise: + module: minerva.transforms + norm_value: 255 + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 # === PLOTTING OPTIONS ======================================================== plots: diff --git a/minerva/inbuilt_cfgs/example_config.yml b/minerva/inbuilt_cfgs/example_config.yml index bb32d907d..ccbb45c29 100644 --- a/minerva/inbuilt_cfgs/example_config.yml +++ b/minerva/inbuilt_cfgs/example_config.yml @@ -34,11 +34,10 @@ n_classes: &n_classes 8 # Number of classes in dataset. max_epochs: 5 # Maximum number of training epochs. pre_train: false # Activate pre-training mode. fine_tune: false # Activate fine-tuning mode. -elim: true # Eliminates empty classes from schema. -balance: true # Balances dataset classes. +elim: false # Eliminates empty classes from schema. +balance: false # Balances dataset classes. -# ---+ Loss and Optimisers +--------------------------------------------------- -loss_func: CrossEntropyLoss # Name of the loss function to use. +# ---+ Optimisers +--------------------------------------------------- lr: 1.0E-2 # Learning rate of optimiser. optim_func: SGD # Name of the optimiser function. @@ -56,6 +55,7 @@ optim_params: # ---+ Loss Function Parameters +---------------------------------------------- loss_params: + name: CrossEntropyLoss # Name of the loss function to use. params: # ---+ Dataloader Parameters +------------------------------------------------- @@ -69,106 +69,124 @@ wandb_log: true # Activates wandb logging. project: pytest # Define the project name for wandb. wandb_dir: /test/tmp/wandb # Directory to store wandb logs locally. -# ---+ Minerva Inbuilt Logging Functions +------------------------------------- -logger: STGLogger -metrics: SPMetrics -model_io: sup_tg - -record_int: true # Store integer results in memory. -record_float: true # Store floating point results too. Beware memory overload! - # ---+ Collator +-------------------------------------------------------------- collator: module: torchgeo.datasets name: stack_samples -# === DATASET PARAMETERS ====================================================== -dataset_params: - # Training Dataset - train: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 120 - - image: - transforms: false - images_1: +# === TASKS =================================================================== +tasks: + fit-train: + type: StandardEpoch + train: true + record_float: true + # ---+ Minerva Inbuilt Logging Functions +------------------------- + # logger: STGLogger + # metrics: SPMetrics + # model_io: sup_tg + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 120 + + image: + transforms: false + images_1: + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + image2: + module: minerva.datasets.__testing + name: TstImgDataset + paths: NAIP + params: + res: 1.0 + + mask: + transforms: false + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + fit-val: + type: StandardEpoch + train: false + record_float: true + # ---+ Minerva Inbuilt Logging Functions +------------------------- + # logger: STGLogger + # metrics: SPMetrics + # model_io: sup_tg + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 32 + + image: + transforms: false module: minerva.datasets.__testing name: TstImgDataset paths: NAIP params: res: 1.0 - image2: + mask: + transforms: false + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 + + test-test: + type: StandardEpoch + record_float: true + # ---+ Minerva Inbuilt Logging Functions +------------------------- + # logger: STGLogger + # metrics: SPMetrics + # model_io: sup_tg + + # ---+ Dataset Parameters +---------------------------------------- + dataset_params: + sampler: + module: torchgeo.samplers + name: RandomGeoSampler + roi: false + params: + size: *patch_size + length: 32 + + image: + transforms: false module: minerva.datasets.__testing name: TstImgDataset paths: NAIP params: res: 1.0 - mask: - transforms: false - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Validation Dataset - val: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 32 - - image: - transforms: false - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - transforms: false - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - # Test Dataset - test: - sampler: - module: torchgeo.samplers - name: RandomGeoSampler - roi: false - params: - size: *patch_size - length: 32 - - image: - transforms: false - module: minerva.datasets.__testing - name: TstImgDataset - paths: NAIP - params: - res: 1.0 - - mask: - transforms: false - module: minerva.datasets.__testing - name: TstMaskDataset - paths: Chesapeake7 - params: - res: 1.0 + mask: + transforms: false + module: minerva.datasets.__testing + name: TstMaskDataset + paths: Chesapeake7 + params: + res: 1.0 # === PLOTTING OPTIONS ======================================================== plots: diff --git a/minerva/inbuilt_cfgs/exp_mf_config.yml b/minerva/inbuilt_cfgs/exp_mf_config.yml index 0e9cbdb6f..b31556360 100644 --- a/minerva/inbuilt_cfgs/exp_mf_config.yml +++ b/minerva/inbuilt_cfgs/exp_mf_config.yml @@ -3,43 +3,34 @@ # === PATHS =================================================================== dir: - data: - - tests - - fixtures - - data + data: tests/fixtures/data configs: data_config: minerva/inbuilt_cfgs/Chesapeake7.yml - output: - - tests - - tmp - - cache + output: tests/tmp/cache # === DATASET PARAMETERS ====================================================== -dataset_params: - make: - image: - module: minerva.datasets.__testing - name: TestImgDataset - paths: NAIP - params: - res: 1.0 - mask: - module: minerva.datasets.__testing - name: TestMaskDataset - paths: Chesapeake7 - params: - res: 1.0 - - -# === SAMPLER PARAMETERS ====================================================== -sampler_params: - make: - module: torchgeo.samplers - name: GridGeoSampler - params: - size: [1000, 1000] - stride: [1000, 1000] - +tasks: + manifest: + dataset_params: + sampler: + module: torchgeo.samplers + name: GridGeoSampler + params: + size: [1000, 1000] + stride: [1000, 1000] + image: + module: minerva.datasets.__testing + name: TestImgDataset + paths: NAIP + params: + res: 1.0 + mask: + module: minerva.datasets.__testing + name: TestMaskDataset + paths: Chesapeake7 + params: + res: 1.0 +# Collator collator: module: torchgeo.datasets name: stack_samples diff --git a/minerva/logger/__init__.py b/minerva/logger/__init__.py new file mode 100644 index 000000000..77ad10852 --- /dev/null +++ b/minerva/logger/__init__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +""":mod:`minerva.logger` contains functionality for logging and analysing results within :mod:`minerva`""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" +__all__ = [ + "MinervaTaskLogger", + "SSLTaskLogger", + "SupervisedTaskLogger", + "MinervaStepLogger", + "SupervisedGeoStepLogger", + "SSLStepLogger", + "KNNStepLogger", +] + +from .steplog import ( + KNNStepLogger, + MinervaStepLogger, + SSLStepLogger, + SupervisedGeoStepLogger, +) +from .tasklog import MinervaTaskLogger, SSLTaskLogger, SupervisedTaskLogger diff --git a/minerva/logger.py b/minerva/logger/steplog.py similarity index 83% rename from minerva/logger.py rename to minerva/logger/steplog.py index 7d6a53055..c3d81db30 100644 --- a/minerva/logger.py +++ b/minerva/logger/steplog.py @@ -23,7 +23,7 @@ # # @org: University of Southampton # Created under a project funded by the Ordnance Survey Ltd. -"""Module to handle the logging of results from various model types.""" +"""Loggers to handle the logging from each step of a task.""" # ===================================================================================================================== # METADATA # ===================================================================================================================== @@ -34,10 +34,11 @@ __license__ = "MIT License" __copyright__ = "Copyright (C) 2023 Harry Baker" __all__ = [ - "MinervaLogger", - "STGLogger", - "SSLLogger", - "KNNLogger", + "MinervaStepLogger", + "SupervisedGeoStepLogger", + "SSLStepLogger", + "KNNStepLogger", + "get_logger", ] # ===================================================================================================================== @@ -60,16 +61,21 @@ import mlflow import numpy as np import torch +import torch.distributed as dist from sklearn.metrics import jaccard_score from torch import Tensor +from torchmetrics.regression import CosineSimilarity if TYPE_CHECKING: # pragma: no cover from torch.utils.tensorboard.writer import SummaryWriter +else: # pragma: no cover + SummaryWriter = None from torchgeo.datasets.utils import BoundingBox from wandb.sdk.wandb_run import Run from minerva.utils import utils +from minerva.utils.utils import check_substrings_in_string, func_by_str # ===================================================================================================================== # GLOBALS @@ -91,8 +97,8 @@ # ===================================================================================================================== # CLASSES # ===================================================================================================================== -class MinervaLogger(ABC): - """Base abstract class for all :mod:`minerva` logger classes to ensure intercompatibility with +class MinervaStepLogger(ABC): + """Base abstract class for all :mod:`minerva` step logger classes to ensure intercompatibility with :class:`~trainer.Trainer`. Attributes: @@ -115,48 +121,59 @@ class MinervaLogger(ABC): Defaults to ``False``. writer (~torch.utils.tensorboard.writer.SummaryWriter | ~wandb.sdk.wandb_run.Run): Optional; Writer object from :mod:`tensorboard`, a :mod:`wandb` :class:`~wandb.sdk.wandb_run.Run` object or ``None``. + + .. versionadded:: 0.27 """ __metaclass__ = abc.ABCMeta def __init__( self, + task_name: str, n_batches: int, batch_size: int, - n_samples: int, + output_size: Tuple[int, int], record_int: bool = True, record_float: bool = False, writer: Optional[Union[SummaryWriter, Run]] = None, + model_type: str = "", **kwargs, ) -> None: - super(MinervaLogger, self).__init__() + super(MinervaStepLogger, self).__init__() self.record_int = record_int self.record_float = record_float self.n_batches = n_batches + self.output_size = output_size self.batch_size = batch_size - self.n_samples = n_samples + + if dist.is_available() and dist.is_initialized(): # type: ignore[attr-defined] # pragma: no cover + self.batch_size = batch_size // dist.get_world_size() # type: ignore[attr-defined] + + self.n_samples = self.batch_size * self.n_batches + + self.task_name = task_name self.writer = writer + self.model_type = model_type + self.logs: Dict[str, Any] = {} self.results: Dict[str, Any] = {} - def __call__(self, mode: str, step_num: int, loss: Tensor, *args) -> None: + def __call__(self, step_num: int, loss: Tensor, *args) -> None: """Call :meth:`log`. Args: - mode (str): Mode of model fitting. step_num (int): The global step number of for the mode of model fitting. loss (~torch.Tensor): Loss from this step of model fitting. Returns: None """ - self.log(mode, step_num, loss, *args) + self.log(step_num, loss, *args) @abc.abstractmethod def log( self, - mode: str, step_num: int, loss: Tensor, z: Optional[Tensor] = None, @@ -168,7 +185,6 @@ def log( """Abstract logging method, the core functionality of a logger. Must be overwritten. Args: - mode (str): Mode of model fitting. step_num (int): The global step number of for the mode of model fitting. loss (~torch.Tensor): Loss from this step of model fitting. z (~torch.Tensor): Optional; Output tensor from the model. @@ -181,12 +197,11 @@ def log( pass # pragma: no cover def write_metric( - self, mode: str, key: str, value: SupportsFloat, step_num: Optional[int] = None + self, key: str, value: SupportsFloat, step_num: Optional[int] = None ): """Write metric values to logging backends after calculation. Args: - mode (str): Mode of model fitting. key (str): Key for the metric that ``value`` belongs to. value (SupportsFloat): Metric to write to logger. step_num (int): Optional; Global step number for this ``mode`` of fitting. @@ -202,12 +217,17 @@ def write_metric( and self.writer ): self.writer.add_scalar( # type: ignore[attr-defined] - tag=f"{mode}_{key}", + tag=f"{self.task_name}_{key}", scalar_value=value, # type: ignore[attr-defined] global_step=step_num, ) if isinstance(self.writer, Run): - self.writer.log({f"{mode}/step": step_num, f"{mode}/{key}": value}) + self.writer.log( + { + f"{self.task_name}/step": step_num, + f"{self.task_name}/{key}": value, + } + ) if mlflow.active_run(): # If running in Azure Machine Learning, tracking URI / experiment ID set already @@ -233,7 +253,7 @@ def get_results(self) -> Dict[str, Any]: return self.results -class STGLogger(MinervaLogger): +class SupervisedGeoStepLogger(MinervaStepLogger): """Logger designed for supervised learning using :mod:`torchgeo` datasets. Attributes: @@ -272,34 +292,35 @@ class STGLogger(MinervaLogger): MemoryError: If trying to allocate memory to hold the probabilites of predictions from the model exceeds capacity. MemoryError: If trying to allocate memory to hold the bounding boxes of samples would exceed capacity. + + .. versionadded:: 0.27 """ def __init__( self, + task_name: str, n_batches: int, batch_size: int, - n_samples: int, - out_shape: Union[int, Tuple[int, ...]], - n_classes: int, + output_size: Tuple[int, int], record_int: bool = True, record_float: bool = False, writer: Optional[Union[SummaryWriter, Run]] = None, + model_type: str = "", + n_classes: Optional[int] = None, **kwargs, ) -> None: - super(STGLogger, self).__init__( + super(SupervisedGeoStepLogger, self).__init__( + task_name, n_batches, batch_size, - n_samples, + output_size, record_int, record_float, writer, + model_type, ) - _out_shape: Tuple[int, ...] - - if isinstance(out_shape, int): - _out_shape = (out_shape,) - else: - _out_shape = out_shape + if n_classes is None: + raise ValueError("`n_classes` must be specified for this type of logger!") self.logs: Dict[str, Any] = { "batch_num": 0, @@ -314,7 +335,11 @@ def __init__( "ids": [], "bounds": None, } - self.calc_miou = True if kwargs.get("model_type") == "segmentation" else False + self.calc_miou = ( + True + if check_substrings_in_string(self.model_type, "segmentation") + else False + ) if self.calc_miou: self.logs["total_miou"] = 0.0 @@ -322,10 +347,10 @@ def __init__( # Allocate memory for the integer values to be recorded. if self.record_int: int_log_shape: Tuple[int, ...] - if kwargs.get("model_type") == "scene classifier": + if check_substrings_in_string(self.model_type, "scene classifier"): int_log_shape = (self.n_batches, self.batch_size) else: - int_log_shape = (self.n_batches, self.batch_size, *_out_shape) + int_log_shape = (self.n_batches, self.batch_size, *self.output_size) self.results["z"] = np.empty(int_log_shape, dtype=np.uint8) self.results["y"] = np.empty(int_log_shape, dtype=np.uint8) @@ -333,14 +358,14 @@ def __init__( # Allocate memory for the floating point values to be recorded. if self.record_float: float_log_shape: Tuple[int, ...] - if kwargs.get("model_type") == "scene classifier": + if check_substrings_in_string(self.model_type, "scene classifier"): float_log_shape = (self.n_batches, self.batch_size, n_classes) else: float_log_shape = ( self.n_batches, self.batch_size, n_classes, - *_out_shape, + *self.output_size, ) try: @@ -361,7 +386,6 @@ def __init__( def log( self, - mode: str, step_num: int, loss: Tensor, z: Optional[Tensor] = None, @@ -373,7 +397,6 @@ def log( """Logs the outputs and results from a step of model fitting. Overwrites abstract method. Args: - mode (str): Mode of model fitting. step_num (int): The global step number of for the mode of model fitting. loss (~torch.Tensor): Loss from this step of model fitting. z (~torch.Tensor): Output tensor from the model. @@ -428,19 +451,17 @@ def log( ) # noqa: E501 type: ignore[attr-defined] self.logs["total_miou"] += miou - self.write_metric(mode, "miou", miou / len(y), step_num=step_num) + self.write_metric("miou", miou / len(y), step_num=step_num) # Writes loss and correct predictions to the writer. - self.write_metric(mode, "loss", ls, step_num=step_num) - self.write_metric( - mode, "acc", correct / len(torch.flatten(y)), step_num=step_num - ) + self.write_metric("loss", ls, step_num=step_num) + self.write_metric("acc", correct / len(torch.flatten(y)), step_num=step_num) # Adds 1 to batch number (step number). self.logs["batch_num"] += 1 -class KNNLogger(MinervaLogger): +class KNNStepLogger(MinervaStepLogger): """Logger specifically designed for use with the KNN validation in :meth:`trainer.Trainer.weighted_knn_validation`. @@ -470,20 +491,30 @@ class KNNLogger(MinervaLogger): Defaults to ``False``. writer (~torch.utils.tensorboard.writer.SummaryWriter | ~wandb.sdk.wand_run.Run): Optional; Writer object from :mod:`tensorboard`, a :mod:`wandb` :class:`~wandb.sdk.wandb_run.Run` object or ``None``. + + .. versionadded:: 0.27 """ def __init__( self, + task_name: str, n_batches: int, batch_size: int, - n_samples: int, record_int: bool = True, record_float: bool = False, writer: Optional[Union[SummaryWriter, Run]] = None, + model_type: str = "", **kwargs, ) -> None: super().__init__( - n_batches, batch_size, n_samples, record_int, record_float, writer, **kwargs + task_name, + n_batches, + batch_size, + record_int=record_int, + record_float=record_float, + writer=writer, + model_type=model_type, + **kwargs, ) self.logs: Dict[str, Any] = { @@ -503,7 +534,6 @@ def __init__( def log( self, - mode: str, step_num: int, loss: Tensor, z: Optional[Tensor] = None, @@ -530,15 +560,15 @@ def log( self.logs["total_top5"] += top5 # Write results to the writer. - self.write_metric(mode, "loss", loss, step_num) - self.write_metric(mode, "acc", top1, step_num) - self.write_metric(mode, "top5", top5, step_num) + self.write_metric("loss", loss, step_num) + self.write_metric("acc", top1, step_num) + self.write_metric("top5", top5, step_num) # Adds 1 to batch number (step number). self.logs["batch_num"] += 1 -class SSLLogger(MinervaLogger): +class SSLStepLogger(MinervaStepLogger): """Logger designed for self-supervised learning. Attributes: @@ -568,27 +598,32 @@ class SSLLogger(MinervaLogger): Defaults to ``False``. writer (~torch.utils.tensorboard.writer.SummaryWriter | ~wandb.sdk.wand_run.Run): Optional; Writer object from :mod:`tensorboard`, a :mod:`wandb` :class:`~wandb.sdk.wandb_run.Run` object or ``None``. + + .. versionadded:: 0.27 """ def __init__( self, + task_name: str, n_batches: int, batch_size: int, - n_samples: int, - out_shape: Optional[Tuple[int, ...]] = None, - n_classes: Optional[int] = None, + output_size: Tuple[int, int], record_int: bool = True, record_float: bool = False, writer: Optional[Union[SummaryWriter, Run]] = None, + model_type: str = "", **kwargs, ) -> None: - super(SSLLogger, self).__init__( + super(SSLStepLogger, self).__init__( + task_name, n_batches, batch_size, - n_samples, - record_int, + output_size, + record_int=record_int, record_float=record_float, writer=writer, + model_type=model_type, + **kwargs, ) self.logs: Dict[str, Any] = { @@ -603,8 +638,6 @@ def __init__( self.collapse_level = kwargs.get("collapse_level", False) self.euclidean = kwargs.get("euclidean", False) - self.model_type = kwargs.get("model_type", "") - if self.collapse_level: self.logs["collapse_level"] = 0 if self.euclidean: @@ -612,7 +645,6 @@ def __init__( def log( self, - mode: str, step_num: int, loss: Tensor, z: Optional[Tensor] = None, @@ -624,7 +656,6 @@ def log( """Logs the outputs and results from a step of model fitting. Overwrites abstract method. Args: - mode (str): Mode of model fitting. step_num (int): The global step number of for the mode of model fitting. loss (~torch.Tensor): Loss from this step of model fitting. z (~torch.Tensor): Optional; Output tensor from the model. @@ -633,7 +664,7 @@ def log( """ assert z is not None - if "segmentation" in self.model_type: + if check_substrings_in_string(self.model_type, "segmentation"): z = z.flatten(1, -1) # Adds the loss for this step to the logs. @@ -641,7 +672,8 @@ def log( self.logs["total_loss"] += ls # Compute the TOP1 and TOP5 accuracies. - sim_argsort = utils.calc_contrastive_acc(z) + cosine_sim = CosineSimilarity(reduction=None) + sim_argsort = cosine_sim(*torch.split(z, int(0.5 * len(z)), 0)) correct = float((sim_argsort == 0).float().mean().cpu().numpy()) top5 = float((sim_argsort < 5).float().mean().cpu().numpy()) @@ -658,7 +690,7 @@ def log( ) euc_dist = sum(euc_dists) / len(euc_dists) - self.write_metric(mode, "euc_dist", euc_dist, step_num) + self.write_metric("euc_dist", euc_dist, step_num) self.logs["euc_dist"] += euc_dist if self.collapse_level: @@ -683,7 +715,7 @@ def log( 0.0, 1 - math.sqrt(len(output)) * self.logs["avg_output_std"] ) - self.write_metric(mode, "collapse_level", collapse_level, step_num) + self.write_metric("collapse_level", collapse_level, step_num) self.logs["collapse_level"] = collapse_level @@ -692,9 +724,25 @@ def log( self.logs["total_top5"] += top5 # Writes the loss to the writer. - self.write_metric(mode, "loss", ls, step_num=step_num) - self.write_metric(mode, "acc", correct / 2 * len(z[0]), step_num) - self.write_metric(mode, "top5_acc", top5 / 2 * len(z[0]), step_num) + self.write_metric("loss", ls, step_num=step_num) + self.write_metric("acc", correct / 2 * len(z[0]), step_num) + self.write_metric("top5_acc", top5 / 2 * len(z[0]), step_num) # Adds 1 to the batch number (step number). self.logs["batch_num"] += 1 + + +# ===================================================================================================================== +# METHODS +# ===================================================================================================================== +def get_logger(name) -> Callable[..., Any]: + """Gets the constructor for a step logger to log the results from each step of model fitting during an epoch. + + Returns: + ~typing.Callable[..., ~typing.Any]: The constructor of :class:`~logging.step.log.MinervaStepLogger` + to be intialised within the epoch. + + .. versionadded:: 0.27 + """ + logger: Callable[..., Any] = func_by_str("minerva.logger.steplog", name) + return logger diff --git a/minerva/logger/tasklog.py b/minerva/logger/tasklog.py new file mode 100644 index 000000000..dc5804e01 --- /dev/null +++ b/minerva/logger/tasklog.py @@ -0,0 +1,513 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +"""These loggers are designed to handle the logging and analysis for a whole task.""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" +__all__ = [ + "MinervaTaskLogger", + "SupervisedTaskLogger", + "SSLTaskLogger", +] + +# ===================================================================================================================== +# IMPORTS +# ===================================================================================================================== +import abc +from abc import ABC +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union + +if TYPE_CHECKING: # pragma: no cover + from torch.utils.tensorboard.writer import SummaryWriter +else: # pragma: no cover + SummaryWriter = None + +import numpy as np +from torch import Tensor +from torchgeo.datasets.utils import BoundingBox +from wandb.sdk.wandb_run import Run + +from minerva.utils.utils import check_substrings_in_string + +from .steplog import MinervaStepLogger, get_logger + + +# ===================================================================================================================== +# CLASSES +# ===================================================================================================================== +class MinervaTaskLogger(ABC): + """Abstract class for metric logging within the :mod:`minerva` framework. + + Attributes: + n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. + batch_size (int): Batch size. + output_size (tuple[int, int]): Shape of the output data in ``H x W``. + metrics (dict[str, ~typing.Any]): Dictionary to hold the metrics to assess the model with + for each mode of fitting. + model_type (str): Type of the model. + + Args: + n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. + batch_size (int): Batch size. + data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. + logger_params (dict[str, ~typing.Any]): Optional; Parameters for a logger + other than the default for these metrics. + + .. versionadded:: 0.27 + """ + + __metaclass__ = abc.ABCMeta + + metric_types: List[str] = [] + special_metric_types: List[str] = [] + logger_cls: str + + def __init__( + self, + task_name: str, + n_batches: int, + batch_size: int, + output_size: Tuple[int, ...], + step_logger_params: Optional[Dict[str, Any]] = None, + record_int: bool = True, + record_float: bool = False, + writer: Optional[Union[SummaryWriter, Run]] = None, + **params, + ) -> None: + super(MinervaTaskLogger, self).__init__() + + self.n_batches = n_batches + self.batch_size = batch_size + self.n_samples = self.n_batches * self.batch_size + + self.output_size = output_size + self.task_name = task_name + + self.record_int = record_int + self.record_float = record_float + + self.model_type = params.get("model_type", "scene_classifier") + self.sample_pairs = params.get("sample_pairs", False) + self.n_classes = params.get("n_classes") + + self.writer = writer + + if isinstance(step_logger_params, dict): + self._logger = get_logger(step_logger_params.get("name", self.logger_cls)) + if "params" not in step_logger_params: + step_logger_params["params"] = {} + + else: + step_logger_params = {"params": {}} + + step_logger_params["params"]["n_classes"] = self.n_classes + + self.step_logger_params = step_logger_params + + self._make_logger() + + if self.sample_pairs: + self.metric_types += self.special_metric_types + + # Creates a dict to hold the loss and accuracy results from training, validation and testing. + self.metrics: Dict[str, Any] = {} + for metric in self.metric_types: + self.metrics[f"{self.task_name}_{metric}"] = {"x": [], "y": []} + + def _make_logger(self) -> None: + """Builds and sets the logger. + + .. note:: + Will overwrite ``self.logger`` with new logger. + """ + self.step_logger: MinervaStepLogger = self._logger( + task_name=self.task_name, + n_batches=self.n_batches, + batch_size=self.batch_size, + output_size=self.output_size, + record_int=self.record_int, + record_float=self.record_float, + writer=self.writer, + model_type=self.model_type, + **self.step_logger_params.get("params", {}), + ) + + def refresh_step_logger(self) -> None: + self._make_logger() + + def step( + self, + step_num: int, + loss: Tensor, + z: Optional[Tensor] = None, + y: Optional[Tensor] = None, + bbox: Optional[BoundingBox] = None, + *args, + **kwargs, + ) -> None: + """Abstract method to log a step, using the logger. Must be overwritten. + + Args: + step_num (int): The global step number of for the mode of model fitting. + loss (~torch.Tensor): Loss from this step of model fitting. + z (~torch.Tensor): Optional; Output tensor from the model. + y (~torch.Tensor): Optional; Labels to assess model output against. + bbox (~torchgeo.datasets.utils.BoundingBox): Optional; Bounding boxes of the input samples. + + Returns: + None + """ + self.step_logger.log( + step_num, + loss, + z, + y, + bbox, + *args, + **kwargs, + ) + + def calc_metrics(self, epoch_no: int) -> None: + """Updates metrics with epoch results. + + Args: + epoch_no (int): Epoch number to log. + """ + self._calc_metrics(self.step_logger.get_logs) + self.log_epoch_number(epoch_no) + + @abc.abstractmethod + def _calc_metrics(self, logs: Dict[str, Any]) -> None: + """Updates metrics with epoch results. + + Must be defined before use. + + Args: + logs (dict[str, ~typing.Any]): Logs of the results from the epoch of the task to calculate metrics from. + """ + pass # pragma: no cover + + def log_epoch_number(self, epoch_no: int) -> None: + """Logs the epoch number to ``metrics``. + + Args: + epoch_no (int): Epoch number to log. + """ + for metric in self.metrics.keys(): + self.metrics[metric]["x"].append(epoch_no) + + @property + def get_metrics(self) -> Dict[str, Any]: + """Get the ``metrics`` dictionary. + + Returns: + dict[str, ~typing.Any]: Metrics dictionary. + """ + return self.metrics + + @property + def get_logs(self) -> Dict[str, Any]: + """Get the logs of each step from the latest epoch of the task. + + Returns: + dict[str, ~typing.Any]: Logs per step of last epoch. + + .. versionadded:: 0.27 + """ + return self.step_logger.get_logs + + @property + def get_results(self) -> Dict[str, Any]: + """Get the results of each step from the latest epoch of the task. + + Returns: + dict[str, ~typing.Any]: Logs per step of last epoch. + + .. versionadded:: 0.27 + """ + return self.step_logger.get_results + + def log_null(self) -> None: + """Log :attr:`numpy.NAN` for this epoch. + + Useful for logging null when a validation epoch was skipped so that + the length of the logs remains the same as the training logs. + """ + for metric in self.metrics.keys(): + self.metrics[metric]["y"].append(np.NAN) + + def get_sub_metrics( + self, pattern: Tuple[str, ...] = ("train", "val") + ) -> Dict[str, Any]: + """Gets a subset of the metrics dictionary with keys containing strings in the pattern. + + Useful for getting the train and validation metrics for plotting for example. + + Args: + pattern (tuple[str, ...]): Optional; Strings to pattern match the metric keys to be returned. + Defaults to ``("train", "val")``. + + Returns: + dict[str, ~typing.Any]: Subset of ``metrics`` with keys that contained strings in ``pattern``. + """ + sub_metrics = {} + for key in self.metrics.keys(): + if key.split("_")[0] in pattern: + sub_metrics[key] = self.metrics[key] + + return sub_metrics + + @abc.abstractmethod + def print_epoch_results(self, epoch_no: int) -> None: + """Prints the results from an epoch to ``stdout``. + + Args: + epoch_no (int): Epoch number to print results from. + """ + pass # pragma: no cover + + +class SupervisedTaskLogger(MinervaTaskLogger): + """Metric logging for supervised models. + + Attributes: + n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. + batch_size (int): Batch size. + data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. + metrics (dict[str, ~typing.Any]): Dictionary to hold the metrics to assess the model with + for each mode of fitting. + model_type (str): Type of the model. + + Args: + n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. + batch_size (int): Batch size. + data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. + model_type (str): Optional; Type of the model. + + .. versionadded:: 0.27 + """ + + metric_types: List[str] = ["loss", "acc", "miou"] + logger_cls = "SupervisedGeoStepLogger" + + def __init__( + self, + task_name: str, + n_batches: int, + batch_size: int, + output_size: Tuple[int, ...], + step_logger_params: Optional[Dict[str, Any]] = None, + record_int: bool = True, + record_float: bool = False, + writer: Optional[Union[SummaryWriter, Run]] = None, + model_type: str = "segmentation", + **params, + ) -> None: + super(SupervisedTaskLogger, self).__init__( + task_name, + n_batches, + batch_size, + output_size, + step_logger_params, + record_int, + record_float, + writer, + model_type=model_type, + **params, + ) + + def _calc_metrics(self, logs: Dict[str, Any]) -> None: + """Updates metrics with epoch results. + + Args: + logs (dict[str, ~typing.Any]): Logs of the results from the epoch of fitting to calculate metrics from. + """ + self.metrics[f"{self.task_name}_loss"]["y"].append( + logs["total_loss"] / self.n_batches + ) + + if self.model_type == "segmentation": + self.metrics[f"{self.task_name}_acc"]["y"].append( + logs["total_correct"] + / (self.n_batches * self.batch_size * np.prod(self.output_size)) + ) + if logs.get("total_miou") is not None: + self.metrics[f"{self.task_name}_miou"]["y"].append( + logs["total_miou"] / self.n_samples + ) + + else: + self.metrics[f"{self.task_name}_acc"]["y"].append( + logs["total_correct"] / self.n_samples + ) + + def print_epoch_results(self, epoch_no: int) -> None: + """Prints the results from an epoch to ``stdout``. + + Args: + epoch_no (int): Epoch number to print results from. + """ + msg = "{} | Loss: {} | Accuracy: {}%".format( + self.task_name, + self.metrics[f"{self.task_name}_loss"]["y"][epoch_no], + self.metrics[f"{self.task_name}_acc"]["y"][epoch_no] * 100.0, + ) + + if self.model_type == "segmentation": + msg += " | mIoU: {}".format( + self.metrics[f"{self.task_name}_miou"]["y"][epoch_no] + ) + + msg += "\n" + print(msg) + + +class SSLTaskLogger(MinervaTaskLogger): + """Metric logging for self-supervised models. + + Attributes: + n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. + batch_size (int): Batch size. + data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. + metrics (dict[str, ~typing.Any]): Dictionary to hold the metrics to assess the model with + for each mode of fitting. + model_type (str): Type of the model. + + Args: + n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. + batch_size (int): Batch size. + data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. + model_type (str): Optional; Type of the model. + + .. versionadded:: 0.27 + """ + + metric_types = ["loss", "acc", "top5_acc"] + special_metric_types = ["collapse_level", "euc_dist"] + logger_cls = "SSLStepLogger" + + def __init__( + self, + task_name: str, + n_batches: int, + batch_size: int, + output_size: Tuple[int, ...], + step_logger_params: Optional[Dict[str, Any]] = None, + record_int: bool = True, + record_float: bool = False, + writer: Optional[Union[SummaryWriter, Run]] = None, + model_type: str = "segmentation", + sample_pairs: bool = False, + **params, + ) -> None: + if not step_logger_params: + step_logger_params = {} + if "params" not in step_logger_params: + step_logger_params["params"] = {} + + step_logger_params["params"]["sample_pairs"] = sample_pairs + step_logger_params["params"]["collapse_level"] = sample_pairs + step_logger_params["params"]["euclidean"] = sample_pairs + + super(SSLTaskLogger, self).__init__( + task_name, + n_batches, + batch_size, + output_size, + step_logger_params, + record_int, + record_float, + writer, + model_type=model_type, + sample_pairs=sample_pairs, + **params, + ) + + def _calc_metrics(self, logs: Dict[str, Any]) -> None: + """Updates metrics with epoch results. + + Args: + logs (dict[str, ~typing.Any]): Logs of the results from the epoch of fitting to calculate metrics from. + """ + self.metrics[f"{self.task_name}_loss"]["y"].append( + logs["total_loss"] / self.n_batches + ) + + if check_substrings_in_string(self.model_type, "segmentation"): + self.metrics[f"{self.task_name}_acc"]["y"].append( + logs["total_correct"] + / (self.n_batches * self.batch_size * np.prod(self.output_size)) + ) + self.metrics[f"{self.task_name}_top5_acc"]["y"].append( + logs["total_top5"] + / (self.n_batches * self.batch_size * np.prod(self.output_size)) + ) + + else: + self.metrics[f"{self.task_name}_acc"]["y"].append( + logs["total_correct"] / self.n_samples + ) + self.metrics[f"{self.task_name}_top5_acc"]["y"].append( + logs["total_top5"] / self.n_samples + ) + + if self.sample_pairs: + self.metrics[f"{self.task_name}_collapse_level"]["y"].append( + logs["collapse_level"] + ) + self.metrics[f"{self.task_name}_euc_dist"]["y"].append( + logs["euc_dist"] / self.n_batches + ) + + def print_epoch_results(self, epoch_no: int) -> None: + """Prints the results from an epoch to ``stdout``. + + Args: + epoch_no (int): Epoch number to print results from. + """ + msg = "{} | Loss: {} | Accuracy: {}% | Top5 Accuracy: {}% ".format( + self.task_name, + self.metrics[f"{self.task_name}_loss"]["y"][epoch_no], + self.metrics[f"{self.task_name}_acc"]["y"][epoch_no] * 100.0, + self.metrics[f"{self.task_name}_top5_acc"]["y"][epoch_no] * 100.0, + ) + + if self.sample_pairs: + msg += "\n" + + msg += "| Collapse Level: {}%".format( + self.metrics[f"{self.task_name}_collapse_level"]["y"][epoch_no] * 100.0 + ) + msg += "| Avg. Euclidean Distance: {}".format( + self.metrics[f"{self.task_name}_euc_dist"]["y"][epoch_no] + ) + + msg += "\n" + print(msg) diff --git a/minerva/metrics.py b/minerva/metrics.py deleted file mode 100644 index 86342e202..000000000 --- a/minerva/metrics.py +++ /dev/null @@ -1,382 +0,0 @@ -# -*- coding: utf-8 -*- -# MIT License - -# Copyright (c) 2023 Harry Baker - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# @org: University of Southampton -# Created under a project funded by the Ordnance Survey Ltd. -"""Module to calculate the metrics of a model's fitting.""" -# ===================================================================================================================== -# METADATA -# ===================================================================================================================== -__author__ = "Harry Baker" -__contact__ = "hjb1d20@soton.ac.uk" -__license__ = "MIT License" -__copyright__ = "Copyright (C) 2023 Harry Baker" -__all__ = [ - "MinervaMetrics", - "SPMetrics", - "SSLMetrics", -] - -# ===================================================================================================================== -# IMPORTS -# ===================================================================================================================== -import abc -from abc import ABC -from typing import Any, Dict, List, Tuple - - -# ===================================================================================================================== -# CLASSES -# ===================================================================================================================== -class MinervaMetrics(ABC): - """Abstract class for metric logging within the :mod:`minerva` framework. - - Attributes: - n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. - batch_size (int): Batch size. - data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. - metrics (dict[str, ~typing.Any]): Dictionary to hold the metrics to assess the model with - for each mode of fitting. - model_type (str): Type of the model. - - Args: - n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. - batch_size (int): Batch size. - data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. - - """ - - __metaclass__ = abc.ABCMeta - - metric_types: List[str] = [] - special_metric_types: List[str] = [] - - def __init__( - self, - n_batches: Dict[str, int], - batch_size: int, - data_size: Tuple[int, int, int], - **params, - ) -> None: - super(MinervaMetrics, self).__init__() - - self.n_batches = n_batches - self.batch_size = batch_size - self.data_size = data_size - - self.model_type = params.get("model_type", "scene_classifier") - self.sample_pairs = params.get("sample_pairs", False) - - self.modes = params.get("modes", ["train", "val", "test"]) - - if self.sample_pairs: - self.metric_types += self.special_metric_types - - # Creates a dict to hold the loss and accuracy results from training, validation and testing. - self.metrics: Dict[str, Any] = {} - for mode in self.modes: - for metric in self.metric_types: - self.metrics[f"{mode}_{metric}"] = {"x": [], "y": []} - - def __call__(self, mode: str, logs: Dict[str, Any]) -> None: - self.calc_metrics(mode, logs) - - @abc.abstractmethod - def calc_metrics(self, mode: str, logs: Dict[str, Any]) -> None: - """Updates metrics with epoch results. - - Args: - mode (str): Mode of model fitting. - logs (dict[str, ~typing.Any]): Logs of the results from the epoch of fitting to calculate metrics from. - """ - pass # pragma: no cover - - @abc.abstractmethod - def log_epoch_number(self, mode: str, epoch_no: int) -> None: - """Logs the epoch number to ``metrics``. - - Args: - mode (str): Mode of model fitting. - epoch_no (int): Epoch number to log. - """ - pass # pragma: no cover - - @property - def get_metrics(self) -> Dict[str, Any]: - """Get the ``metrics`` dictionary. - - Returns: - dict[str, Any]: Metrics dictionary. - """ - return self.metrics - - def get_sub_metrics( - self, pattern: Tuple[str, ...] = ("train", "val") - ) -> Dict[str, Any]: - """Gets a subset of the metrics dictionary with keys containing strings in the pattern. - - Useful for getting the train and validation metrics for plotting for example. - - Args: - pattern (tuple[str, ...]): Optional; Strings to pattern match the metric keys to be returned. - Defaults to ``("train", "val")``. - - Returns: - dict[str, ~typing.Any]: Subset of ``metrics`` with keys that contained strings in ``pattern``. - """ - sub_metrics = {} - for key in self.metrics.keys(): - if key.split("_")[0] in pattern: - sub_metrics[key] = self.metrics[key] - - return sub_metrics - - @abc.abstractmethod - def print_epoch_results(self, mode: str, epoch_no: int) -> None: - """Prints the results from an epoch to ``stdout``. - - Args: - mode (str): Mode of fitting to print results from. - epoch_no (int): Epoch number to print results from. - """ - pass # pragma: no cover - - -class SPMetrics(MinervaMetrics): - """Metric logging for supervised models. - - Attributes: - n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. - batch_size (int): Batch size. - data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. - metrics (dict[str, ~typing.Any]): Dictionary to hold the metrics to assess the model with - for each mode of fitting. - model_type (str): Type of the model. - - Args: - n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. - batch_size (int): Batch size. - data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. - model_type (str): Optional; Type of the model. - """ - - metric_types: List[str] = ["loss", "acc", "miou"] - - def __init__( - self, - n_batches: Dict[str, int], - batch_size: int, - data_size: Tuple[int, int, int], - model_type: str = "segmentation", - **params, - ) -> None: - super(SPMetrics, self).__init__( - n_batches, batch_size, data_size, model_type=model_type - ) - - def calc_metrics(self, mode: str, logs: Dict[str, Any]) -> None: - """Updates metrics with epoch results. - - Args: - mode (str): Mode of model fitting. - logs (dict[str, ~typing.Any]): Logs of the results from the epoch of fitting to calculate metrics from. - """ - self.metrics[f"{mode}_loss"]["y"].append( - logs["total_loss"] / self.n_batches[mode] - ) - - if self.model_type == "segmentation": - self.metrics[f"{mode}_acc"]["y"].append( - logs["total_correct"] - / ( - self.n_batches[mode] - * self.batch_size - * self.data_size[1] - * self.data_size[2] - ) - ) - if logs.get("total_miou") is not None: - self.metrics[f"{mode}_miou"]["y"].append( - logs["total_miou"] / (self.n_batches[mode] * self.batch_size) - ) - - else: - self.metrics[f"{mode}_acc"]["y"].append( - logs["total_correct"] / (self.n_batches[mode] * self.batch_size) - ) - - def log_epoch_number(self, mode: str, epoch_no: int) -> None: - """Logs the epoch number to ``metrics``. - - Args: - mode (str): Mode of model fitting. - epoch_no (int): Epoch number to log. - """ - self.metrics[f"{mode}_loss"]["x"].append(epoch_no + 1) - self.metrics[f"{mode}_acc"]["x"].append(epoch_no + 1) - self.metrics[f"{mode}_miou"]["x"].append(epoch_no + 1) - - def print_epoch_results(self, mode: str, epoch_no: int) -> None: - """Prints the results from an epoch to ``stdout``. - - Args: - mode (str): Mode of fitting to print results from. - epoch_no (int): Epoch number to print results from. - """ - msg = "{} | Loss: {} | Accuracy: {}%".format( - mode, - self.metrics[f"{mode}_loss"]["y"][epoch_no], - self.metrics[f"{mode}_acc"]["y"][epoch_no] * 100.0, - ) - - if self.model_type == "segmentation": - msg += " | mIoU: {}".format(self.metrics[f"{mode}_miou"]["y"][epoch_no]) - - msg += "\n" - print(msg) - - -class SSLMetrics(MinervaMetrics): - """Metric logging for self-supervised models. - - Attributes: - n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. - batch_size (int): Batch size. - data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. - metrics (dict[str, ~typing.Any]): Dictionary to hold the metrics to assess the model with - for each mode of fitting. - model_type (str): Type of the model. - - Args: - n_batches (dict[str, int]): Dictionary of the number of batches in each mode of fitting. - batch_size (int): Batch size. - data_size (tuple[int, int, int]): Shape of the input data in ``C x H x W``. - model_type (str): Optional; Type of the model. - """ - - metric_types = ["loss", "acc", "top5_acc"] - special_metric_types = ["collapse_level", "euc_dist"] - - def __init__( - self, - n_batches: Dict[str, int], - batch_size: int, - data_size: Tuple[int, int, int], - model_type: str = "segmentation", - sample_pairs: bool = False, - **params, - ) -> None: - super(SSLMetrics, self).__init__( - n_batches, - batch_size, - data_size, - model_type=model_type, - sample_pairs=sample_pairs, - ) - - def calc_metrics(self, mode: str, logs) -> None: - """Updates metrics with epoch results. - - Args: - mode (str): Mode of model fitting. - logs (dict[str, ~typing.Any]): Logs of the results from the epoch of fitting to calculate metrics from. - """ - self.metrics[f"{mode}_loss"]["y"].append( - logs["total_loss"] / self.n_batches[mode] - ) - - if self.model_type == "segmentation": - self.metrics[f"{mode}_acc"]["y"].append( - logs["total_correct"] - / ( - self.n_batches[mode] - * self.batch_size - * self.data_size[1] - * self.data_size[2] - ) - ) - self.metrics[f"{mode}_top5_acc"]["y"].append( - logs["total_top5"] - / ( - self.n_batches[mode] - * self.batch_size - * self.data_size[1] - * self.data_size[2] - ) - ) - - else: - self.metrics[f"{mode}_acc"]["y"].append( - logs["total_correct"] / (self.n_batches[mode] * self.batch_size) - ) - self.metrics[f"{mode}_top5_acc"]["y"].append( - logs["total_top5"] / (self.n_batches[mode] * self.batch_size) - ) - - if self.sample_pairs and mode == "train": - self.metrics[f"{mode}_collapse_level"]["y"].append(logs["collapse_level"]) - self.metrics[f"{mode}_euc_dist"]["y"].append( - logs["euc_dist"] / self.n_batches[mode] - ) - - def log_epoch_number(self, mode: str, epoch_no: int) -> None: - """Logs the epoch number to ``metrics``. - - Args: - mode (str): Mode of model fitting. - epoch_no (int): Epoch number to log. - """ - self.metrics[f"{mode}_loss"]["x"].append(epoch_no + 1) - self.metrics[f"{mode}_acc"]["x"].append(epoch_no + 1) - self.metrics[f"{mode}_top5_acc"]["x"].append(epoch_no + 1) - - if self.sample_pairs and mode == "train": - self.metrics[f"{mode}_collapse_level"]["x"].append(epoch_no + 1) - self.metrics[f"{mode}_euc_dist"]["x"].append(epoch_no + 1) - - def print_epoch_results(self, mode: str, epoch_no: int) -> None: - """Prints the results from an epoch to ``stdout``. - - Args: - mode (str): Mode of fitting to print results from. - epoch_no (int): Epoch number to print results from. - """ - msg = "{} | Loss: {} | Accuracy: {}% | Top5 Accuracy: {}% ".format( - mode, - self.metrics[f"{mode}_loss"]["y"][epoch_no], - self.metrics[f"{mode}_acc"]["y"][epoch_no] * 100.0, - self.metrics[f"{mode}_top5_acc"]["y"][epoch_no] * 100.0, - ) - - if self.sample_pairs and mode == "train": - msg += "\n" - - msg += "| Collapse Level: {}%".format( - self.metrics[f"{mode}_collapse_level"]["y"][epoch_no] * 100.0 - ) - msg += "| Avg. Euclidean Distance: {}".format( - self.metrics[f"{mode}_euc_dist"]["y"][epoch_no] - ) - - msg += "\n" - print(msg) diff --git a/minerva/modelio.py b/minerva/modelio.py index 48bb6e512..3158005da 100644 --- a/minerva/modelio.py +++ b/minerva/modelio.py @@ -57,7 +57,7 @@ def sup_tg( batch: Dict[Any, Any], model: MinervaModel, device: torch.device, # type: ignore[name-defined] - mode: str, + train: bool, **kwargs, ) -> Tuple[Tensor, Union[Tensor, Tuple[Tensor, ...]], Tensor, Sequence[BoundingBox]]: """Provides IO functionality for a supervised model using :mod:`torchgeo` datasets. @@ -67,7 +67,7 @@ def sup_tg( Must have ``"image"``, ``"mask"`` and ``"bbox"`` keys. model (MinervaModel): Model being fitted. device (~torch.device): `torch` device object to send data to (e.g. CUDA device). - mode (str): Mode of model fitting to use. + train (bool): True to run a step of the model in training mode. False for eval mode. Returns: tuple[~torch.Tensor, ~torch.Tensor, ~torch.Tensor, ~typing.Sequence[~torchgeo.datasets.utils.BoundingBox]]: @@ -94,13 +94,8 @@ def sup_tg( x: Tensor = x_batch.to(device) y: Tensor = y_batch.to(device) - # Runs a training epoch. - if mode == "train": - loss, z = model.step(x, y, train=True) - - # Runs a validation or test epoch. - else: - loss, z = model.step(x, y, train=False) + # Runs a step of the epoch. + loss, z = model.step(x, y, train=train) bbox: Sequence[BoundingBox] = batch["bbox"] assert isinstance(bbox, Sequence) @@ -111,7 +106,7 @@ def autoencoder_io( batch: Dict[Any, Any], model: MinervaModel, device: torch.device, # type: ignore[name-defined] - mode: str, + train: bool, **kwargs, ) -> Tuple[Tensor, Union[Tensor, Tuple[Tensor, ...]], Tensor, Sequence[BoundingBox]]: """Provides IO functionality for an autoencoder using :mod:`torchgeo` datasets by only using the same data @@ -122,7 +117,7 @@ def autoencoder_io( Must have ``"image"``, ``"mask"`` and ``"bbox"`` keys. model (MinervaModel): Model being fitted. device (~torch.device): `torch` device object to send data to (e.g. CUDA device). - mode (str): Mode of model fitting to use. + train (bool): True to run a step of the model in training mode. False for eval mode. Keyword args: autoencoder_data_key (str): Key of the data type in the sample dict to use for both input and ground truth. @@ -180,13 +175,8 @@ def autoencoder_io( f"The value of {key=} is not understood. Must be either 'mask' or 'image'" ) - # Runs a training epoch. - if mode == "train": - loss, z = model.step(x, y, train=True) - - # Runs a validation or test epoch. - else: - loss, z = model.step(x, y, train=False) + # Runs a step of the epoch. + loss, z = model.step(x, y, train=train) bbox: Sequence[BoundingBox] = batch["bbox"] assert isinstance(bbox, Sequence) @@ -197,7 +187,7 @@ def ssl_pair_tg( batch: Tuple[Dict[str, Any], Dict[str, Any]], model: MinervaModel, device: torch.device, # type: ignore[name-defined] - mode: str, + train: bool, **kwargs, ) -> Tuple[Tensor, Union[Tensor, Tuple[Tensor, ...]], None, Sequence[BoundingBox]]: """Provides IO functionality for a self-supervised Siamese model using :mod:`torchgeo` datasets. @@ -207,7 +197,7 @@ def ssl_pair_tg( Must have ``"image"`` and ``"bbox"`` keys. model (MinervaModel): Model being fitted. device (~torch.device): :mod:`torch` device object to send data to (e.g. ``CUDA`` device). - mode (str): Mode of model fitting to use. + train (bool): True to run a step of the model in training mode. False for eval mode. Returns: tuple[~torch.Tensor, ~torch.Tensor, ~torch.Tensor, ~typing.Sequence[~torchgeo.datasets.utils.BoundingBox]]: The @@ -228,12 +218,7 @@ def ssl_pair_tg( # Transfer to GPU. x = x_batch.to(device, non_blocking=True) - # Runs a training epoch. - if mode == "train": - loss, z = model.step(x, train=True) - - # Runs a validation epoch. - else: - loss, z = model.step(x, train=False) + # Runs a step of the epoch. + loss, z = model.step(x, train=train) return loss, z, None, batch[0]["bbox"] + batch[1]["bbox"] diff --git a/minerva/models/__depreciated.py b/minerva/models/__depreciated.py index 1c0200582..00cc3194e 100644 --- a/minerva/models/__depreciated.py +++ b/minerva/models/__depreciated.py @@ -37,7 +37,7 @@ # IMPORTS # ===================================================================================================================== from collections import OrderedDict -from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union +from typing import Any, List, Optional, Sequence, Tuple, Union import numpy as np import torch.nn.modules as nn @@ -217,13 +217,9 @@ def __init__( # Calculate the input of the Linear layer by sending some fake data through the network # and getting the shape of the output. - out_shape = get_output_shape(self.conv_net, self.input_size) - - if type(out_shape) is int: # pragma: no cover - self.flattened_size = out_shape - elif isinstance(out_shape, Iterable): - # Calculate the flattened size of the output from the convolutional network. - self.flattened_size = int(np.prod(list(out_shape))) + self.flattened_size = int( + np.prod(get_output_shape(self.conv_net, self.input_size)) + ) # Constructs the fully connected layers determined by the number of input channels and the features of these. for i in range(len(fc_sizes)): diff --git a/minerva/models/core.py b/minerva/models/core.py index 769fa9172..d0d23a6cf 100644 --- a/minerva/models/core.py +++ b/minerva/models/core.py @@ -89,7 +89,8 @@ class MinervaModel(Module, ABC): input_shape (tuple[int, ...]): Optional; Defines the shape of the input data. Typically in order of number of channels, image width, image height but may vary dependant on model specs. n_classes (int): Number of classes in input data. - output_shape: The shape of the output of the network. Determined and set by :meth:`determine_output_dim`. + output_shape (tuple[int, ...]): The shape of the output of the network. + Determined and set by :meth:`determine_output_dim`. optimiser: :mod:`torch` optimiser model will use, to be initialised with inherited model's parameters. Args: @@ -116,7 +117,7 @@ def __init__( self.n_classes = n_classes # Output shape initialised as None. Should be set by calling determine_output_dim. - self.output_shape: Optional[Union[int, Iterable[int]]] = None + self.output_shape: Optional[Tuple[int, ...]] = None # Optimiser initialised as None as the model parameters created by its init is required to init a # torch optimiser. The optimiser MUST be set by calling set_optimiser before the model can be trained. @@ -135,6 +136,14 @@ def set_optimiser(self, optimiser: Optimizer) -> None: """ self.optimiser = optimiser + def set_criterion(self, criterion: Module) -> None: + """Set the internal criterion. + + Args: + criterion (~torch.nn.Module): Criterion (loss function) to set. + """ + self.criterion = criterion + def determine_output_dim(self, sample_pairs: bool = False) -> None: """Uses :func:`get_output_shape` to find the dimensions of the output of this model and sets to attribute.""" @@ -421,7 +430,7 @@ def get_output_shape( model: Module, image_dim: Union[Sequence[int], int], sample_pairs: bool = False, -) -> Union[int, Sequence[int]]: +) -> Tuple[int, ...]: """Gets the output shape of a model. Args: @@ -431,7 +440,7 @@ def get_output_shape( Will send a paired sample through the model. Returns: - int | ~typing.Sequence[int]: The shape of the output data from the model. + tuple[int, ...]: The shape of the output data from the model. """ _image_dim: Union[Sequence[int], int] = image_dim try: @@ -455,10 +464,10 @@ def get_output_shape( output: Tensor = model(random_input.to(next(model.parameters()).device)) if len(output[0].data.shape) == 1: - return output[0].data.shape[0] + return (output[0].data.shape[0],) else: - return output[0].data.shape[1:] + return tuple(output[0].data.shape[1:]) def bilinear_init(in_channels: int, out_channels: int, kernel_size: int) -> Tensor: diff --git a/minerva/tasks/__init__.py b/minerva/tasks/__init__.py new file mode 100644 index 000000000..bd76f5c05 --- /dev/null +++ b/minerva/tasks/__init__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +""":mod:`tasks` is a repositry of downstream tasks for evaluating models in :mod:`minerva` with a generic IO.""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" +__all__ = [ + "MinervaTask", + "StandardEpoch", + "WeightedKNN", + "TSNEVis", + "get_task", +] + +from .core import MinervaTask, get_task +from .epoch import StandardEpoch +from .knn import WeightedKNN +from .tsne import TSNEVis diff --git a/minerva/tasks/core.py b/minerva/tasks/core.py new file mode 100644 index 000000000..a53adc7ba --- /dev/null +++ b/minerva/tasks/core.py @@ -0,0 +1,490 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +"""Core functionality of :mod:`tasks`, defining the abstract :class:`MinervaTask` class + +.. versionadded:: 0.27 +""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" + +# ===================================================================================================================== +# IMPORTS +# ===================================================================================================================== +import abc +from abc import ABC +from pathlib import Path +from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Sequence, Union + +if TYPE_CHECKING: # pragma: no cover + from torch.utils.tensorboard.writer import SummaryWriter +else: # pragma: no cover + SummaryWriter = None + +import pandas as pd +import torch +import torch.distributed as dist +from nptyping import Int, NDArray +from torch import Tensor +from wandb.sdk.wandb_run import Run + +from minerva.datasets import make_loaders +from minerva.logger.tasklog import MinervaTaskLogger +from minerva.models import MinervaDataParallel, MinervaModel +from minerva.utils import utils, visutils +from minerva.utils.utils import fallback_params, func_by_str + + +# ===================================================================================================================== +# CLASSES +# ===================================================================================================================== +class MinervaTask(ABC): + """An abstract definition of a task to fit or evalulate a model within :mod:`minerva`. + + Attributes: + name (str): The name of the task. + params (dict[str, ~typing.Any]): Dictionary describing all the parameters that define how the model will be + constructed, trained and evaluated. These should be defined via config ``YAML`` files. + model (MinervaModel): Model to be fitted of a class contained within :mod:`~minerva.models`. + loaders (dict[str, ~torch.utils.data.DataLoader]): :class:`dict` containing + :class:`~torch.utils.data.DataLoader` (s) for each dataset. + n_batches (dict[str, int]): Dictionary of the number of batches to supply to the model for train, + validation and testing. + batch_size (int): Number of samples in each batch. + device: The CUDA device on which to fit the model. + verbose (bool): Provides more prints to stdout if ``True``. + class_dist (~typing.Any): Distribution of classes within the data. + sample_pairs (bool): Whether samples are paired together for Siamese learning. + modes (tuple[str, ...]): The different *modes* of fitting in this experiment specified by the config. + writer (~torch.utils.tensorboard.writer.SummaryWriter | ~wandb.sdk.wandb_run.Run | None): The *writer* + to perform logging for this experiment. For use with either :mod:`tensorboard` or :mod:`wandb`. + n_samples (dict[str, int]): Number of samples in each mode of model fitting. + logger (~logger.MinervaTaskLogger): Object to calculate and log metrics to track the performance + of the model. + modelio_func (~typing.Callable[..., ~typing.Any]): Function to handle the input/ output to the model. + step_num (int): Holds the step number for this task. + model_type (str): Type of the model that determines how to handle IO, metric calculations etc. + record_int (bool): Store the integer results of each epoch in memory such the predictions, ground truth etc. + record_float (bool): Store the floating point results of each epoch in memory + such as the raw predicted probabilities. + + Args: + name (str): The name of the task. Should match the key for the task + in the ``tasks`` dictionary of the experiment params. + model (MinervaModel): Model to be fitted of a class contained within :mod:`~minerva.models`. + device: The CUDA device on which to fit the model. + exp_fn (~pathlib.Path): The path to the parent directory for the results of the experiment. + gpu (int): Optional; CUDA GPU device number. For use in distributed computing. Defaults to ``0``. + rank (int): Optional; The rank of this process across all devices in the distributed run. + world_size (int): Optional; The total number of processes across the distributed run. + writer (~wandb.sdk.wandb_run.Run | RunDisabled): Optional; Run object for Weights and Biases. + params (dict[str, ~typing.Any]): Dictionary describing all the parameters that define how the model will be + constructed, trained and evaluated. These should be defined via config ``YAML`` files. + record_int (bool): Store the integer results of each epoch in memory such the predictions, ground truth etc. + record_float (bool): Store the floating point results of each epoch in memory + such as the raw predicted probabilities. + + Keyword Args: + elim (bool): Will eliminate classes that have no samples in and reorder the class labels so they + still run from ``0`` to ``n-1`` classes where ``n`` is the reduced number of classes. + :mod:`minerva` ensures that labels are converted between the old and new schemes seamlessly. + balance (bool): Activates class balancing. For ``model_type="scene classifer"`` or ``model_type="mlp"``, + over and under sampling will be used. For ``model_type="segmentation"``, class weighting will be + used on the loss function. + model_type (str): Defines the type of the model. If ``siamese``, ensures inappropiate functionality is not used. + dataset_params (dict[str, ~typing.Any]): Parameters to construct each dataset. + See documentation on structure of these. + collator (dict[str, ~typing.Any]): Defines the collator to use that will collate samples together into batches. + Contains the ``module`` key to define the import path and the ``name`` key + for name of the collation function. + sample_pairs (bool): Activates paired sampling for Siamese models. Only used for ``train`` datasets. + loss_func (str): Name of the loss function to use. + optim_func (str): Name of the optimiser function to use. + lr (float): Learning rate of optimiser. + optim_params (dict[str, ~typing.Any]): :class:`dict` to hold any additional parameters for the optimiser, + other than the already handled learning rate -- ``lr``. Place them in the ``params`` key. + If using a non-torch optimiser, use the ``module`` key to specify the import path to the optimiser function. + loss_params (dict[str, ~typing.Any]): :class:`dict` to hold any additional parameters for the loss function + in the ``params`` key. If using a non-torch loss function, you need to specify the import path + with the ``module`` key. + patch_size (tuple[float, float]): Defines the shape of the patches in the dataset. + input_size (tuple[int, ...]): Shape of the input to the model. Typically in CxHxW format. + Should align with the values given for ``patch_size``. + tasklogger (str): Specify the task logger to use. Must be the name of a + :class:`~logger.tasklog.MinervaTaskLogger` class within :mod:`~logger.tasklog`. + steplogger (str): Specify the step logger to use. Must be the name of a + :class:`~logger.steplog.MinervaStepLogger` class within :mod:`~logger.steplog`. + modelio (str): Specify the IO function to use to handle IO for the model during fitting. Must be the name + of a function within :mod:`modelio`. + + + .. versionadded:: 0.27 + """ + + logger_cls: str = "SupervisedTaskLogger" + model_io_name: str = "sup_tg" + + def __init__( + self, + name: str, + model: Union[MinervaModel, MinervaDataParallel], + device: torch.device, + exp_fn: Path, + gpu: int = 0, + rank: int = 0, + world_size: int = 1, + writer: Optional[Union[SummaryWriter, Run]] = None, + record_int: bool = True, + record_float: bool = False, + train: bool = False, + **global_params, + ) -> None: + self.name = name + + self.model = model + + # Gets the datasets, number of batches, class distribution and the modfied parameters for the experiment. + loaders, n_batches, class_dist, new_params = make_loaders( + rank, world_size, task_name=name, **global_params + ) + + # If there are multiple modes and therefore number of batches, just take the value of the first one. + if isinstance(n_batches, dict): + n_batches = next(iter(n_batches.values())) + + global_params["tasks"][name] = new_params + + # ``global_params`` is the whole experiment parameters. + self.global_params = global_params + + # ``params`` is the parameters for just this task. + self.params = new_params + + # Modify `exp_fn` with a sub-directory for this task. + self.task_dir = exp_fn / self.name + self.task_fn = self.task_dir / exp_fn.name + + self.train = train + if "train" in self.params: + del self.params["train"] + + self.gpu = gpu + + self.loaders = loaders + self.class_dist = class_dist + + # Try to find parameters first in the task params then fall back to the global level params. + self.batch_size = fallback_params("batch_size", self.params, self.global_params) + + # Corrects the batch size if this is a distributed job to account for batches being split across devices. + if dist.is_available() and dist.is_initialized(): # type: ignore[attr-defined] # pragma: no cover + self.batch_size = self.batch_size // dist.get_world_size() # type: ignore[attr-defined] + + self.n_batches = n_batches + self.model_type = fallback_params("model_type", self.params, self.global_params) + self.sample_pairs = fallback_params( + "sample_pairs", self.params, self.global_params + ) + self.n_classes = fallback_params("n_classes", self.params, self.global_params) + + self.output_size = model.output_shape + + self.record_int = utils.fallback_params( + "record_int", self.params, self.global_params, record_int + ) + self.record_float = utils.fallback_params( + "record_float", self.params, self.global_params, record_float + ) + + # Ensure the model IO function is treated as static not a class method. + self.modelio = staticmethod(self.get_io_func()).__func__ + + self.loaders = loaders + self.device = device + self.writer = writer + self.step_num = 0 + + # Initialise the Weights and Biases metrics for this task. + self.init_wandb_metrics() + + # Update the loss function of the model. + self.model.set_criterion(self.make_criterion()) + + # Make the logger for this task. + self.logger: MinervaTaskLogger = self.make_logger() + + def init_wandb_metrics(self) -> None: + """Setups up the step counter for :mod:`wandb` logging.""" + if isinstance(self.writer, Run): + self.writer.define_metric(f"{self.name}/step") + self.writer.define_metric(f"{self.name}/*", step_metric=f"{self.name}/step") + + def make_criterion(self) -> Any: + """Creates a :mod:`torch` loss function based on config parameters. + + Returns: + ~typing.Any: Initialised :mod:`torch` loss function specified by config parameters. + """ + # Gets the loss function requested by config parameters. + loss_params: Dict[str, Any] = fallback_params( + "loss_params", self.params, self.global_params + ).copy() + module = loss_params.pop("module", "torch.nn") + criterion: Callable[..., Any] = func_by_str(module, loss_params["name"]) + + if not utils.check_dict_key(loss_params, "params"): + loss_params["params"] = {} + + if fallback_params( + "balance", self.params, self.global_params, False + ) and utils.check_substrings_in_string(self.model_type, "segmentation"): + print(f"Epoch {self.class_dist=}") + weights_dict = utils.class_weighting(self.class_dist, normalise=False) + + weights = [] + if fallback_params("elim", self.params, self.global_params, False): + for i in range(len(weights_dict)): + weights.append(weights_dict[i]) + else: + for i in range(self.n_classes): + weights.append(weights_dict.get(i, 0.0)) + + loss_params["params"]["weight"] = Tensor(weights) + + return criterion(**loss_params["params"]) + + else: + return criterion(**loss_params["params"]) + + def make_logger(self) -> MinervaTaskLogger: + """Creates an object to calculate and log the metrics from the experiment, selected by config parameters. + + Returns: + MinervaTaskLogger: Constructed task logger. + """ + + # Gets constructor of the metric logger from name in the config. + _logger_cls = func_by_str( + "minerva.logger.tasklog", + utils.fallback_params( + "task_logger", self.params, self.global_params, self.logger_cls + ), + ) + + # Initialises the metric logger with arguments. + logger: MinervaTaskLogger = _logger_cls( + self.name, + self.n_batches, + self.batch_size, + self.output_size, + step_logger_params=utils.fallback_params( + "step_logger", self.params, self.global_params, {} + ), + record_int=self.record_int, + record_float=self.record_float, + writer=self.writer, + model_type=self.model_type, + sample_pairs=self.sample_pairs, + n_classes=self.n_classes, + ) + + return logger + + def get_io_func(self) -> Callable[..., Any]: + """Fetches a func to handle IO for the type of model used in the experiment. + + Returns: + ~typing.Callable[..., ~typing.Any]: Model IO function requested from parameters. + """ + io_func: Callable[..., Any] = func_by_str( + "minerva.modelio", + utils.fallback_params( + "model_io", self.params, self.global_params, self.model_io_name + ), + ) + return io_func + + @abc.abstractmethod + def step(self) -> None: + raise NotImplementedError + + def _generic_step(self, epoch_no: int) -> Optional[Dict[str, Any]]: + self.step() + + # Send the logs to the metric logger. + self.logger.calc_metrics(epoch_no) + + if self.record_int or self.record_float: + results = self.logger.get_results + else: + results = None + + self.logger.refresh_step_logger() + + return results + + def __call__(self, epoch_no: int) -> Any: + return self._generic_step(epoch_no) + + @property + def get_logs(self) -> Dict[str, Any]: + return self.logger.get_logs + + @property + def get_metrics(self) -> Dict[str, Any]: + return self.logger.get_metrics + + def log_null(self, epoch_no: int) -> None: + """Log :attr:`numpy.NAN` for this epoch. + + Useful for logging null when a validation epoch was skipped so that + the length of the logs remains the same as the training logs. + + Args: + epoch_no (int): Epoch number. + """ + self.logger.log_null() + self.logger.log_epoch_number(epoch_no) + + def print_epoch_results(self, epoch_no: int) -> None: + self.logger.print_epoch_results(epoch_no) + + def plot( + self, + results: Dict[str, Any], + metrics: Optional[Dict[str, Any]] = None, + save: bool = True, + show: bool = False, + ) -> None: + # Gets the dict from params that defines which plots to make from the results. + plots = utils.fallback_params( + "plots", self.params, self.global_params, {} + ).copy() + + if not utils.fallback_params( + "plot_last_epoch", self.params, self.global_params, False + ): + # If not plotting results, ensure that only history plotting will remain + # if originally set to do so. + plots["Mask"] = False + plots["Pred"] = False + + # Ensures masks are not plotted for model types that do not yield such outputs. + if utils.check_substrings_in_string( + self.model_type, "scene classifier", "mlp", "MLP" + ): + plots["Mask"] = False + + if metrics is None: + plots["History"] = False + + elif len(list(metrics.values())[0]["x"]) <= 1: + plots["History"] = False + + else: + pass + + visutils.plot_results( + plots, + task_name=self.name, + metrics=metrics, + class_names=utils.fallback_params( + "classes", self.params, self.global_params + ), + colours=utils.fallback_params("colours", self.params, self.global_params), + save=save, + show=show, + model_name=self.params["model_name"], + timestamp=self.params["timestamp"], + results_dir=self.task_dir, + **results, + ) + + def compute_classification_report( + self, predictions: Sequence[int], labels: Sequence[int] + ) -> None: + """Creates and saves to file a classification report table of precision, recall, f-1 score and support. + + Args: + predictions (~typing.Sequence[int]): List of predicted labels. + labels (~typing.Sequence[int]): List of corresponding ground truth label masks. + """ + # Ensures predictions and labels are flattened. + preds: NDArray[Any, Int] = utils.batch_flatten(predictions) + targets: NDArray[Any, Int] = utils.batch_flatten(labels) + + # Uses utils to create a classification report in a DataFrame. + cr_df = utils.make_classification_report(preds, targets, self.params["classes"]) + + # Ensure the parent directories for the classification report exist. + self.task_fn.parent.mkdir(parents=True, exist_ok=True) + + # Saves classification report DataFrame to a .csv file at fn. + cr_df.to_csv(f"{self.task_fn}_classification-report.csv") + + def save_metrics(self) -> None: + print("\nSAVING METRICS TO FILE") + try: + metrics = self.get_metrics + metrics_df = pd.DataFrame( + {key: metrics[key]["y"] for key in metrics.keys()} + ) + + # Assumes that the length of each metric is the same. + metrics_df["Epoch"] = list(metrics.values())[0]["x"] + metrics_df.set_index("Epoch", inplace=True, drop=True) + metrics_df.to_csv(f"{self.task_fn}_metrics.csv") + + except (ValueError, KeyError) as err: # pragma: no cover + print(err) + print("\n*ERROR* in saving metrics to file.") + + def __repr__(self) -> str: + return f"{self.__class__.__name__}-{self.name}" + + +# ===================================================================================================================== +# METHODS +# ===================================================================================================================== +def get_task(task: str, *args, **params) -> MinervaTask: + """Get the requested :class:`MinervaTask` by name. + + Args: + task (str): Name of the task. + params (Dict[str, Any]): Parameters for the task to be initialised. + + Returns: + MinervaTask: Constructed :class:`MinervaTask` object. + """ + _task = func_by_str("minerva.tasks", task) + + task = _task(*args, **params) + assert isinstance(task, MinervaTask) + return task diff --git a/minerva/tasks/epoch.py b/minerva/tasks/epoch.py new file mode 100644 index 000000000..0e6198db6 --- /dev/null +++ b/minerva/tasks/epoch.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +"""A standard epoch for use with generic model fitting. + +.. versionadded:: 0.27 +""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" +__all__ = ["StandardEpoch"] + + +# ===================================================================================================================== +# IMPORTS +# ===================================================================================================================== +from contextlib import nullcontext + +import torch.distributed as dist +from alive_progress import alive_bar + +from minerva.utils import utils + +from .core import MinervaTask + + +# ===================================================================================================================== +# CLASSES +# ===================================================================================================================== +class StandardEpoch(MinervaTask): + """A standard epoch for use with generic model fitting. + + .. versionadded:: 0.27 + """ + + logger_cls = "SupervisedTaskLogger" + + def step(self) -> None: + # Initialises a progress bar for the epoch. + with alive_bar( + self.n_batches, bar="blocks" + ) if self.gpu == 0 else nullcontext() as bar: + # Sets the model up for training or evaluation modes. + if self.train: + self.model.train() + else: + self.model.eval() + + # Core of the epoch. + for batch in self.loaders: + results = self.modelio( + batch, + self.model, + self.device, + self.train, + **self.params, + ) + + if dist.is_available() and dist.is_initialized(): # type: ignore[attr-defined] # pragma: no cover + loss = results[0].data.clone() + dist.all_reduce(loss.div_(dist.get_world_size())) # type: ignore[attr-defined] + results = (loss, *results[1:]) + + self.logger.step(self.step_num, *results) + + self.step_num += 1 + + # Updates progress bar that batch has been processed. + if self.gpu == 0: + bar() # type: ignore + + # If configured to do so, calculates the grad norms. + if self.params.get("calc_norm", False): + _ = utils.calc_grad(self.model) diff --git a/minerva/tasks/knn.py b/minerva/tasks/knn.py new file mode 100644 index 000000000..cb2cea5ed --- /dev/null +++ b/minerva/tasks/knn.py @@ -0,0 +1,306 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +"""KNN Validation task. + +.. versionadded:: 0.27 +""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" +__all__ = ["WeightedKNN"] + +from pathlib import Path + +# ===================================================================================================================== +# IMPORTS +# ===================================================================================================================== +from typing import TYPE_CHECKING, Optional, Tuple, Union + +import torch +import torch.distributed as dist +import torch.nn.functional as ptfunc +from alive_progress import alive_it +from torch import Tensor +from wandb.sdk.wandb_run import Run + +if TYPE_CHECKING: # pragma: no cover + from torch.utils.tensorboard.writer import SummaryWriter +else: # pragma: no cover + SummaryWriter = None + +from minerva.models import MinervaDataParallel, MinervaModel, MinervaSiamese +from minerva.utils import utils + +from .core import MinervaTask + + +# ===================================================================================================================== +# CLASSES +# ===================================================================================================================== +class WeightedKNN(MinervaTask): + """A KNN Validation task. + + Attributes: + params (dict[str, ~typing.Any]): Dictionary describing all the parameters that define how the model will be + constructed, trained and evaluated. These should be defined via config ``YAML`` files. + model (MinervaModel): Model to be fitted of a class contained within :mod:`~minerva.models`. + batch_size (int): Size of each batch of samples supplied to the model. + loaders (dict[str, ~torch.utils.data.DataLoader]): :class:`dict` containing + :class:`~torch.utils.data.DataLoader` (s) for each dataset. + n_batches (dict[str, int]): Dictionary of the number of batches to supply to the model for train, + validation and testing. + metrics (dict[str, ~typing.Any]): Dictionary to hold the loss and accuracy results from training, + validation and testing. + device: The CUDA device on which to fit the model. + verbose (bool): Provides more prints to stdout if ``True``. + class_dist (~typing.Any): Distribution of classes within the data. + sample_pairs (bool): Whether samples are paired together for Siamese learning. + modes (tuple[str, ...]): The different *modes* of fitting in this experiment specified by the config. + writer (~torch.utils.tensorboard.writer.SummaryWriter | ~wandb.sdk.wandb_run.Run | None): The *writer* + to perform logging for this experiment. For use with either :mod:`tensorboard` or :mod:`wandb`. + n_samples (dict[str, int]): Number of samples in each mode of model fitting. + metric_logger (~logger.MinervaLogger): Object to calculate and log metrics to track the performance + of the model. + modelio_func (~typing.Callable[..., ~typing.Any]): Function to handle the input/ output to the model. + steps (dict[str, int]): :class:`dict` to hold the global step number for each mode of model fitting. + model_type (str): Type of the model that determines how to handle IO, metric calculations etc. + + Args: + model (MinervaModel): Model to be fitted of a class contained within :mod:`~minerva.models`. + rank (int): Optional; The rank of this process across all devices in the distributed run. + world_size (int): Optional; The total number of processes across the distributed run. + writer (~wandb.sdk.wandb_run.Run | RunDisabled): Optional; Run object for Weights and Biases. + params (dict[str, ~typing.Any]): Dictionary describing all the parameters that define how the model will be + constructed, trained and evaluated. These should be defined via config ``YAML`` files. + record_int (bool): Store the integer results of each epoch in memory such the predictions, ground truth etc. + record_float (bool): Store the floating point results of each epoch in memory + such as the raw predicted probabilities. + + Keyword Args: + batch_size (int): Number of samples in each batch. + elim (bool): Will eliminate classes that have no samples in and reorder the class labels so they + still run from ``0`` to ``n-1`` classes where ``n`` is the reduced number of classes. + :mod:`minerva` ensures that labels are converted between the old and new schemes seamlessly. + model_type (str): Defines the type of the model. If ``siamese``, ensures inappropiate functionality is not used. + dataset_params (dict[str, ~typing.Any]): Parameters to construct each dataset. + See documentation on structure of these. + collator (dict[str, ~typing.Any]): Defines the collator to use that will collate samples together into batches. + Contains the ``module`` key to define the import path and the ``name`` key + for name of the collation function. + sample_pairs (bool): Activates paired sampling for Siamese models. Only used for ``train`` datasets. + lr (float): Learning rate of optimiser. + optim_params (dict[str, ~typing.Any]): :class:`dict` to hold any additional parameters for the optimiser, + other than the already handled learning rate -- ``lr``. Place them in the ``params`` key. + If using a non-torch optimiser, use the ``module`` key to specify the import path to the optimiser function. + loss_params (dict[str, ~typing.Any]): :class:`dict` to hold any additional parameters for the loss function + in the ``params`` key. If using a non-torch loss function, you need to specify the import path + with the ``module`` key. + balance (bool): Activates class balancing. For ``model_type="scene classifer"`` or ``model_type="mlp"``, + over and under sampling will be used. For ``model_type="segmentation"``, class weighting will be + used on the loss function. + modelio (str): Specify the IO function to use to handle IO for the model during fitting. Must be the name + of a function within :mod:`modelio`. + + .. versionadded:: 0.27 + """ + + logger_cls = "SSLTaskLogger" + + def __init__( + self, + name: str, + model: Union[MinervaModel, MinervaDataParallel], + device: torch.device, + exp_fn: Path, + gpu: int = 0, + rank: int = 0, + world_size: int = 1, + writer: Optional[Union[SummaryWriter, Run]] = None, + record_int: bool = True, + record_float: bool = False, + k: int = 5, + temp: float = 0.5, + **params, + ) -> None: + super().__init__( + name, + model, + device, + exp_fn, + gpu, + rank, + world_size, + writer, + record_int, + record_float, + **params, + ) + + self.temp = temp + self.k = k + + def generate_feature_bank(self) -> Tuple[Tensor, Tensor]: + feature_list = [] + target_list = [] + + feat_bar = alive_it(self.loaders["features"]) + for batch in feat_bar: + val_data: Tensor = batch["image"].to(self.device, non_blocking=True) + val_target: Tensor = batch["mask"].to(self.device, non_blocking=True) + target_list.append( + torch.mode(torch.flatten(val_target, start_dim=1)).values + ) + + # Get features from passing the input data through the model. + if utils.check_substrings_in_string(self.model_type, "siamese"): + # Checks that the model is of type ``MinervaSiamese`` so a call to `forward_single` will work. + if isinstance(self.model, MinervaDataParallel): # pragma: no cover + assert isinstance(self.model.model.module, MinervaSiamese) + else: + assert isinstance(self.model, MinervaSiamese) + + # Ensures that the data is parsed through a single head of the model rather than paired. + feature, _ = self.model.forward_single(val_data) # type: ignore[operator] + else: + feature, _ = self.model(val_data) + + # The masks from segmentation models will need to be flattened. + if utils.check_substrings_in_string(self.model_type, "segmentation"): + feature = feature.flatten(1, -1) + + feature_list.append(feature) + + # [D, N] + feature_bank = torch.cat(feature_list, dim=0).t().contiguous() + + # [N] + feature_labels = ( + torch.cat(target_list, dim=0).contiguous().to(feature_bank.device) + ) + + return feature_bank, feature_labels + + def step(self) -> None: + """Trains a KNN using the model to validate a SSL model. + + Adapted from https://github.com/yaohungt/Barlow-Twins-HSIC for use in :mod:`minerva`. + """ + + # Puts the model in evaluation mode so no back passes are made. + self.model.eval() + + total_num = 0 + + with torch.no_grad(): + # Generate feature bank and target bank. + feature_bank, feature_labels = self.generate_feature_bank() + + # Loop test data to predict the label by weighted KNN search. + test_bar = alive_it(self.loaders["test"]) + for batch in test_bar: + test_data: Tensor = batch["image"].to(self.device, non_blocking=True) + test_target: Tensor = torch.mode( + torch.flatten( + batch["mask"].to(self.device, non_blocking=True), start_dim=1 + ) + ).values + + # Get features from passing the input data through the model. + if utils.check_substrings_in_string(self.model_type, "siamese"): + # Checks that the model is of type ``MinervaSiamese`` so a call to `forward_single` will work. + if isinstance(self.model, MinervaDataParallel): # pragma: no cover + assert isinstance(self.model.model.module, MinervaSiamese) + else: + assert isinstance(self.model, MinervaSiamese) + + # Ensures that the data is parsed through a single head of the model rather than paired. + feature, _ = self.model.forward_single(test_data) # type: ignore[operator] + else: + feature, _ = self.model(test_data) + + # The masks from segmentation models will need to be flattened. + if utils.check_substrings_in_string(self.model_type, "segmentation"): + feature = feature.flatten(1, -1) + + total_num += self.batch_size + + # compute cos similarity between each feature vector and feature bank ---> [B, N] + sim_matrix = torch.mm(feature, feature_bank) + + # [B, K] + sim_weight, sim_indices = sim_matrix.topk(k=self.k, dim=-1) + + # [B, K] + sim_labels = torch.gather( + feature_labels.expand(test_data.size(0), -1), + dim=-1, + index=sim_indices, + ) + + sim_weight = (sim_weight / self.temp).exp() + + # Counts for each class + one_hot_label = torch.zeros( + test_data.size(0) * self.k, self.n_classes, device=sim_labels.device + ) + + # [B*K, C] + one_hot_label = one_hot_label.scatter( + dim=-1, index=sim_labels.view(-1, 1), value=1.0 + ) + + # Weighted score ---> [B, C] + pred_scores = torch.sum( + one_hot_label.view(test_data.size(0), -1, self.n_classes) + * sim_weight.unsqueeze(dim=-1), + dim=1, + ) + pred_scores = ptfunc.normalize( + pred_scores.nan_to_num(nan=0.0, posinf=1.0, neginf=0.0), + ) + + # Calculate loss between predicted and ground truth labels by KNN. + criterion = torch.nn.CrossEntropyLoss() + loss = criterion(pred_scores, test_target) + + # Pack results together for the logger. + results = (loss, pred_scores, test_target, _) + + # Gathers the losses across devices together if a distributed job. + if dist.is_available() and dist.is_initialized(): # pragma: no cover + loss = results[0].data.clone() + dist.all_reduce(loss.div_(dist.get_world_size())) + results = (loss, *results[1:]) + + # Sends results to logger. + self.logger.step(self.step_num, *results) + + # Update global step number for this mode of model fitting. + self.step_num += 1 diff --git a/minerva/tasks/tsne.py b/minerva/tasks/tsne.py new file mode 100644 index 000000000..47d572529 --- /dev/null +++ b/minerva/tasks/tsne.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +"""TSNE Clustering task.""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" +__all__ = ["TSNEVis"] + + +# ===================================================================================================================== +# IMPORTS +# ===================================================================================================================== +from pathlib import Path +from typing import Union + +import torch +from torch import Tensor +from torch.utils.tensorboard.writer import SummaryWriter +from wandb.sdk.wandb_run import Run + +from minerva.models import MinervaDataParallel, MinervaModel +from minerva.utils.visutils import plot_embedding + +from .core import MinervaTask + + +# ===================================================================================================================== +# CLASSES +# ===================================================================================================================== +class TSNEVis(MinervaTask): + """TSNE clustering task. + + Passes a batch of data through the model in eval mode to get the embeddings. + Passes these embeddings to :mod:`visutils` to train a TSNE algorithm and then visual the cluster. + """ + + def __init__( + self, + name: str, + model: Union[MinervaModel, MinervaDataParallel], + device: torch.device, + exp_fn: Path, + gpu: int = 0, + rank: int = 0, + world_size: int = 1, + writer: Union[SummaryWriter, Run, None] = None, + record_int: bool = True, + record_float: bool = False, + **params, + ) -> None: + backbone = model.get_backbone() # type: ignore[assignment, operator] + + # Set dummy optimiser. It won't be used as this is a test. + backbone.set_optimiser(torch.optim.SGD(backbone.parameters(), lr=1.0e-3)) + + super().__init__( + name, + backbone, + device, + exp_fn, + gpu, + rank, + world_size, + writer, + record_int, + record_float, + **params, + ) + + def step(self) -> None: + """Perform TSNE clustering on the embeddings from the model and visualise. + + Passes a batch from the test dataset through the model in eval mode to get the embeddings. + Passes these embeddings to :mod:`visutils` to train a TSNE algorithm and then visual the cluster. + """ + # Get a batch of data. + data = next(iter(self.loaders)) + + # Make sure the model is in evaluation mode. + self.model.eval() + + # Pass the batch of data through the model to get the embeddings. + embeddings: Tensor = self.model.forward(data["image"].to(self.device))[0] + + # Flatten embeddings. + embeddings = embeddings.flatten(start_dim=1) + + plot_embedding( + embeddings.detach().cpu(), + data["bbox"], + self.name, + show=True, + filename=str(self.task_fn / "tsne_cluster_vis.png"), + ) diff --git a/minerva/trainer.py b/minerva/trainer.py index 9143aa930..741ac3622 100644 --- a/minerva/trainer.py +++ b/minerva/trainer.py @@ -39,32 +39,15 @@ # IMPORTS # ===================================================================================================================== import os -from contextlib import nullcontext +from copy import deepcopy from pathlib import Path -from typing import ( - TYPE_CHECKING, - Any, - Callable, - Dict, - Iterable, - Optional, - Sequence, - Tuple, - Union, -) +from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Tuple, Union -import pandas as pd import torch -import torch.distributed as dist -import torch.nn.functional as ptfunc import yaml -from alive_progress import alive_bar, alive_it from inputimeout import TimeoutOccurred, inputimeout -from nptyping import Int, NDArray -from torch import Tensor from torch.nn.modules import Module from torch.nn.parallel import DistributedDataParallel as DDP -from torch.utils.data import DataLoader if TYPE_CHECKING: # pragma: no cover from torch.utils.tensorboard.writer import SummaryWriter @@ -73,19 +56,16 @@ from wandb.sdk.lib import RunDisabled from wandb.sdk.wandb_run import Run -from minerva.datasets import make_loaders -from minerva.logger import KNNLogger, MinervaLogger -from minerva.metrics import MinervaMetrics from minerva.models import ( MinervaBackbone, MinervaDataParallel, MinervaModel, MinervaOnnxModel, - MinervaSiamese, MinervaWrapper, ) from minerva.pytorchtools import EarlyStopping -from minerva.utils import AUX_CONFIGS, universal_path, utils, visutils +from minerva.tasks import MinervaTask, TSNEVis, get_task +from minerva.utils import universal_path, utils # ===================================================================================================================== # GLOBALS @@ -254,13 +234,10 @@ def __init__( ) -> None: assert not isinstance(wandb_run, RunDisabled) - # Gets the datasets, number of batches, class distribution and the modfied parameters for the experiment. - loaders, n_batches, class_dist, new_params = make_loaders( - rank, world_size, **params - ) - # Sets the global GPU number for distributed computing. In single process, this will just be 0. self.gpu: int = gpu + self.rank = rank + self.world_size = world_size # Finds and sets the CUDA device to be used. self.device = utils.get_cuda_device(gpu) @@ -273,12 +250,9 @@ def __init__( print( "\n==+ Experiment Parameters +=====================================================" ) - utils.print_config(new_params) + utils.print_config(dict(params)) - self.params: Dict[str, Any] = new_params - self.class_dist = class_dist - self.loaders: Dict[str, DataLoader[Iterable[Any]]] = loaders - self.n_batches = n_batches + self.params: Dict[str, Any] = dict(params) self.batch_size: int = self.params["batch_size"] self.model_type: str = self.params["model_type"] self.val_freq: int = self.params.get("val_freq", 1) @@ -287,8 +261,6 @@ def __init__( # Sets the max number of epochs of fitting. self.max_epochs = self.params.get("max_epochs", 25) - self.modes = self.params["dataset_params"].keys() - # Flag for a fine-tuning experiment. self.fine_tune = self.params.get("fine_tune", False) @@ -300,27 +272,24 @@ def __init__( self.params["model_name"], self.params["timestamp"] ) + # Path to experiment directory and experiment name. self.params["dir"]["results"] = universal_path(self.params["dir"]["results"]) - results_dir = self.params["dir"]["results"] / self.params["exp_name"] + self.exp_fn: Path = self.params["dir"]["results"] / self.params["exp_name"] if self.gpu == 0: # Makes a directory for this experiment. utils.mkexpdir(self.params["exp_name"]) - # Path to experiment directory and experiment name. - self.exp_fn: Path = results_dir / self.params["exp_name"] - self.writer: Optional[Union[SummaryWriter, Run]] = None if self.params.get("wandb_log", False): # Sets the `wandb` run object (or None). self.writer = wandb_run - self.init_wandb_metrics() else: if _tensorflow_exist: assert TENSORBOARD_WRITER # Initialise TensorBoard logger. - self.writer = TENSORBOARD_WRITER(results_dir) + self.writer = TENSORBOARD_WRITER(self.exp_fn) else: # pragma: no cover self.writer = None @@ -342,7 +311,6 @@ def __init__( self.sample_pairs = sample_pairs self.model.determine_output_dim(sample_pairs=sample_pairs) - print(self.device) # Transfer to GPU. self.model.to(self.device) @@ -356,18 +324,6 @@ def __init__( **self.params["stopping"], ) - # Calculates number of samples in each mode of fitting. - self.n_samples = { - mode: self.n_batches[mode] * self.batch_size for mode in self.modes - } - - # Initialise the metric logger and model IO for the experiment. - self.metric_logger = self.make_metric_logger() - self.modelio_func = self.get_io_func() - - # Stores the step number for that mode of fitting. To be used for logging. - self.step_num = {mode: 0 for mode in self.modes} - # Creates and sets the optimiser for the model. self.make_optimiser() @@ -415,13 +371,6 @@ def __init__( ) self.model = MinervaDataParallel(self.model, DDP, device_ids=[gpu]) - def init_wandb_metrics(self) -> None: - """Setups up separate step counters for :mod:`wandb` logging of train, val, etc.""" - if isinstance(self.writer, Run): - for mode in self.n_batches: - self.writer.define_metric(f"{mode}/step") - self.writer.define_metric(f"{mode}/*", step_metric=f"{mode}/step") - def get_input_size(self) -> Tuple[int, ...]: """Determines the input size of the model. @@ -538,30 +487,12 @@ def make_criterion(self) -> Any: # Gets the loss function requested by config parameters. loss_params: Dict[str, Any] = self.params["loss_params"].copy() module = loss_params.pop("module", "torch.nn") - criterion: Callable[..., Any] = utils.func_by_str( - module, self.params["loss_func"] - ) + criterion: Callable[..., Any] = utils.func_by_str(module, loss_params["name"]) if not utils.check_dict_key(loss_params, "params"): loss_params["params"] = {} - if self.params.get("balance", False) and self.model_type == "segmentation": - weights_dict = utils.class_weighting(self.class_dist, normalise=False) - - weights = [] - if self.params.get("elim", False): - for i in range(len(weights_dict)): - weights.append(weights_dict[i]) - else: - for i in range(self.params["n_classes"]): - weights.append(weights_dict.get(i, 0.0)) - - loss_params["params"]["weight"] = Tensor(weights) - - return criterion(**loss_params["params"]) - - else: - return criterion(**loss_params["params"]) + return criterion(**loss_params["params"]) def make_optimiser(self) -> None: """Creates a :mod:`torch` optimiser based on config parameters and sets optimiser.""" @@ -582,261 +513,92 @@ def make_optimiser(self) -> None: optimiser(self.model.parameters(), **optimiser_params["params"]) ) - def make_metric_logger(self) -> MinervaMetrics: - """Creates an object to calculate and log the metrics from the experiment, selected by config parameters. - - Returns: - MinervaMetrics: Constructed metric logger. - """ - - # Gets the size of the input data to the network (without batch dimension). - data_size = self.params["input_size"] - - # Gets constructor of the metric logger from name in the config. - _metric_logger: Callable[..., Any] = utils.func_by_str( - "minerva.metrics", self.params["metrics"] - ) - - # Initialises the metric logger with arguments. - metric_logger: MinervaMetrics = _metric_logger( - self.n_batches, - batch_size=self.batch_size, - data_size=data_size, - model_type=self.model_type, - sample_pairs=self.sample_pairs, - ) - - return metric_logger - - def get_logger(self) -> Callable[..., Any]: - """Creates an object to log the results from each step of model fitting during an epoch. - - Returns: - ~typing.Callable[..., ~typing.Any]: The constructor of :class:`~logger.MinervaLogger` - to be intialised within the epoch. - """ - logger: Callable[..., Any] = utils.func_by_str( - "minerva.logger", self.params["logger"] - ) - return logger - - def get_io_func(self) -> Callable[..., Any]: - """Fetches a func to handle IO for the type of model used in the experiment. - - Returns: - ~typing.Callable[..., ~typing.Any]: Model IO function requested from parameters. - """ - io_func: Callable[..., Any] = utils.func_by_str( - "minerva.modelio", self.params["model_io"] - ) - return io_func - - def epoch( - self, - mode: str, - record_int: bool = False, - record_float: bool = False, - ) -> Optional[Dict[str, Any]]: - """All encompassing function for any type of epoch, be that train, validation or testing. - - Args: - mode (str): Either train, val or test. - Defines the type of epoch to run on the model. - record_int (bool): Optional; Whether to record the integer results - (i.e. ground truth and predicted labels). - record_float (bool): Optional; Whether to record the floating point results i.e. class probabilities. - - Returns: - dict[str, ~typing.Any] | None: If ``record_int=True`` or ``record_float=True``, returns the predicted - and ground truth labels, and the patch IDs supplied to the model. Else, returns ``None``. - """ - batch_size = self.batch_size - if dist.is_available() and dist.is_initialized(): # type: ignore[attr-defined] # pragma: no cover - batch_size = self.batch_size // dist.get_world_size() # type: ignore[attr-defined] - - # Calculates the number of samples - n_samples = self.n_batches[mode] * batch_size - - # Creates object to log the results from each step of this epoch. - _epoch_logger: Callable[..., Any] = self.get_logger() - epoch_logger: MinervaLogger = _epoch_logger( - self.n_batches[mode], - batch_size, - n_samples, - self.model.output_shape, - self.model.n_classes, - record_int=record_int, - record_float=record_float, - collapse_level=self.sample_pairs, - euclidean=self.sample_pairs, - model_type=self.model_type, - writer=self.writer, + def fit(self) -> None: + """Fits the model by running ``max_epochs`` number of training and validation epochs.""" + fit_params = deepcopy( + { + key: self.params["tasks"][key] + for key in self.params["tasks"].keys() + if utils.check_substrings_in_string(key, "fit") + } ) - # Initialises a progress bar for the epoch. - with alive_bar( - self.n_batches[mode], bar="blocks" - ) if self.gpu == 0 else nullcontext() as bar: - # Sets the model up for training or evaluation modes. - if mode == "train": - self.model.train() - else: - self.model.eval() - - # Core of the epoch. - for batch in self.loaders[mode]: - results = self.modelio_func( - batch, self.model, self.device, mode, **self.params - ) - - if dist.is_available() and dist.is_initialized(): # type: ignore[attr-defined] # pragma: no cover - loss = results[0].data.clone() - dist.all_reduce(loss.div_(dist.get_world_size())) # type: ignore[attr-defined] - results = (loss, *results[1:]) - - epoch_logger.log(mode, self.step_num[mode], *results) - - self.step_num[mode] += 1 - - # Updates progress bar that batch has been processed. - if self.gpu == 0: - bar() # type: ignore - - # Updates metrics with epoch results. - self.metric_logger(mode, epoch_logger.get_logs) - - # If configured to do so, calculates the grad norms. - if self.params.get("calc_norm", False): - _ = utils.calc_grad(self.model) - - # Returns the results of the epoch if configured to do so. Else, returns None. - if record_int or record_float: - epoch_results: Dict[str, Any] = epoch_logger.get_results - return epoch_results - else: - return None + tasks: Dict[str, MinervaTask] = {} + for mode in fit_params.keys(): + tasks[mode] = get_task( + fit_params[mode].pop("type"), + mode, + self.model, + self.device, + self.exp_fn, + self.gpu, + self.rank, + self.world_size, + self.writer, + **self.params, + ) - def fit(self) -> None: - """Fits the model by running ``max_epochs`` number of training and validation epochs.""" for epoch in range(self.max_epochs): self.print( f"\nEpoch: {epoch + 1}/{self.max_epochs} ==========================================================" ) # Conduct training or validation epoch. - for mode in ("train", "val"): - # Only run a KNN validation epoch at set frequency of epochs. Goes to next epoch if not. + for mode in tasks.keys(): + # Only run a validation epoch at set frequency of epochs. Goes to next epoch if not. if ( - mode == "val" - and utils.check_substrings_in_string( - self.model_type, "ssl", "siamese" - ) + utils.check_substrings_in_string(mode, "val") and (epoch + 1) % self.val_freq != 0 ): + tasks[mode].log_null(epoch) break - results: Dict[str, Any] = {} - - # If final epoch and configured to plot, runs the epoch with recording of integer results turned on. - if self.params.get("plot_last_epoch", False): - result: Optional[Dict[str, Any]] - if mode == "val" and utils.check_substrings_in_string( - self.model_type, "ssl", "siamese" - ): - result = self.weighted_knn_validation( - k=self.params.get("knn_k", None), - record_int=True, - record_float=self.params.get("record_float", False), - ) - else: - result = self.epoch( - mode, - record_int=True, - record_float=self.params.get("record_float", False), - ) - assert result is not None - results = result - + if tasks[mode].train: + self.model.train() else: - if mode == "val" and utils.check_substrings_in_string( - self.model_type, "ssl", "siamese" - ): - self.weighted_knn_validation( - k=self.params.get("knn_k", None), - record_int=False, - record_float=False, - ) - else: - self.epoch(mode, record_int=False, record_float=False) + self.model.eval() - # Add epoch number to metrics. - self.metric_logger.log_epoch_number(mode, epoch) + results: Optional[Dict[str, Any]] + + results = tasks[mode](epoch) # Print epoch results. if self.gpu == 0: - if mode == "val" and utils.check_substrings_in_string( - self.model_type, "ssl", "siamese" - ): - epoch_no = epoch // self.val_freq - else: - epoch_no = epoch - self.metric_logger.print_epoch_results(mode, epoch_no) + tasks[mode].print_epoch_results(epoch) # Sends validation loss to the stopper and updates early stop bool. - if mode == "val" and self.stopper is not None: - if mode == "val" and utils.check_substrings_in_string( - self.model_type, "ssl", "siamese" - ): - epoch_no = epoch // self.val_freq - else: - epoch_no = epoch - - val_loss = self.metric_logger.get_metrics["val_loss"]["y"][epoch_no] + if ( + utils.check_substrings_in_string(mode, "val") + and self.stopper is not None + ): + val_loss = tasks[mode].get_metrics[f"{mode}_loss"]["y"][epoch] self.stopper(val_loss, self.model) self.early_stop = self.stopper.early_stop # Special case for final train/ val epoch to plot results if configured so. if epoch == (self.max_epochs - 1) or self.early_stop: - if self.early_stop and mode == "val": # pragma: no cover + if self.early_stop and utils.check_substrings_in_string( + mode, "val" + ): # pragma: no cover self.print("\nEarly stopping triggered") - # Ensures that plots likely to cause memory issues are not attempted. - plots: Dict[str, bool] = self.params.get("plots", {}).copy() - plots["CM"] = False - plots["ROC"] = False - - if not self.params.get("plot_last_epoch", False): - # If not plotting results, ensure that only history plotting will remain - # if originally set to do so. - plots["Mask"] = False - plots["Pred"] = False + # Create a subset of metrics for plotting model history. + fit_metrics: Dict[str, Any] = {} + for _mode in tasks.keys(): + fit_metrics = {**fit_metrics, **tasks[_mode].get_metrics} - # Create a subset of metrics which drops the testing results for plotting model history. - sub_metrics = self.metric_logger.get_sub_metrics() + fit_metrics = { + k.replace("fit-", ""): v for k, v in fit_metrics.items() + } - # Ensures masks are not plotted for model types that do not yield such outputs. - if utils.check_substrings_in_string( - self.model_type, "scene classifier", "mlp", "MLP" - ): - plots["Mask"] = False - - # Amends the results' directory to add a new level for train or validation. - results_dir = self.exp_fn.parent / mode + assert results is not None if self.gpu == 0: # Plots the results of this epoch. - visutils.plot_results( - plots, - metrics=sub_metrics, - class_names=self.params.get("classes"), - colours=self.params.get("colours"), - save=True, - show=False, - model_name=self.params["model_name"], - timestamp=self.params["timestamp"], - results_dir=results_dir, - **results, - ) + tasks[mode].plot(results, fit_metrics) + + # Writes the recorded metrics of the task to file. + tasks[mode].save_metrics() # If early stopping has been triggered, loads the last model save to replace current model, # ready for testing. @@ -859,56 +621,54 @@ def test(self, save: bool = True, show: bool = False) -> None: """ self.print("\r\nTESTING") - # Runs test epoch on model, returning the predicted labels, ground truth labels supplied - # and the IDs of the samples supplied. - results: Optional[Dict[str, Any]] = self.epoch( - "test", record_int=True, record_float=True + test_params = deepcopy( + { + key: self.params["tasks"][key] + for key in self.params["tasks"].keys() + if utils.check_substrings_in_string(key, "test") + } ) - assert results is not None - # Prints test loss and accuracy to stdout. - self.metric_logger.print_epoch_results("test", 0) + for task_name in test_params.keys(): + task = get_task( + test_params[task_name].pop("type"), + task_name, + self.model, + self.device, + self.exp_fn, + self.gpu, + self.rank, + self.world_size, + self.writer, + **self.params, + ) - # Add epoch number to testing results. - self.metric_logger.log_epoch_number("test", 0) + # Runs test epoch on model, returning the predicted labels, ground truth labels supplied + # and the IDs of the samples supplied. + results = task(0) - # Now experiment is complete, saves model parameters and config file to disk in case error is - # encountered in plotting of results. - self.close() + assert results is not None - if self.gpu == 0: - if "z" in results and "y" in results: - self.print("\nMAKING CLASSIFICATION REPORT") - self.compute_classification_report(results["z"], results["y"]) + if self.gpu == 0: + # Print epoch results. + task.print_epoch_results(0) - # Gets the dict from params that defines which plots to make from the results. - plots = self.params.get("plots", {}).copy() + # Creates a classification report from the results of the task. + if "z" in results and "y" in results: + self.print("\nMAKING CLASSIFICATION REPORT") + task.compute_classification_report(results["z"], results["y"]) - # Ensure history is not plotted again. - plots["History"] = False + # Plots the results. + task.plot(results, save=save, show=show) - if utils.check_substrings_in_string( - self.model_type, "scene classifier", "mlp", "MLP" - ): - plots["Mask"] = False - - # Amends the results' directory to add a new level for test results. - results_dir = self.exp_fn.parent / "test" - - # Plots the results. - visutils.plot_results( - plots, - mode="test", - class_names=self.params["classes"], - colours=self.params["colours"], - save=save, - show=show, - model_name=self.params["model_name"], - timestamp=self.params["timestamp"], - results_dir=results_dir, - **results, - ) + # Writes the recorded metrics of the task to file. + task.save_metrics() + # Now experiment is complete, saves model parameters and config file to disk in case error is + # encountered in plotting of results. + self.close() + + if self.gpu == 0: # Checks whether to run TensorBoard on the log from the experiment. If defined as optional in the config, # a user confirmation is required to run TensorBoard with a 60s timeout. if self.params.get("run_tensorboard", False) in ( @@ -951,219 +711,25 @@ def test(self, save: bool = True, show: bool = False) -> None: "providing the path to this experiment's results directory and unique experiment ID" ) - def tsne_cluster(self, mode: str = "test") -> None: + def tsne_cluster(self, task_name: str = "TSNEVis") -> None: """Perform TSNE clustering on the embeddings from the model and visualise. Passes a batch from the test dataset through the model in eval mode to get the embeddings. Passes these embeddings to :mod:`visutils` to train a TSNE algorithm and then visual the cluster. - - Args: - mode (str): The mode of model fitting that the embeddings come from. - """ - # Get a batch of data. - data = next(iter(self.loaders[mode])) - - # Make sure the model is in evaluation mode. - self.model.eval() - - # Pass the batch of data through the model to get the embeddings. - embeddings: Tensor = self.model(data["image"].to(self.device))[0] - - # Flatten embeddings. - embeddings = embeddings.flatten(start_dim=1) - - # Get the results directory. - results_dir = self.exp_fn.parent / mode - - visutils.plot_embedding( - embeddings.detach().cpu(), - data["bbox"], - mode, - show=True, - filename=str(results_dir / "tsne_cluster_vis.png"), - ) - - def weighted_knn_validation( - self, - temp: float = 0.5, - k: int = 200, - mode: str = "val", - record_int: bool = True, - record_float: bool = False, - ) -> Optional[Dict[str, Any]]: - """Trains a KNN using the model to validate a SSL model. - - Adapted from https://github.com/yaohungt/Barlow-Twins-HSIC for use in :mod:`minerva`. - - Args: - temp (float, optional): Temperature of the similarity loss. Defaults to 0.5. - k (int, optional): Number of similar images to use to predict images. Defaults to 200. - mode (str, optional): Mode of model fitting this has been called on. Defaults to "val". - record_int (bool, optional): Whether to record integer values. Defaults to True. - record_float (bool, optional): Whether to record floating point values. Warning! - This may result in memory issues on large amounts of data! Defaults to False. - - Returns: - dict[str, ~typing.Any] | None: Results dictionary from the epoch logger if ``record_int`` - or ``record_float`` are ``True``. """ - - # Puts the model in evaluation mode so no back passes are made. - self.model.eval() - - # Get the number of classes from the data config. - n_classes = len(AUX_CONFIGS["data_config"]["classes"]) - - batch_size = self.batch_size - - # Corrects the batch size if this is a distributed job to account for batches being split across devices. - if dist.is_available() and dist.is_initialized(): # type: ignore[attr-defined] # pragma: no cover - batch_size = self.batch_size // dist.get_world_size() # type: ignore[attr-defined] - - # Calculates the number of samples. - n_samples = self.n_batches[mode] * batch_size - - # Uses the special `KNNLogger` to log the results from the KNN. - epoch_logger = KNNLogger( - self.n_batches[mode], - batch_size, - n_samples, - record_int=record_int, - record_float=record_float, - writer=self.writer, + task = TSNEVis( + task_name, + self.model, + self.device, + self.exp_fn, + self.gpu, + self.rank, + self.world_size, + self.writer, + **self.params, ) - total_num = 0 - feature_list = [] - target_list = [] - - with torch.no_grad(): - # Generate feature bank and target bank. - feat_bar = alive_it(self.loaders["val"]) - for batch in feat_bar: - val_data: Tensor = batch["image"].to(self.device, non_blocking=True) - val_target: Tensor = batch["mask"].to(self.device, non_blocking=True) - target_list.append( - torch.mode(torch.flatten(val_target, start_dim=1)).values - ) - - # Get features from passing the input data through the model. - if utils.check_substrings_in_string(self.model_type, "siamese"): - # Checks that the model is of type ``MinervaSiamese`` so a call to `forward_single` will work. - if isinstance(self.model, MinervaDataParallel): # pragma: no cover - assert isinstance(self.model.model.module, MinervaSiamese) - else: - assert isinstance(self.model, MinervaSiamese) - - # Ensures that the data is parsed through a single head of the model rather than paired. - feature, _ = self.model.forward_single(val_data) # type: ignore[operator] - else: - feature, _ = self.model(val_data) - - # The masks from segmentation models will need to be flattened. - if utils.check_substrings_in_string(self.model_type, "segmentation"): - feature = feature.flatten(1, -1) - - feature_list.append(feature) - - # [D, N] - feature_bank = torch.cat(feature_list, dim=0).t().contiguous() - - # [N] - feature_labels = ( - torch.cat(target_list, dim=0).contiguous().to(feature_bank.device) - ) - - # Loop test data to predict the label by weighted KNN search. - test_bar = alive_it(self.loaders["test"]) - for batch in test_bar: - test_data: Tensor = batch["image"].to(self.device, non_blocking=True) - test_target: Tensor = torch.mode( - torch.flatten( - batch["mask"].to(self.device, non_blocking=True), start_dim=1 - ) - ).values - - # Get features from passing the input data through the model. - if utils.check_substrings_in_string(self.model_type, "siamese"): - # Checks that the model is of type ``MinervaSiamese`` so a call to `forward_single` will work. - if isinstance(self.model, MinervaDataParallel): # pragma: no cover - assert isinstance(self.model.model.module, MinervaSiamese) - else: - assert isinstance(self.model, MinervaSiamese) - - # Ensures that the data is parsed through a single head of the model rather than paired. - feature, _ = self.model.forward_single(test_data) # type: ignore[operator] - else: - feature, _ = self.model(test_data) - - # The masks from segmentation models will need to be flattened. - if utils.check_substrings_in_string(self.model_type, "segmentation"): - feature = feature.flatten(1, -1) - - total_num += batch_size - - # compute cos similarity between each feature vector and feature bank ---> [B, N] - sim_matrix = torch.mm(feature, feature_bank) - - # [B, K] - sim_weight, sim_indices = sim_matrix.topk(k=k, dim=-1) - - # [B, K] - sim_labels = torch.gather( - feature_labels.expand(test_data.size(0), -1), - dim=-1, - index=sim_indices, - ) - - sim_weight = (sim_weight / temp).exp() - - # Counts for each class - one_hot_label = torch.zeros( - test_data.size(0) * k, n_classes, device=sim_labels.device - ) - - # [B*K, C] - one_hot_label = one_hot_label.scatter( - dim=-1, index=sim_labels.view(-1, 1), value=1.0 - ) - - # Weighted score ---> [B, C] - pred_scores = torch.sum( - one_hot_label.view(test_data.size(0), -1, n_classes) - * sim_weight.unsqueeze(dim=-1), - dim=1, - ) - pred_scores = ptfunc.normalize( - pred_scores.nan_to_num(nan=0.0, posinf=1.0, neginf=0.0), - ) - - # Calculate loss between predicted and ground truth labels by KNN. - criterion = torch.nn.CrossEntropyLoss() - loss = criterion(pred_scores, test_target) - - # Pack results together for the logger. - results = (loss, pred_scores, test_target, _) - - # Gathers the losses across devices together if a distributed job. - if dist.is_available() and dist.is_initialized(): # pragma: no cover - loss = results[0].data.clone() - dist.all_reduce(loss.div_(dist.get_world_size())) - results = (loss, *results[1:]) - - # Sends results to logger. - epoch_logger.log(mode, self.step_num[mode], *results) - - # Update global step number for this mode of model fitting. - self.step_num[mode] += 1 - - # Send the logs to the metric logger. - self.metric_logger(mode, epoch_logger.get_logs) - - if record_int or record_float: - return epoch_logger.get_results - else: - return None + task(0) def close(self) -> None: """Closes the experiment, saving experiment parameters and model to file.""" @@ -1184,21 +750,6 @@ def close(self) -> None: with open(f"{self.exp_fn}.yml", "w") as outfile: yaml.dump(self.params, outfile) - # Writes the recorded training and validation metrics of the experiment to file. - self.print("\nSAVING METRICS TO FILE") - try: - sub_metrics = self.metric_logger.get_sub_metrics() - metrics_df = pd.DataFrame( - {key: sub_metrics[key]["y"] for key in sub_metrics.keys()} - ) - metrics_df["Epoch"] = sub_metrics["train_loss"]["x"] - metrics_df.set_index("Epoch", inplace=True, drop=True) - metrics_df.to_csv(f"{self.exp_fn}_metrics.csv") - - except (ValueError, KeyError) as err: # pragma: no cover - self.print(err) - self.print("\n*ERROR* in saving metrics to file.") - # Checks whether to save the model parameters to file. if self.params.get("save_model", False) in ( "opt", @@ -1227,25 +778,6 @@ def close(self) -> None: # Saves model state dict to PyTorch file. self.save_model_weights() - def compute_classification_report( - self, predictions: Sequence[int], labels: Sequence[int] - ) -> None: - """Creates and saves to file a classification report table of precision, recall, f-1 score and support. - - Args: - predictions (~typing.Sequence[int]): List of predicted labels. - labels (~typing.Sequence[int]): List of corresponding ground truth label masks. - """ - # Ensures predictions and labels are flattened. - preds: NDArray[Any, Int] = utils.batch_flatten(predictions) - targets: NDArray[Any, Int] = utils.batch_flatten(labels) - - # Uses utils to create a classification report in a DataFrame. - cr_df = utils.make_classification_report(preds, targets, self.params["classes"]) - - # Saves classification report DataFrame to a .csv file at fn. - cr_df.to_csv(f"{self.exp_fn}_classification-report.csv") - def extract_model_from_distributed(self) -> MinervaModel: """Extracts the actual model from any distributed wrapping if this is a distributed run. diff --git a/minerva/utils/utils.py b/minerva/utils/utils.py index 92d3141b4..120383c6b 100644 --- a/minerva/utils/utils.py +++ b/minerva/utils/utils.py @@ -69,6 +69,7 @@ "exist_delete_check", "mkexpdir", "check_dict_key", + "check_substrings_in_string", "datetime_reformat", "get_dataset_name", "transform_coordinates", @@ -105,6 +106,8 @@ "print_config", "tsne_cluster", "calc_norm_euc_dist", + "fallback_params", + "compile_dataset_paths", ] # ===================================================================================================================== @@ -113,6 +116,7 @@ # ---+ Inbuilt +------------------------------------------------------------------------------------------------------- import cmath import functools +import glob import importlib import inspect import math @@ -548,7 +552,7 @@ def exist_delete_check(fn: Union[str, Path]) -> None: """Checks if given file exists then deletes if true. Args: - fn (str): Path to file to have existence checked then deleted. + fn (str | ~pathlib.Path): Path to file to have existence checked then deleted. Returns: None @@ -1928,3 +1932,54 @@ def calc_norm_euc_dist( euc_dist: float = distance.euclidean(a, b) / float(len(a)) return euc_dist + + +def fallback_params( + key: str, + params_a: Dict[str, Any], + params_b: Dict[str, Any], + fallback: Optional[Any] = None, +) -> Any: + """Search for a value associated with ``key`` from + + Args: + key (str): _description_ + params_a (dict[str, ~typing.Any]): _description_ + params_b (dict[str, ~typing.Any]): _description_ + fallback (~typing.Any): Optional; _description_. Defaults to None. + + Returns: + ~typing.Any: _description_ + """ + if key in params_a: + return params_a[key] + elif key in params_b: + return params_b[key] + else: + return fallback + + +def compile_dataset_paths( + data_dir: Union[Path, str], + in_paths: Union[List[Union[Path, str]], Union[Path, str]], +) -> List[str]: + """Ensures that a list of paths is returned with the data directory prepended, even if a single string is supplied + + Args: + data_dir (~pathlib.Path | str): The parent data directory for all paths. + in_paths (list[~pathlib.Path | str] | [~pathlib.Path | str]): Paths to the data to be compilied. + + Returns: + list[str]: Compilied paths to the data. + """ + if isinstance(in_paths, list): + out_paths = [universal_path(data_dir) / path for path in in_paths] + else: + out_paths = [universal_path(data_dir) / in_paths] + + compiled_paths = [] + for path in out_paths: + compiled_paths.extend(glob.glob(str(path), recursive=True)) + + # For each path, get the absolute path, convert to string and return. + return [str(Path(path).absolute()) for path in compiled_paths] diff --git a/minerva/utils/visutils.py b/minerva/utils/visutils.py index baa6b38e9..6d82f8997 100644 --- a/minerva/utils/visutils.py +++ b/minerva/utils/visutils.py @@ -739,7 +739,7 @@ def seg_plot( y: Union[List[int], NDArray[Any, Any]], ids: List[str], bounds: Union[Sequence[Any], NDArray[Any, Any]], - mode: str, + task_name: str, classes: Dict[int, str], colours: Dict[int, str], fn_prefix: Union[str, Path], @@ -755,7 +755,7 @@ def seg_plot( bounds (list[~torchgeo.datasets.utils.BoundingBox] | ~numpy.ndarray[~torchgeo.datasets.utils.BoundingBox]): Array of objects describing a geospatial bounding box. Must contain ``minx``, ``maxx``, ``miny`` and ``maxy`` parameters. - mode (str): Mode samples are from. Must be ``'train'``, ``'val'`` or ``'test'``. + task_name (str): Name of the task that samples are from. classes (dict[int, str]): Dictionary mapping class labels to class names. colours (dict[int, str]): Dictionary mapping class labels to colours. fn_prefix (str | ~pathlib.Path): Common filename prefix (including path to file) for all plots of this type @@ -781,7 +781,9 @@ def seg_plot( flat_ids: NDArray[Any, Any] = np.array(ids).flatten() print("\nRE-CONSTRUCTING DATASET") - dataset, _ = make_dataset(CONFIG["dir"]["data"], CONFIG["dataset_params"][mode]) + dataset, _ = make_dataset( + CONFIG["dir"]["data"], CONFIG["tasks"][task_name]["dataset_params"] + ) # Create a new projection system in lat-lon. crs = dataset.crs @@ -1102,7 +1104,7 @@ def make_roc_curves( def plot_embedding( embeddings: Any, bounds: Union[Sequence[BoundingBox], NDArray[Any, Any]], - mode: str, + task_name: str, title: Optional[str] = None, show: bool = False, save: bool = True, @@ -1115,7 +1117,7 @@ def plot_embedding( bounds (~typing.Sequence[~torchgeo.datasets.utils.BoundingBox] | ~numpy.ndarray[~torchgeo.datasets.utils.BoundingBox]): # noqa: E501 Array of objects describing a geospatial bounding box. Must contain ``minx``, ``maxx``, ``miny`` and ``maxy`` parameters. - mode (str): Mode samples are from. Must be ``'train'``, ``'val'`` or ``'test'``. + task_name (str): Name of the task that the samples are from. title (str): Optional; Title of plot. show (bool): Optional; Whether to show plot. save (bool): Optional; Whether to save plot to file. @@ -1132,7 +1134,9 @@ def plot_embedding( from minerva.datasets import make_dataset print("\nRE-CONSTRUCTING DATASET") - dataset, _ = make_dataset(CONFIG["dir"]["data"], CONFIG["dataset_params"][mode]) + dataset, _ = make_dataset( + CONFIG["dir"]["data"], CONFIG["tasks"][task_name]["dataset_params"] + ) images = [] targets = [] @@ -1248,7 +1252,7 @@ def plot_results( y: Optional[Union[List[int], NDArray[Any, Int]]] = None, metrics: Optional[Dict[str, Any]] = None, ids: Optional[List[str]] = None, - mode: str = "test", + task_name: str = "test", bounds: Optional[NDArray[Any, Any]] = None, probs: Optional[Union[List[float], NDArray[Any, Float]]] = None, embeddings: Optional[NDArray[Any, Any]] = None, @@ -1270,7 +1274,7 @@ def plot_results( the performance of a model. ids (list[str]): Optional; List of IDs defining the origin of samples to the model. Maybe either patch IDs or scene tags. - mode (str): Optional; Mode samples are from. Must be ``'train'``, ``'val'`` or ``'test'``. + task_name (str): Optional; Name of task that samples are from. bounds (~numpy.ndarray[~torchgeo.datasets.utils.BoundingBox]): Optional; Array of objects describing a geospatial bounding box for each sample. Must contain ``minx``, ``maxx``, ``miny`` and ``maxy`` parameters. @@ -1388,7 +1392,7 @@ def plot_results( assert y is not None assert ids is not None assert bounds is not None - assert mode is not None + assert task_name is not None figsize = None if DATA_CONFIG is not None: @@ -1401,7 +1405,7 @@ def plot_results( y, ids, flat_bbox, - mode, + task_name, fn_prefix=filenames["Mask"], classes=class_names, colours=colours, @@ -1411,13 +1415,13 @@ def plot_results( if plots.get("TSNE", False): assert embeddings is not None assert bounds is not None - assert mode is not None + assert task_name is not None print("\nPERFORMING TSNE CLUSTERING") plot_embedding( embeddings, bounds, - mode, + task_name, show=show, save=save, filename=filenames["TSNE"], diff --git a/qodana.sarif.json b/qodana.sarif.json deleted file mode 100644 index bbb604631..000000000 --- a/qodana.sarif.json +++ /dev/null @@ -1,27545 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/schemastore/schemastore/master/src/schemas/json/sarif-2.1.0-rtm.5.json", - "version": "2.1.0", - "runs": [ - { - "tool": { - "driver": { - "name": "QDPY", - "fullName": "Qodana for Python", - "version": "232.9876.134", - "rules": [], - "taxa": [ - { - "id": "Python", - "name": "Python" - }, - { - "id": "EditorConfig", - "name": "EditorConfig" - }, - { - "id": "JavaScript and TypeScript", - "name": "JavaScript and TypeScript" - }, - { - "id": "JavaScript and TypeScript/Control flow issues", - "name": "Control flow issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Google App Engine (Python)", - "name": "Google App Engine (Python)" - }, - { - "id": "PostCSS", - "name": "PostCSS" - }, - { - "id": "Sass/SCSS", - "name": "Sass/SCSS" - }, - { - "id": "Shell script", - "name": "Shell script" - }, - { - "id": "JavaScript and TypeScript/Unit testing", - "name": "Unit testing", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSON and JSON5", - "name": "JSON and JSON5" - }, - { - "id": "MongoJS", - "name": "MongoJS" - }, - { - "id": "JavaScript and TypeScript/Code style issues", - "name": "Code style issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/General", - "name": "General", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MySQL", - "name": "MySQL" - }, - { - "id": "Properties files", - "name": "Properties files" - }, - { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "name": "Potentially undesirable code constructs", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Flow type checker", - "name": "Flow type checker", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Probable bugs", - "name": "Probable bugs", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HTML", - "name": "HTML" - }, - { - "id": "JavaScript and TypeScript/Unused symbols", - "name": "Unused symbols", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Data flow", - "name": "Data flow", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Django", - "name": "Django" - }, - { - "id": "JavaScript and TypeScript/Bitwise operation issues", - "name": "Bitwise operation issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "name": "ES2015 migration aids", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "General", - "name": "General" - }, - { - "id": "HTML/Accessibility", - "name": "Accessibility", - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/React", - "name": "React", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/TypeScript", - "name": "TypeScript", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Validity issues", - "name": "Validity issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "name": "Potentially confusing code constructs", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CSS", - "name": "CSS" - }, - { - "id": "CSS/Invalid elements", - "name": "Invalid elements", - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SQL", - "name": "SQL" - }, - { - "id": "JavaScript and TypeScript/Try statement issues", - "name": "Try statement issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Structural search", - "name": "Structural search" - }, - { - "id": "JavaScript and TypeScript/Function metrics", - "name": "Function metrics", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Dependency analysis", - "name": "Dependency analysis" - }, - { - "id": "YAML", - "name": "YAML" - }, - { - "id": "XML", - "name": "XML" - }, - { - "id": "JavaScript and TypeScript/Assignment issues", - "name": "Assignment issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Security", - "name": "Security" - }, - { - "id": "CSS/Code style issues", - "name": "Code style issues", - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Less", - "name": "Less" - }, - { - "id": "RegExp", - "name": "RegExp" - }, - { - "id": "Vue", - "name": "Vue" - }, - { - "id": "JavaScript and TypeScript/Node.js", - "name": "Node.js", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Ini files", - "name": "Ini files" - }, - { - "id": "JavaScript and TypeScript/Imports and dependencies", - "name": "Imports and dependencies", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RELAX NG", - "name": "RELAX NG" - }, - { - "id": "CSS/Probable bugs", - "name": "Probable bugs", - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Naming conventions", - "name": "Naming conventions", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Switch statement issues", - "name": "Switch statement issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/DOM issues", - "name": "DOM issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Async code and promises", - "name": "Async code and promises", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Code quality tools", - "name": "Code quality tools", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Code Coverage", - "name": "Code Coverage" - }, - { - "id": "Proofreading", - "name": "Proofreading" - }, - { - "id": "Jupyter", - "name": "Jupyter" - }, - { - "id": "CSS/Code quality tools", - "name": "Code quality tools", - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PostgreSQL", - "name": "PostgreSQL" - }, - { - "id": "SQL server", - "name": "SQL server" - }, - { - "id": "Qodana", - "name": "Qodana" - }, - { - "id": "Pyramid", - "name": "Pyramid" - }, - { - "id": "Oracle", - "name": "Oracle" - }, - { - "id": "Internationalization", - "name": "Internationalization" - }, - { - "id": "Version control", - "name": "Version control" - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - "extensions": [ - { - "name": "Pythonid", - "version": "232.9876", - "rules": [ - { - "id": "PyPandasSeriesToListInspection", - "shortDescription": { - "text": "Method Series.to_list() is recommended" - }, - "fullDescription": { - "text": "Reports redundant 'list' in 'list(Series.values)' statement for pandas and polars libraries. Such 'Series' values extraction can be replaced with the 'to_list()' function call. Example: list(df['column'].values)\n When the quick-fix is applied, the code changes to: df['column'].to_list()", - "markdown": "Reports redundant `list` in `list(Series.values)` statement for pandas and polars libraries.\nSuch `Series` values extraction can be replaced with the `to_list()` function call.\n\n**Example:**\n\n```\nlist(df['column'].values)\n```\n\nWhen the quick-fix is applied, the code changes to:\n\n```\ndf['column'].to_list()\n```" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyPackages", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PySetFunctionToLiteralInspection", - "shortDescription": { - "text": "Function call can be replaced with set literal" - }, - "fullDescription": { - "text": "Reports calls to the 'set' function that can be replaced with the 'set' literal. Example: 'def do_mult(a, b):\n c = a * b\n return set([c, a, b])' When the quick-fix is applied, the code changes to: 'def do_mult(a, b):\n c = a * b\n return {c, a, b}'", - "markdown": "Reports calls to the `set` function that can be replaced with\nthe `set` literal.\n\n**Example:**\n\n\n def do_mult(a, b):\n c = a * b\n return set([c, a, b])\n\nWhen the quick-fix is applied, the code changes to:\n\n\n def do_mult(a, b):\n c = a * b\n return {c, a, b}\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PySetFunctionToLiteral", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Query_index_required", - "shortDescription": { - "text": "Query does not have the required index" - }, - "fullDescription": { - "text": "Reports GQL queries for which an index is not defined in 'index.yaml'. Such queries will fail on the production server. The quick-fix allows you to add the necessary index definitions.", - "markdown": "Reports GQL queries for which an index is not defined in `index.yaml`.\nSuch queries will fail on the production server.\nThe quick-fix allows you to add the necessary index definitions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "Query_index_required", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Google App Engine (Python)", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyInitNewSignatureInspection", - "shortDescription": { - "text": "Incompatible signatures of __new__ and __init__" - }, - "fullDescription": { - "text": "Reports incompatible signatures of the '__new__' and '__init__' methods. Example: 'class MyClass(object):\n def __new__(cls, arg1):\n return super().__new__(cls)\n\n def __init__(self):\n pass' If the '__new__' and '__init__' have different arguments, then the 'MyClass' cannot be instantiated. As a fix, the IDE offers to apply the Change Signature refactoring.", - "markdown": "Reports incompatible signatures of the `__new__` and `__init__` methods.\n\n**Example:**\n\n\n class MyClass(object):\n def __new__(cls, arg1):\n return super().__new__(cls)\n\n def __init__(self):\n pass\n\nIf the `__new__` and `__init__` have different arguments, then the `MyClass`\ncannot be instantiated.\n\nAs a fix, the IDE offers to apply the Change Signature refactoring." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyInitNewSignature", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EndBlockNamesInspection", - "shortDescription": { - "text": "Django endblock name doesn't match the block name" - }, - "fullDescription": { - "text": "Reports incorrect names of the closing blocks. Example: '{% block my_block %}\n {% endblock not_correct %}'", - "markdown": "Reports incorrect names of the closing blocks.\n\n**Example:**\n\n\n {% block my_block %}\n {% endblock not_correct %}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EndBlockNamesInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMissingConstructorInspection", - "shortDescription": { - "text": "Missed call to '__init__' of the super class" - }, - "fullDescription": { - "text": "Reports cases when a call to the 'super' constructor in a class is missed. Example: 'class Fruit:\n def __init__(self):\n pass\n\n\nclass Pear(Fruit):\n def __init__(self):\n pass' The 'Pear' class should have a 'super' call in the '__init__' method. When the quick-fix is applied, the code changes to: 'class Fruit:\n def __init__(self):\n pass\n\n\nclass Pear(Fruit):\n def __init__(self):\n super().__init__()'", - "markdown": "Reports cases when a call to the `super` constructor in a class is missed.\n\n**Example:**\n\n\n class Fruit:\n def __init__(self):\n pass\n\n\n class Pear(Fruit):\n def __init__(self):\n pass\n\nThe `Pear` class should have a `super` call in the `__init__`\nmethod.\n\nWhen the quick-fix is applied, the code changes to:\n\n\n class Fruit:\n def __init__(self):\n pass\n\n\n class Pear(Fruit):\n def __init__(self):\n super().__init__()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyMissingConstructor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PySimplifyBooleanCheckInspection", - "shortDescription": { - "text": "Redundant boolean variable check" - }, - "fullDescription": { - "text": "Reports equality comparison with a boolean literal. Example: 'def func(s):\n if s.isdigit() == True:\n return int(s)' With the quick-fix applied, the code fragment will be simplified to: 'def func(s):\n if s.isdigit():\n return int(s)'", - "markdown": "Reports equality comparison with a boolean literal.\n\n**Example:**\n\n\n def func(s):\n if s.isdigit() == True:\n return int(s)\n\nWith the quick-fix applied, the code fragment will be simplified to:\n\n\n def func(s):\n if s.isdigit():\n return int(s)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PySimplifyBooleanCheck", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyCallingNonCallableInspection", - "shortDescription": { - "text": "Attempt to call a non-callable object" - }, - "fullDescription": { - "text": "Reports a problem when you are trying to call objects that are not callable, like, for example, properties: Example: 'class Record:\n @property\n def as_json(self):\n\njson = Record().as_json()'", - "markdown": "Reports a problem when you are trying\nto call objects that are not callable, like, for example, properties:\n\n**Example:**\n\n\n class Record:\n @property\n def as_json(self):\n\n json = Record().as_json()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyCallingNonCallable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyUnreachableCodeInspection", - "shortDescription": { - "text": "Unreachable code" - }, - "fullDescription": { - "text": "Reports code fragments that cannot be normally reached. Example: 'if True:\n print('Yes')\nelse:\n print('No')' As a fix, you might want to check and modify the algorithm to ensure it implements the expected logic.", - "markdown": "Reports code fragments that cannot be normally reached.\n\n**Example:**\n\n\n if True:\n print('Yes')\n else:\n print('No')\n\nAs a fix, you might want to check and modify the algorithm to ensure it implements\nthe expected logic." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyUnreachableCode", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyChainedComparisonsInspection", - "shortDescription": { - "text": "Too complex chained comparisons" - }, - "fullDescription": { - "text": "Reports chained comparisons that can be simplified. Example: 'def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass' The IDE offers to simplify 'if x >= xmin and x <= xmax'. When the quick-fix is applied, the code changes to: 'def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass'", - "markdown": "Reports chained comparisons that can be simplified.\n\n**Example:**\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass\n\nThe IDE offers to simplify `if x >= xmin and x <= xmax`.\nWhen the quick-fix is applied, the code changes to:\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyChainedComparisons", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoBrokenLineCommentInspection", - "shortDescription": { - "text": "Broken line comment" - }, - "fullDescription": { - "text": "Reports '#}' line comment ends in Django templates that do not have a matching line comment start. Example: 'comment #}' The IDE highlights '#}' as it requires the corresponding '{#' token.", - "markdown": "Reports `#}` line comment ends in Django templates that do not have a\nmatching line comment start.\n\n**Example:**\n\n\n comment #}\n\nThe IDE highlights `#}` as it requires the corresponding `{#` token." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoBrokenLineCommentInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyCompatibilityInspection", - "shortDescription": { - "text": "Code is incompatible with specific Python versions" - }, - "fullDescription": { - "text": "Reports incompatibility with the specified versions of Python. Enable this inspection if you need your code to be compatible with a range of Python versions, for example, if you are building a library. To define the range of the inspected Python versions, select the corresponding checkboxes in the Options section. For more information about the Python versions supported by the IDE, see the web help.", - "markdown": "Reports incompatibility with the specified versions of Python.\nEnable this inspection if you need your code to be compatible with a range of Python versions, for example,\nif you are building a library.\n\nTo define the range of the inspected Python versions, select the corresponding checkboxes in the **Options**\nsection.\n\nFor more information about the Python versions supported by the IDE, see the\n[web help](https://www.jetbrains.com/help/pycharm/python.html#support)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyCompatibility", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyGlobalUndefinedInspection", - "shortDescription": { - "text": "Global variable is not defined at the module level" - }, - "fullDescription": { - "text": "Reports problems when a variable defined through the 'global' statement is not defined in the module scope. Example: 'def foo():\n global bar\n print(bar)\n\nfoo()' As a fix, you can move the global variable declaration: 'global bar\n\n\ndef foo():\n print(bar)'", - "markdown": "Reports problems when a variable defined through the `global`\nstatement is not defined in the module scope.\n\n**Example:**\n\n\n def foo():\n global bar\n print(bar)\n\n foo()\n\nAs a fix, you can move the global variable declaration:\n\n\n global bar\n\n\n def foo():\n print(bar)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyGlobalUndefined", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyProtocolInspection", - "shortDescription": { - "text": "Invalid protocol definitions and usages" - }, - "fullDescription": { - "text": "Reports invalid definitions and usages of protocols introduced in PEP-544. Example: 'from typing import Protocol\n\n\nclass MyProtocol(Protocol):\n def method(self, p: int) -> str:\n pass\n\n\nclass MyClass(MyProtocol):\n def method(self, p: str) -> int: # Type of 'method' is not compatible with 'MyProtocol'\n pass\n\n\nclass MyAnotherProtocol(MyClass, Protocol): # All bases of a protocol must be protocols\n pass'", - "markdown": "Reports invalid definitions and usages of protocols introduced in\n[PEP-544](https://www.python.org/dev/peps/pep-0544/).\n\n**Example:**\n\n\n from typing import Protocol\n\n\n class MyProtocol(Protocol):\n def method(self, p: int) -> str:\n pass\n\n\n class MyClass(MyProtocol):\n def method(self, p: str) -> int: # Type of 'method' is not compatible with 'MyProtocol'\n pass\n\n\n class MyAnotherProtocol(MyClass, Protocol): # All bases of a protocol must be protocols\n pass\n\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyProtocol", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTypeHintsInspection", - "shortDescription": { - "text": "Invalid type hints definitions and usages" - }, - "fullDescription": { - "text": "Reports invalid usages of type hints. Example: 'from typing import TypeVar\n\nT0 = TypeVar('T1') # Argument of 'TypeVar' must be 'T0'\n\n\ndef b(p: int) -> int: # Type specified both in a comment and annotation\n # type: (int) -> int\n pass\n\n\ndef c(p1, p2): # Type signature has too many arguments\n # type: (int) -> int\n pass' Available quick-fixes offer various actions. You can rename, remove, or move problematic elements. You can also manually modify type declarations to ensure no warning is shown.", - "markdown": "Reports invalid usages of type hints.\n\n**Example:**\n\n\n from typing import TypeVar\n\n T0 = TypeVar('T1') # Argument of 'TypeVar' must be 'T0'\n\n\n def b(p: int) -> int: # Type specified both in a comment and annotation\n # type: (int) -> int\n pass\n\n\n def c(p1, p2): # Type signature has too many arguments\n # type: (int) -> int\n pass\n\nAvailable quick-fixes offer various actions. You can rename, remove, or move problematic elements. You can also manually modify type declarations to ensure no warning is shown." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTypeHints", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMethodMayBeStaticInspection", - "shortDescription": { - "text": "Method is not declared static" - }, - "fullDescription": { - "text": "Reports any methods that do not require a class instance creation and can be made static. Example: 'class MyClass(object):\n def my_method(self, x):\n print(x)' If a Make function from method quick-fix is applied, the code changes to: 'def my_method(x):\n print(x)\n\n\nclass MyClass(object):\n pass' If you select the Make method static quick-fix, the '@staticmethod' decorator is added: 'class MyClass(object):\n @staticmethod\n def my_method(x):\n print(x)'", - "markdown": "Reports any methods that do not require a class instance creation and can be\nmade static.\n\n**Example:**\n\n\n class MyClass(object):\n def my_method(self, x):\n print(x)\n\nIf a **Make function from method** quick-fix is applied, the code changes to:\n\n\n def my_method(x):\n print(x)\n\n\n class MyClass(object):\n pass\n\nIf you select the **Make method static** quick-fix, the `@staticmethod` decorator is added:\n\n\n class MyClass(object):\n @staticmethod\n def my_method(x):\n print(x)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyMethodMayBeStatic", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CythonUsageBeforeDeclarationInspection", - "shortDescription": { - "text": "Cython variable is used before its declaration" - }, - "fullDescription": { - "text": "Reports Cython variables being referenced before declaration. Example: 'cdef int c_x\n\nprint(c_x, c_y) # Variable 'c_y' is used before its declaration\n\ncdef int c_y = 0'", - "markdown": "Reports Cython variables being referenced before declaration.\n\n**Example:**\n\n\n cdef int c_x\n\n print(c_x, c_y) # Variable 'c_y' is used before its declaration\n\n cdef int c_y = 0\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "CythonUsageBeforeDeclaration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDictCreationInspection", - "shortDescription": { - "text": "Dictionary creation can be rewritten by dictionary literal" - }, - "fullDescription": { - "text": "Reports situations when you can rewrite dictionary creation by using a dictionary literal. This approach brings performance improvements. Example: 'dic = {}\ndic['var'] = 1' When the quick-fix is applied, the code changes to: 'dic = {'var': 1}'", - "markdown": "Reports situations when you can rewrite dictionary creation\nby using a dictionary literal.\n\nThis approach brings performance improvements.\n\n**Example:**\n\n\n dic = {}\n dic['var'] = 1\n\nWhen the quick-fix is applied, the code changes to:\n\n\n dic = {'var': 1}\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyDictCreation", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyStringFormatInspection", - "shortDescription": { - "text": "Errors in string formatting operations" - }, - "fullDescription": { - "text": "Reports errors in string formatting operations. Example 1: '\"Hello {1}\".format(\"people\")' Example 2: 'def bar():\n return 1\n\n\n\"%s %s\" % bar()' As a fix, you need to rewrite string formatting fragments to adhere to the formatting syntax.", - "markdown": "Reports errors in string formatting operations.\n\n**Example 1:**\n\n\n \"Hello {1}\".format(\"people\")\n\n**Example 2:**\n\n\n def bar():\n return 1\n\n\n \"%s %s\" % bar()\n\nAs a fix, you need to rewrite string formatting fragments to\nadhere to the [formatting syntax](https://docs.python.org/3/library/string.html#format-string-syntax)." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyStringFormat", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyExceptionInheritInspection", - "shortDescription": { - "text": "Exceptions do not inherit from standard 'Exception' class" - }, - "fullDescription": { - "text": "Reports cases when a custom exception class is raised but does not inherit from the builtin Exception class. Example: 'class A:\n pass\n\n\ndef me_exception():\n raise A()' The proposed quick-fix changes the code to: 'class A(Exception):\n pass\n\n\ndef me_exception():\n raise A()'", - "markdown": "Reports cases when a custom exception class is\nraised but does not inherit from the\n[builtin Exception class](https://docs.python.org/3/library/exceptions.html).\n\n**Example:**\n\n\n class A:\n pass\n\n\n def me_exception():\n raise A()\n\nThe proposed quick-fix changes the code to:\n\n\n class A(Exception):\n pass\n\n\n def me_exception():\n raise A()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyExceptionInherit", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAssignmentToLoopOrWithParameterInspection", - "shortDescription": { - "text": "Assignments to 'for' loop or 'with' statement parameter" - }, - "fullDescription": { - "text": "Reports the cases when you rewrite a loop variable with an inner loop. Example: 'for i in range(5):\n for i in range(20, 25):\n print(\"Inner\", i)\n print(\"Outer\", i)' It also warns you if a variable declared in the 'with' statement is redeclared inside the statement body: 'with open(\"file\") as f:\n f.read()\n with open(\"file\") as f:'", - "markdown": "Reports the cases when you rewrite a loop variable with an inner loop.\n\n**Example:**\n\n\n for i in range(5):\n for i in range(20, 25):\n print(\"Inner\", i)\n print(\"Outer\", i)\n \nIt also warns you if a variable declared in the `with` statement is redeclared inside the statement body:\n\n\n with open(\"file\") as f:\n f.read()\n with open(\"file\") as f:\n \n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyAssignmentToLoopOrWithParameter", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoUnresolvedFilterInspection", - "shortDescription": { - "text": "Unresolved filter" - }, - "fullDescription": { - "text": "Reports unresolved filters in Django templates. Example: '{{ my_value|cool_filter:\"arg\" }}'", - "markdown": "Reports unresolved filters in Django templates.\n\n**Example:**\n\n\n {{ my_value|cool_filter:\"arg\" }}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoUnresolvedFilterInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "AppEngineThreadsafeCGIHandlerInspection", - "shortDescription": { - "text": "Threadsafe cannot be enabled with the CGI handler" - }, - "fullDescription": { - "text": "Reports cases when threadsafe is not enabled with the CGI handler.", - "markdown": "Reports cases when threadsafe is not enabled with the CGI handler." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "AppEngineThreadsafeCGIHandler", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Google App Engine (Python)", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoUnresolvedTagInspection", - "shortDescription": { - "text": "Unresolved tag" - }, - "fullDescription": { - "text": "Reports unresolved tags in Django templates. Example: '

{{ question.question_text }}

\n' The IDE highlights ''. You can either remove the tag or apply the quick-fix to add '' to custom HTML tags.", - "markdown": "Reports unresolved tags in Django templates.\n\n**Example:**\n\n\n

{{ question.question_text }}

\n \n\nThe IDE highlights ``. You can either remove the tag or apply the quick-fix to\nadd `` to custom HTML tags." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoUnresolvedTagInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PySuperArgumentsInspection", - "shortDescription": { - "text": "Wrong arguments to call super" - }, - "fullDescription": { - "text": "Reports cases when any call to 'super(A, B)' does not meet the following requirements: 'B' is an instance of 'A' 'B' a subclass of 'A' Example: 'class Figure:\n def color(self):\n pass\n\n\nclass Rectangle(Figure):\n def color(self):\n pass\n\n\nclass Square(Figure):\n def color(self):\n return super(Rectangle, self).color() # Square is not an instance or subclass of Rectangle' As a fix, you can make the 'Square' an instance of the 'Rectangle' class.", - "markdown": "Reports cases when any call to `super(A, B)` does not meet the\nfollowing requirements:\n\n* `B` is an instance of `A`\n* `B` a subclass of `A`\n\n**Example:**\n\n\n class Figure:\n def color(self):\n pass\n\n\n class Rectangle(Figure):\n def color(self):\n pass\n\n\n class Square(Figure):\n def color(self):\n return super(Rectangle, self).color() # Square is not an instance or subclass of Rectangle\n\nAs a fix, you can make the `Square` an instance of the `Rectangle` class." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PySuperArguments", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoOrmInspection", - "shortDescription": { - "text": "Django ORM error" - }, - "fullDescription": { - "text": "Reports several methods that may not be called due to some ORM reasons. Example: 'class Choice:\n question = ForeignKey(Question, null=False)\n\n\nchoice_set = Question.objects.get(id=1).choice_set.remove()' The 'remove' function can not be called if the foreign key has 'null=False'.", - "markdown": "Reports several methods that may not be called due to some ORM reasons.\n\n**Example:**\n\n\n class Choice:\n question = ForeignKey(Question, null=False)\n\n\n choice_set = Question.objects.get(id=1).choice_set.remove()\n\nThe `remove` function can not be called if the foreign key has `null=False`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoOrm", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoUnresolvedTemplateReferenceInspection", - "shortDescription": { - "text": "Unresolved template reference" - }, - "fullDescription": { - "text": "Reports unresolved file references in string literals of 'extends'> and 'include'> Django tags. Example: '{% extends \"../DjangoApp/templatetags/base.html\"%}' In this example, the 'base.html' tag is highlighted, because it is not available in the specified location.", - "markdown": "Reports unresolved file references in string literals of\n`extends`\\> and `include`\\> Django tags.\n\n**Example:**\n\n\n {% extends \"../DjangoApp/templatetags/base.html\"%}\n\nIn this example, the `base.html` tag is highlighted, because it is not available in the\nspecified location." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoUnresolvedTemplateReferenceInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyNonAsciiCharInspection", - "shortDescription": { - "text": "File contains non-ASCII character" - }, - "fullDescription": { - "text": "Reports cases in Python 2 when a file contains non-ASCII characters and does not have an encoding declaration at the top. Example: 'class A(object):\n# №5\n def __init__(self):\n pass' In this example, the IDE reports a non-ASCII symbol in a comment and a lack of encoding declaration. Apply the proposed quick-fix to add a missing encoding declaration: '# coding=utf-8\nclass A(object)\n# №5\n def __init__(self):\n pass'", - "markdown": "Reports cases in Python 2 when a file contains non-ASCII characters and does not\nhave an encoding declaration at the top.\n\n**Example:**\n\n\n class A(object):\n # №5\n def __init__(self):\n pass\n\nIn this example, the IDE reports a non-ASCII symbol in a comment and a lack of encoding\ndeclaration. Apply the proposed quick-fix to add a missing encoding declaration:\n\n\n # coding=utf-8\n class A(object)\n # №5\n def __init__(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyNonAsciiChar", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAbstractClassInspection", - "shortDescription": { - "text": "Class must implement all abstract methods" - }, - "fullDescription": { - "text": "Reports cases when not all abstract properties or methods are defined in a subclass. Example: 'from abc import abstractmethod, ABC\n\n\nclass Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\nclass Triangle(Figure):\n def do_triangle(self):\n pass' When the quick-fix is applied, the IDE implements an abstract method for the 'Triangle' class: 'from abc import abstractmethod, ABC\n\n\nclass Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\nclass Triangle(Figure):\n def do_figure(self):\n pass\n\n def do_triangle(self):\n pass'", - "markdown": "Reports cases when not all abstract properties or methods are defined in\na subclass.\n\n**Example:**\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_triangle(self):\n pass\n\nWhen the quick-fix is applied, the IDE implements an abstract method for the `Triangle` class:\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_figure(self):\n pass\n\n def do_triangle(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyAbstractClass", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyOldStyleClassesInspection", - "shortDescription": { - "text": "Old-style class contains new-style class features" - }, - "fullDescription": { - "text": "Reports occurrences of new-style class features in old-style classes. The inspection highlights '__slots__', '__getattribute__', and 'super()' inside old-style classes.", - "markdown": "Reports occurrences of\n[new-style class features](https://www.python.org/doc/newstyle/)\nin old-style classes. The inspection highlights\n`__slots__`, `__getattribute__`, and `super()`\ninside old-style classes." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyOldStyleClasses", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoIncompatibleInspection", - "shortDescription": { - "text": "Incompatible code in Django templates" - }, - "fullDescription": { - "text": "Reports features that are not available in the current Django version. Example: '{% if my_var is True %}\n{% endif %}' Available since 1.10. The IDE shows warning when discovered in the earlier versions.", - "markdown": "Reports features that are not available in the current Django version.\n\n**Example:**\n\n\n {% if my_var is True %}\n {% endif %}\n\nAvailable since 1.10. The IDE shows warning when discovered in the earlier versions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoIncompatibleInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Query_bound_parameters", - "shortDescription": { - "text": "Query does not have required bound parameters" - }, - "fullDescription": { - "text": "Reports GQL queries with bound parameters that don't have the necessary parameters passed to the query method call.", - "markdown": "Reports GQL queries with bound parameters that don't have the necessary\nparameters passed to the query method call." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "Query_bound_parameters", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Google App Engine (Python)", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyBroadExceptionInspection", - "shortDescription": { - "text": "Unclear exception clauses" - }, - "fullDescription": { - "text": "Reports exception clauses that do not provide specific information about the problem. Example: Clauses that do not specify an exception class Clauses that are specified as 'Exception'", - "markdown": "Reports exception clauses that do not provide specific information\nabout the problem.\n\n**Example:**\n\n* Clauses that do not specify an exception class\n* Clauses that are specified as `Exception`" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyBroadException", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTypeCheckerInspection", - "shortDescription": { - "text": "Incorrect type" - }, - "fullDescription": { - "text": "Reports type errors in function call expressions, targets, and return values. In a dynamically typed language, this is possible in a limited number of cases. Types of function parameters can be specified in docstrings or in Python 3 function annotations. Example: 'def foo() -> int:\n return \"abc\" # Expected int, got str\n\n\na: str\na = foo() # Expected str, got int' With the quick-fix, you can modify the problematic types: 'def foo() -> str:\n return \"abc\"\n\n\na: str\na = foo()'", - "markdown": "Reports type errors in function call expressions, targets, and return values. In a dynamically typed language, this is possible in a limited number of cases.\n\nTypes of function parameters can be specified in\ndocstrings or in Python 3 function annotations.\n\n**Example:**\n\n\n def foo() -> int:\n return \"abc\" # Expected int, got str\n\n\n a: str\n a = foo() # Expected str, got int\n\nWith the quick-fix, you can modify the problematic types:\n\n\n def foo() -> str:\n return \"abc\"\n\n\n a: str\n a = foo()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTypeChecker", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyByteLiteralInspection", - "shortDescription": { - "text": "A byte literal contains a non-ASCII character" - }, - "fullDescription": { - "text": "Reports characters in byte literals that are outside ASCII range. Example: 's = b'№5''", - "markdown": "Reports characters in byte literals that are outside ASCII range.\n\n**Example:**\n\n\n s = b'№5'\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyByteLiteral", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAugmentAssignmentInspection", - "shortDescription": { - "text": "Assignment can be replaced with augmented assignment" - }, - "fullDescription": { - "text": "Reports assignments that can be replaced with augmented assignments. Example: 'a = 23\nb = 3\na = a + b' After the quick-fix is applied, the code changes to: 'a = 23\nb = 3\na += b'", - "markdown": "Reports assignments that can be replaced with augmented assignments.\n\n**Example:**\n\n\n a = 23\n b = 3\n a = a + b\n\nAfter the quick-fix is applied, the code changes to:\n\n\n a = 23\n b = 3\n a += b\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "PyAugmentAssignment", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDeprecationInspection", - "shortDescription": { - "text": "Deprecated function, class, or module" - }, - "fullDescription": { - "text": "Reports usages of Python functions, or methods that are marked as deprecated and raise the 'DeprecationWarning' or 'PendingDeprecationWarning' warning. Also, this inspection highlights usages of 'abc.abstractstaticmethod', 'abc.abstractproperty', and 'abc.abstractclassmethod' decorators. Example: 'class Foo:\n @property\n def bar(self):\n import warnings\n warnings.warn(\"this is deprecated\", DeprecationWarning, 2)\n return 5\n\n\nfoo = Foo()\nprint(foo.bar)'", - "markdown": "Reports usages of Python functions, or methods that are marked as\ndeprecated and raise the `DeprecationWarning` or `PendingDeprecationWarning` warning.\n\nAlso, this inspection highlights usages of `abc.abstractstaticmethod`, `abc.abstractproperty`, and `abc.abstractclassmethod`\ndecorators.\n\n**Example:**\n\n\n class Foo:\n @property\n def bar(self):\n import warnings\n warnings.warn(\"this is deprecated\", DeprecationWarning, 2)\n return 5\n\n\n foo = Foo()\n print(foo.bar)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDeprecation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyUnnecessaryBackslashInspection", - "shortDescription": { - "text": "Unnecessary backslash" - }, - "fullDescription": { - "text": "Reports backslashes in places where line continuation is implicit inside '()', '[]', and '{}'. Example: 'a = ('first', \\\n 'second', 'third')' When the quick-fix is applied, the redundant backslash is deleted.", - "markdown": "Reports backslashes in places where line continuation is implicit inside `()`,\n`[]`, and `{}`.\n\n**Example:**\n\n\n a = ('first', \\\n 'second', 'third')\n\nWhen the quick-fix is applied, the redundant backslash is deleted." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyUnnecessaryBackslash", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyShadowingNamesInspection", - "shortDescription": { - "text": "Shadowing names from outer scopes" - }, - "fullDescription": { - "text": "Reports shadowing names defined in outer scopes. Example: 'def outer(p):\n def inner(p):\n pass' As a quick-fix, the IDE offers to remove a parameter or rename it.", - "markdown": "Reports shadowing names defined in outer scopes.\n\n**Example:**\n\n\n def outer(p):\n def inner(p):\n pass\n\nAs a quick-fix, the IDE offers to remove a parameter or rename it." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyShadowingNames", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyFinalInspection", - "shortDescription": { - "text": "Invalid usages of final classes, methods, and variables" - }, - "fullDescription": { - "text": "Reports invalid usages of final classes, methods and variables. Example: 'from typing import final\n\n\n@final\nclass A:\n def a_method(self):\n pass\n\n\nclass B(A):\n def a_method(self):\n pass'", - "markdown": "Reports invalid usages of final classes,\nmethods and variables.\n\n**Example:**\n\n\n from typing import final\n\n\n @final\n class A:\n def a_method(self):\n pass\n\n\n class B(A):\n def a_method(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyFinal", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoCloseTagInspection", - "shortDescription": { - "text": "Mismatched opening and closing tags" - }, - "fullDescription": { - "text": "Reports cases when opening tags in Django templates are not correctly matched by closing tags. Example: '{% if error_message %}

{{ error_message }}

{% endif %}' The IDE reports an error on the 'strong' tag not being closed.", - "markdown": "Reports cases when opening tags in Django templates are not correctly matched by closing tags.\n\n**Example:**\n\n\n {% if error_message %}

{{ error_message }}

{% endif %}\n\nThe IDE reports an error on the `strong` tag not being closed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoCloseTagInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PySingleQuotedDocstringInspection", - "shortDescription": { - "text": "Single quoted docstring" - }, - "fullDescription": { - "text": "Reports docstrings that do not adhere to the triple double-quoted string format. Example: 'def calc(self, balance=0):\n 'param: balance'\n self.balance = balance' When the quick-fix is applied, the code changes to: 'def calc(self, balance=0):\n \"\"\"param: balance\"\"\"\n self.balance = balance'", - "markdown": "Reports docstrings that do not adhere to the triple double-quoted string format.\n\n**Example:**\n\n\n def calc(self, balance=0):\n 'param: balance'\n self.balance = balance\n\nWhen the quick-fix is applied, the code changes to:\n\n\n def calc(self, balance=0):\n \"\"\"param: balance\"\"\"\n self.balance = balance\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PySingleQuotedDocstring", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyUnusedLocalInspection", - "shortDescription": { - "text": "Unused local symbols" - }, - "fullDescription": { - "text": "Reports local variables, parameters, and functions that are locally defined, but not used name in a function.", - "markdown": "Reports local variables, parameters, and functions that are locally defined, but not used name in a function." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyUnusedLocal", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyReturnFromInitInspection", - "shortDescription": { - "text": "__init__ method that returns a value" - }, - "fullDescription": { - "text": "Reports occurrences of 'return' statements with a return value inside '__init__' methods of classes. Example: 'class Sum:\n def __init__(self, a, b):\n self.a = a\n self.b = b\n self.sum = a + b\n return self.sum' A constructor should not return any value. The '__init__' method should only initialize the values of instance members for news objects. As a quick-fix, the IDE offers to remove the 'return' statement.", - "markdown": "Reports occurrences of `return` statements with a return value inside\n`__init__` methods of classes.\n\n**Example:**\n\n\n class Sum:\n def __init__(self, a, b):\n self.a = a\n self.b = b\n self.sum = a + b\n return self.sum\n\nA constructor should not return any value. The `__init__` method should\nonly initialize the values of instance members for news objects.\n\nAs a quick-fix, the IDE offers to remove the `return` statement." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyReturnFromInit", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Query_restricted", - "shortDescription": { - "text": "Query does not comply with the query restrictions" - }, - "fullDescription": { - "text": "Reports GQL queries that do not comply with the restrictions for queries allowed on the Google App Engine server. See the App Engine documentation for more information.", - "markdown": "Reports GQL queries that do not comply with the restrictions for queries allowed\non the Google App Engine server.\nSee the [App Engine documentation](http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Restrictions_on_Queries) for more information." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "Query_restricted", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Google App Engine (Python)", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMissingOrEmptyDocstringInspection", - "shortDescription": { - "text": "Missing or empty docstring" - }, - "fullDescription": { - "text": "Reports missing and empty docstrings. Example of a missing docstring 'def demo(a):\n c = a ** 2' Example of an empty docstring 'def demo(a):\n \"\"\"\n \"\"\"\n c = a ** 2' When the quick-fix is applied, the code fragments change to: 'def demo(a):\n \"\"\"\n\n :param a:\n \"\"\"\n c = a ** 2' You need to provide some details about the parameter in the generated template.", - "markdown": "Reports missing and empty docstrings.\n\n**Example of a missing docstring**\n\n\n def demo(a):\n c = a ** 2\n\n**Example of an empty docstring**\n\n\n def demo(a):\n \"\"\"\n \"\"\"\n c = a ** 2\n\nWhen the quick-fix is applied, the code fragments change to:\n\n\n def demo(a):\n \"\"\"\n\n :param a:\n \"\"\"\n c = a ** 2\n\nYou need to provide some details about the parameter in the generated template." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "PyMissingOrEmptyDocstring", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyPep8NamingInspection", - "shortDescription": { - "text": "PEP 8 naming convention violation" - }, - "fullDescription": { - "text": "Reports violations of the PEP8 naming conventions. Example: 'class mammalia(object):\n extremities = 4\n\n def feeds(self):\n print(\"milk\")' In this code fragment, IDE offers to rename 'mammalia' to 'Mammalia'. When the quick-fix is applied, the code change to: 'class Mammalia(object):\n extremities = 4\n\n def feeds(self):\n print(\"milk\")'", - "markdown": "Reports violations of the\n[PEP8](https://www.python.org/dev/peps/pep-0008/) naming conventions.\n\n**Example:**\n\n\n class mammalia(object):\n extremities = 4\n\n def feeds(self):\n print(\"milk\")\n\nIn this code fragment, IDE offers to rename `mammalia` to `Mammalia`.\nWhen the quick-fix is applied, the code change to:\n\n\n class Mammalia(object):\n extremities = 4\n\n def feeds(self):\n print(\"milk\")\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyPep8Naming", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoUnresolvedLoadInspection", - "shortDescription": { - "text": "Unresolved library inspection" - }, - "fullDescription": { - "text": "Reports unresolved references in Django load tags. Example: '{% load something_nonexistent %}'", - "markdown": "Reports unresolved references in Django load tags.\n\n**Example:**\n\n\n {% load something_nonexistent %}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoUnresolvedLoadInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDictDuplicateKeysInspection", - "shortDescription": { - "text": "Dictionary contains duplicate keys" - }, - "fullDescription": { - "text": "Reports using the same value as the dictionary key twice. Example: 'dic = {\"a\": [1, 2], \"a\": [3, 4]}'", - "markdown": "Reports using the same value as the dictionary key twice.\n\n**Example:**\n\n\n dic = {\"a\": [1, 2], \"a\": [3, 4]}\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDictDuplicateKeys", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyNoneFunctionAssignmentInspection", - "shortDescription": { - "text": "Assigning function calls that don't return anything" - }, - "fullDescription": { - "text": "Reports cases when an assignment is done on a function that does not return anything. This inspection is similar to pylint inspection E1111. Example: 'def just_print():\n print(\"Hello!\")\n\n\naction = just_print()' As a quick-fix, the IDE offers to remove the assignment.", - "markdown": "Reports cases when an assignment is done on a function that does not return anything.\nThis inspection is similar to [pylint inspection E1111](https://docs.pylint.org/en/1.6.0/features.html#id6).\n\n**Example:**\n\n\n def just_print():\n print(\"Hello!\")\n\n\n action = just_print()\n\nAs a quick-fix, the IDE offers to remove the assignment." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyNoneFunctionAssignment", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JupyterPackageInspection", - "shortDescription": { - "text": "The 'jupyter' package is not installed" - }, - "fullDescription": { - "text": "Reports cases when the 'jupyter' package is not installed for the selected Python interpreter. Without a properly installed 'jupyter' package, you cannot execute Jupyter notebooks. Click the corresponding link on the warning banner to install the missing package. You can also install the package in the Project Settings/Preferences or in the Python Packages tool window. See Installing Python package for more details.", - "markdown": "Reports cases when the `jupyter` package is not installed for the selected\nPython interpreter. Without a properly installed `jupyter` package, you cannot\nexecute Jupyter notebooks.\n\nClick the corresponding link on the warning banner to install the missing\npackage. You can also install the package in the Project **Settings/Preferences** or in the\n**Python Packages** tool window.\n\nSee [Installing Python package](https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html) for more details." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JupyterPackage", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Jupyter", - "index": 57, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyStatementEffectInspection", - "shortDescription": { - "text": "Statement has no effect" - }, - "fullDescription": { - "text": "Reports statements that have no effect. Example: 'class Car:\n def __init__(self, speed=0):\n self.speed = speed\n self.time # has no effect\n\n2 + 3 # has no effect' In this example, you can either add a field 'time' to the 'Car' class or introduce variables for the problematic statements.", - "markdown": "Reports statements that have no effect.\n\n**Example:**\n\n\n class Car:\n def __init__(self, speed=0):\n self.speed = speed\n self.time # has no effect\n\n 2 + 3 # has no effect\n\nIn this example, you can either add a field `time` to the `Car` class or\nintroduce variables for the problematic statements." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyStatementEffect", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMandatoryEncodingInspection", - "shortDescription": { - "text": "No encoding specified for file" - }, - "fullDescription": { - "text": "Reports a missing encoding comment in Python 2. Example: 'class Book(object):\n def __init__(self):\n pass' When the quick-fix is applied, the missing comment is added: '# coding=utf-8\nclass Book(object):\n def __init__(self):\n pass'", - "markdown": "Reports a missing encoding comment in Python 2.\n\n**Example:**\n\n\n class Book(object):\n def __init__(self):\n pass\n\nWhen the quick-fix is applied, the missing comment is added:\n\n\n # coding=utf-8\n class Book(object):\n def __init__(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyMandatoryEncoding", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyInconsistentIndentationInspection", - "shortDescription": { - "text": "Inconsistent indentation" - }, - "fullDescription": { - "text": "Reports inconsistent indentation in Python source files when, for example, you use a mixture of tabs and spaces in your code.", - "markdown": "Reports inconsistent indentation in Python source files when, for example,\nyou use a mixture of tabs and spaces in your code." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyInconsistentIndentation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAttributeOutsideInitInspection", - "shortDescription": { - "text": "An instance attribute is defined outside `__init__`" - }, - "fullDescription": { - "text": "Reports a problem when instance attribute definition is outside '__init__' method. Example: 'class Book:\n def __init__(self):\n self.author = 'Mark Twain'\n\n def release(self):\n self.year = '1889'' When the quick-fix is applied, the code sample changes to: 'class Book:\n def __init__(self):\n self.year = '1889'\n self.author = 'Mark Twain'\n\n def release(self):\n pass'", - "markdown": "Reports a problem when instance attribute definition is outside `__init__` method.\n\n**Example:**\n\n\n class Book:\n def __init__(self):\n self.author = 'Mark Twain'\n\n def release(self):\n self.year = '1889'\n\n\nWhen the quick-fix is applied, the code sample changes to:\n\n\n class Book:\n def __init__(self):\n self.year = '1889'\n self.author = 'Mark Twain'\n\n def release(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyAttributeOutsideInit", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTypedDictInspection", - "shortDescription": { - "text": "Invalid TypedDict definition and usages" - }, - "fullDescription": { - "text": "Reports invalid definition and usage of TypedDict. Example: 'from typing import TypedDict\n\n\nclass Movie(TypedDict):\n name: str\n year: int\n rate: int = 10 # Right-hand side values are not supported\n\n def method(self): # Invalid statement in TypedDict\n pass\n\n\nm = Movie(name=\"name\", year=1000, rate=9)\nprint(m[\"director\"]) # There is no the 'director' key in 'Movie'\ndel m[\"name\"] # The 'name' key cannot be deleted\nm[\"year\"] = \"1001\" # Expected 'int', got 'str''", - "markdown": "Reports invalid definition and usage of\n[TypedDict](https://www.python.org/dev/peps/pep-0589/).\n\n**Example:**\n\n\n from typing import TypedDict\n\n\n class Movie(TypedDict):\n name: str\n year: int\n rate: int = 10 # Right-hand side values are not supported\n\n def method(self): # Invalid statement in TypedDict\n pass\n\n\n m = Movie(name=\"name\", year=1000, rate=9)\n print(m[\"director\"]) # There is no the 'director' key in 'Movie'\n del m[\"name\"] # The 'name' key cannot be deleted\n m[\"year\"] = \"1001\" # Expected 'int', got 'str'\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTypedDict", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyPep8Inspection", - "shortDescription": { - "text": "PEP 8 coding style violation" - }, - "fullDescription": { - "text": "Reports violations of the PEP 8 coding style guide by running the bundled pycodestyle.py tool.", - "markdown": "Reports violations of the [PEP 8 coding style guide](https://www.python.org/dev/peps/pep-0008/) by running the bundled [pycodestyle.py](https://github.com/PyCQA/pycodestyle) tool." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyPep8", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMissingTypeHintsInspection", - "shortDescription": { - "text": "Missing type hinting for function definition" - }, - "fullDescription": { - "text": "Reports missing type hints for function declaration in one of the two formats: parameter annotations or a type comment. Select the Only when types are known checkbox if you want the inspection check the types collected from runtime or inferred.", - "markdown": "Reports missing type hints for function declaration in\none of the two formats: parameter annotations or a type comment.\n\nSelect the **Only when types are known** checkbox if you want the inspection check\nthe types collected from runtime or inferred." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "PyMissingTypeHints", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTupleItemAssignmentInspection", - "shortDescription": { - "text": "Tuple item assignment is prohibited" - }, - "fullDescription": { - "text": "Reports assignments to a tuple item. Example: 't = ('red', 'blue', 'green', 'white')\nt[3] = 'black'' A quick-fix offers to replace the tuple with a list.", - "markdown": "Reports assignments to a tuple item.\n\n**Example:**\n\n\n t = ('red', 'blue', 'green', 'white')\n t[3] = 'black'\n\nA quick-fix offers to replace the tuple with a list." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTupleItemAssignment", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoUnresolvedUrlInspection", - "shortDescription": { - "text": "Django {% url %} tag arguments are unresolved" - }, - "fullDescription": { - "text": "Reports a missing url in the 'url' tag. Example: '{% url 'url_name' %}' The IDE shows a warning if 'url_name' is not defined in the 'urls' file.", - "markdown": "Reports a missing url in the `url` tag.\n\n**Example:**\n\n\n {% url 'url_name' %}\n\nThe IDE shows a warning if `url_name` is not defined in the `urls` file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "DjangoUnresolvedUrlInspection", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoUnresolvedStaticReferenceInspection", - "shortDescription": { - "text": "Unresolved static reference" - }, - "fullDescription": { - "text": "Reports unresolved references to static resources. Example: '{% load staticfiles %}\n' In this example, 'style.css' is highlighted if there is no such a file in the 'static/poll' directory.", - "markdown": "Reports unresolved references to static resources.\n\n**Example:**\n\n\n {% load staticfiles %}\n \n\nIn this example, `style.css` is highlighted if there is no such a file in the `static/poll`\ndirectory." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoUnresolvedStaticReferenceInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDunderSlotsInspection", - "shortDescription": { - "text": "Invalid usages of classes with '__slots__' definitions" - }, - "fullDescription": { - "text": "Reports invalid usages of a class with '__slots__' definitions. Example: 'class Foo:\n __slots__ = ['foo', 'bar']\n\n\nfoo = Foo()\nfoo.baz = 'spam''", - "markdown": "Reports invalid usages of a class with `__slots__` definitions.\n\n**Example:**\n\n\n class Foo:\n __slots__ = ['foo', 'bar']\n\n\n foo = Foo()\n foo.baz = 'spam'\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDunderSlots", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDefaultArgumentInspection", - "shortDescription": { - "text": "The default argument is mutable" - }, - "fullDescription": { - "text": "Reports a problem when a mutable value as a list or dictionary is detected in a default value for an argument. Default argument values are evaluated only once at function definition time, which means that modifying the default value of the argument will affect all subsequent calls of that function. Example: 'def func(s, cache={}):\n cache[s] = None' When the quick-fix is applied, the code changes to: 'def func(s, cache=None):\n if cache is None:\n cache = {}\n cache[s] = None'", - "markdown": "Reports a problem when a mutable value as a list or dictionary is detected in a default value for\nan argument. \n\nDefault argument values are evaluated only once at function definition time,\nwhich means that modifying the\ndefault value of the argument will affect all subsequent calls of that function.\n\n**Example:**\n\n\n def func(s, cache={}):\n cache[s] = None\n\nWhen the quick-fix is applied, the code changes to:\n\n\n def func(s, cache=None):\n if cache is None:\n cache = {}\n cache[s] = None\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDefaultArgument", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyShadowingBuiltinsInspection", - "shortDescription": { - "text": "Shadowing built-in names" - }, - "fullDescription": { - "text": "Reports shadowing built-in names, such as 'len' or 'list'. Example: 'def len(a, b, c):\n d = a + b + c\n return d' In this code fragment, the 'len' built-in name is used. The IDE offers to apply the Rename refactoring as a fix.", - "markdown": "Reports shadowing built-in names, such as `len` or `list`.\n\n**Example:**\n\n\n def len(a, b, c):\n d = a + b + c\n return d\n\nIn this code fragment, the `len` built-in name is used. The IDE offers to\napply the Rename refactoring as a fix." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyShadowingBuiltins", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMethodOverridingInspection", - "shortDescription": { - "text": "Method signature does not match signature of overridden method" - }, - "fullDescription": { - "text": "Reports inconsistencies in overriding method signatures. Example: 'class Book:\n def add_title(self):\n pass\n\n\nclass Novel(Book):\n def add_title(self, text):\n pass' Parameters of the 'add_title' method in the 'Novel' class do not match the method signature specified in the 'Book' class. As a fix, the IDE offers to apply the Change Signature refactoring.", - "markdown": "Reports inconsistencies in overriding method signatures.\n\n**Example:**\n\n\n class Book:\n def add_title(self):\n pass\n\n\n class Novel(Book):\n def add_title(self, text):\n pass\n\nParameters of the `add_title` method in the `Novel` class do not match the method\nsignature specified in the `Book` class. As a fix, the IDE offers to apply the Change Signature\nrefactoring." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyMethodOverriding", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTestParametrizedInspection", - "shortDescription": { - "text": "Incorrect arguments in @pytest.mark.parametrize" - }, - "fullDescription": { - "text": "Reports functions that are decorated with @pytest.mark.parametrize but do not have arguments to accept parameters of the decorator.", - "markdown": "Reports functions that are decorated with [@pytest.mark.parametrize](https://docs.pytest.org/en/stable/parametrize.html) but do not have arguments to accept\nparameters of the decorator." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTestParametrized", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDecoratorInspection", - "shortDescription": { - "text": "Class-specific decorator is used outside the class" - }, - "fullDescription": { - "text": "Reports usages of '@classmethod' or '@staticmethod' decorators in methods outside a class. Example: 'class State(object):\n\n @classmethod\n def my_state(cls, name):\n cls.name = name\n\n\n@classmethod\ndef change_state(self):\n pass' The 'change_state' method should not use the '@classmethod' decorator or it should be moved to the 'State' class declaration. If you apply the 'Remove decorator' action, the code changes to: 'class State(object):\n\n @classmethod\n def my_state(cls, name):\n cls.name = name\n\n\ndef change_state(self):\n pass'", - "markdown": "Reports usages of `@classmethod` or `@staticmethod` decorators\nin methods outside a class.\n\n**Example:**\n\n\n class State(object):\n\n @classmethod\n def my_state(cls, name):\n cls.name = name\n\n\n @classmethod\n def change_state(self):\n pass\n\nThe `change_state` method should not use the `@classmethod` decorator or it should be\nmoved to the `State` class declaration.\n\nIf you apply the `Remove decorator` action, the code changes to:\n\n\n class State(object):\n\n @classmethod\n def my_state(cls, name):\n cls.name = name\n\n\n def change_state(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDecorator", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAsyncCallInspection", - "shortDescription": { - "text": "Missing `await` syntax in coroutine calls" - }, - "fullDescription": { - "text": "Reports coroutines that were called without using the 'await' syntax. Example: 'async def bar():\n pass\n\n\nasync def foo():\n bar()' After the quick-fix is applied, the code changes to: 'async def bar():\n pass\n\n\nasync def foo():\n await bar()'", - "markdown": "Reports coroutines that were called\nwithout using the `await` syntax.\n\n**Example:**\n\n\n async def bar():\n pass\n\n\n async def foo():\n bar()\n\nAfter the quick-fix is applied, the code changes to:\n\n\n async def bar():\n pass\n\n\n async def foo():\n await bar()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyAsyncCall", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyComparisonWithNoneInspection", - "shortDescription": { - "text": "Using equality operators to compare with None" - }, - "fullDescription": { - "text": "Reports comparisons with 'None'. That type of comparisons should always be done with 'is' or 'is not', never the equality operators. Example: 'a = 2\n\n\nif a == None:\n print(\"Success\")' Once the quick-fix is applied, the code changes to: 'a = 2\n\n\nif a is None:\n print(\"Success\")'", - "markdown": "Reports comparisons with `None`. That type of comparisons\nshould always be done with `is` or `is not`, never\nthe equality operators.\n\n**Example:**\n\n\n a = 2\n\n\n if a == None:\n print(\"Success\")\n\nOnce the quick-fix is applied, the code changes to:\n\n\n a = 2\n\n\n if a is None:\n print(\"Success\")\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyComparisonWithNone", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CommandLineInspection", - "shortDescription": { - "text": "Incorrect CLI syntax" - }, - "fullDescription": { - "text": "Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies that option names and arguments are correct. Do not disable the inspection if you are going to use command-line interfaces like manage.py in Django.", - "markdown": "Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies\nthat option names and arguments are correct.\n\nDo not disable the inspection if you are going to use command-line interfaces like [manage.py in Django](https://www.jetbrains.com/help/pycharm/running-manage-py.html)." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "CommandLineInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMethodParametersInspection", - "shortDescription": { - "text": "Improper first parameter" - }, - "fullDescription": { - "text": "Reports methods that lack the first parameter that is usually named 'self'. Example: 'class Movie:\n\n def show():\n pass' When the quick-fix is applied, the code changes to: 'class Movie:\n\n def show(self):\n pass' The inspection also reports naming issues in class methods. Example: 'class Movie:\n @classmethod\n def show(abc):\n pass' Since the first parameter of a class method should be 'cls', the IDE provides a quick-fix to rename it.", - "markdown": "Reports methods that lack the first parameter that is usually\nnamed `self`.\n\n**Example:**\n\n\n class Movie:\n\n def show():\n pass\n\nWhen the quick-fix is applied, the code changes to:\n\n\n class Movie:\n\n def show(self):\n pass\n\nThe inspection also reports naming issues in class methods.\n\n**Example:**\n\n\n class Movie:\n @classmethod\n def show(abc):\n pass\n\nSince the first parameter of a class method should be `cls`, the IDE provides a quick-fix\nto rename it." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyMethodParameters", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDocstringTypesInspection", - "shortDescription": { - "text": "Type in docstring does not match inferred type" - }, - "fullDescription": { - "text": "Reports types in docstring that do not match dynamically inferred types.", - "markdown": "Reports types in docstring that do not match dynamically inferred types." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyDocstringTypes", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMethodFirstArgAssignmentInspection", - "shortDescription": { - "text": "First argument of the method is reassigned" - }, - "fullDescription": { - "text": "Reports cases when the first parameter, such as 'self' or 'cls', is reassigned in a method. Because in most cases, there are no objectives in such reassignment, the IDE indicates an error. Example: 'class Account:\n def calc(self, balance):\n if balance == 0:\n self = balance\n return self' As a fix, you might want to check and modify the algorithm to ensure that reassignment is needed. If everything is correct, you can invoke intention actions for this code and opt to ignore the warning.", - "markdown": "Reports cases when the first parameter,\nsuch as `self` or `cls`, is reassigned in a method.\nBecause in most cases, there are no objectives in such reassignment, the\nIDE indicates an error.\n\n**Example:**\n\n\n class Account:\n def calc(self, balance):\n if balance == 0:\n self = balance\n return self\n\nAs a fix, you might want to check and modify the algorithm to ensure that reassignment is needed. If everything is correct,\nyou can invoke intention actions for this code and opt to ignore the warning." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyMethodFirstArgAssignment", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTupleAssignmentBalanceInspection", - "shortDescription": { - "text": "Tuple assignment balance is incorrect" - }, - "fullDescription": { - "text": "Reports cases when the number of expressions on the right-hand side and targets on the left-hand side are not the same. Example: 't = ('red', 'blue', 'green', 'white')\n(c1, c2, c3) = t' As a quick-fix, you can modify the highlighted code fragment to restore the tuple balance.", - "markdown": "Reports cases when the number of expressions on the right-hand side\nand targets on the left-hand side are not the same.\n\n**Example:**\n\n\n t = ('red', 'blue', 'green', 'white')\n (c1, c2, c3) = t\n\nAs a quick-fix, you can modify the highlighted code fragment to restore the tuple\nbalance." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTupleAssignmentBalance", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyClassHasNoInitInspection", - "shortDescription": { - "text": "Class has no `__init__` method" - }, - "fullDescription": { - "text": "Reports cases in Python 2 when a class has no '__init__' method, neither its parent classes. Example: 'class Book():\n pass' The quick-fix adds the '__init__' method: 'class Book():\n def __init__(self):\n pass'", - "markdown": "Reports cases in Python 2 when a class has no `__init__` method, neither its parent\nclasses.\n\n**Example:**\n\n\n class Book():\n pass\n\nThe quick-fix adds the `__init__` method:\n\n\n class Book():\n def __init__(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyClassHasNoInit", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyArgumentEqualDefaultInspection", - "shortDescription": { - "text": "The function argument is equal to the default parameter value" - }, - "fullDescription": { - "text": "Reports a problem when an argument passed to the function is equal to the default parameter value. This inspection is disabled by default to avoid performance degradation. Example: 'def my_function(a: int = 2):\n print(a)\n\n\nmy_function(2)'", - "markdown": "Reports a problem when an argument\npassed to the function is equal to the default parameter value.\n\nThis inspection is disabled by default to avoid performance degradation.\n\n**Example:**\n\n\n def my_function(a: int = 2):\n print(a)\n\n\n my_function(2)\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "PyArgumentEqualDefault", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyClassVarInspection", - "shortDescription": { - "text": "Invalid usage of ClassVar variables" - }, - "fullDescription": { - "text": "Reports invalid usages of ClassVar annotations. Example: 'from typing import ClassVar\n\n\nclass Cat:\n color: ClassVar[str] = \"white\"\n weight: int\n\n def __init__(self, weight: int):\n self.weight = weight\n\n\nCat.color = \"black\" # OK\nmy_cat = Cat(5)\nmy_cat.color = \"gray\" # Error, setting class variable on instance'", - "markdown": "Reports invalid usages of [ClassVar](https://docs.python.org/3/library/typing.html#typing.ClassVar) annotations.\n\n**Example:**\n\n\n from typing import ClassVar\n\n\n class Cat:\n color: ClassVar[str] = \"white\"\n weight: int\n\n def __init__(self, weight: int):\n self.weight = weight\n\n\n Cat.color = \"black\" # OK\n my_cat = Cat(5)\n my_cat.color = \"gray\" # Error, setting class variable on instance\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyClassVar", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoRelationInspection", - "shortDescription": { - "text": "Incorrect comparison expression in Django templates" - }, - "fullDescription": { - "text": "Reports missing whitespaces before and after comparison operators in Django templates. Example: '{% if my_var==1 %}\n{% endif %}'", - "markdown": "Reports missing whitespaces before and after comparison operators in Django templates.\n\n**Example:**\n\n\n {% if my_var==1 %}\n {% endif %}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoRelationInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyFromFutureImportInspection", - "shortDescription": { - "text": "Improper position of from __future__ import" - }, - "fullDescription": { - "text": "Reports 'from __future__ import' statements that are used not at the beginning of a file. Example: 'a = 1\nfrom __future__ import print_function\nprint()' When the quick-fix is applied, the code changes to: 'from __future__ import print_function\n\na = 1\nprint()'", - "markdown": "Reports `from __future__ import`\nstatements that are used not at\nthe beginning of a file.\n\n**Example:**\n\n\n a = 1\n from __future__ import print_function\n print()\n\nWhen the quick-fix is applied, the code changes to:\n\n\n from __future__ import print_function\n\n a = 1\n print()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyFromFutureImport", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyUnresolvedReferencesInspection", - "shortDescription": { - "text": "Unresolved references" - }, - "fullDescription": { - "text": "Reports references in your code that cannot be resolved. In a dynamically typed language, this is possible in a limited number of cases. If a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be: 'def print_string(s):\n print(s.abc())' In this code fragment 's' is always a string and 'abc' should be highlighted as unresolved. However, 's' type is inferred as 'Any' and no warning is reported. The IDE provides quick-fix actions to add missing references on-the-fly.", - "markdown": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyUnresolvedReferences", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyPackageRequirementsInspection", - "shortDescription": { - "text": "Unsatisfied package requirements" - }, - "fullDescription": { - "text": "Reports packages mentioned in requirements files (for example, 'requirements.txt' or 'Pipfile') but not installed, or imported but not mentioned in requirements files. The IDE shows a quick-fix banner so that you can install the missing packages in one click.", - "markdown": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyPackageRequirements", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Restricted_Python_calls", - "shortDescription": { - "text": "Feature is not supported in the App Engine sandbox" - }, - "fullDescription": { - "text": "Reports usages of Python features that are restricted by the Google App Engine sandbox and will cause a failure on the production server.", - "markdown": "Reports usages of Python features that are restricted by the Google App\nEngine sandbox and will cause a failure on the production server." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "Restricted_Python_calls", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Google App Engine (Python)", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyRedundantParenthesesInspection", - "shortDescription": { - "text": "Redundant parentheses" - }, - "fullDescription": { - "text": "Reports about redundant parentheses in expressions. The IDE provides the quick-fix action to remove the redundant parentheses.", - "markdown": "Reports about redundant parentheses in expressions.\n\nThe IDE provides the quick-fix action to remove the redundant parentheses." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyRedundantParentheses", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTrailingSemicolonInspection", - "shortDescription": { - "text": "Prohibited trailing semicolon in a statement" - }, - "fullDescription": { - "text": "Reports trailing semicolons in statements. Example: 'def my_func(a):\n c = a ** 2;\n return c' IDE provides a quick-fix that removes a trailing semicolon. When you apply it, the code changes to: 'def my_func(a):\n c = a ** 2\n return c'", - "markdown": "Reports trailing semicolons in statements.\n\n**Example:**\n\n\n def my_func(a):\n c = a ** 2;\n return c\n\nIDE provides a quick-fix that removes a trailing semicolon. When you\napply it, the code changes to:\n\n\n def my_func(a):\n c = a ** 2\n return c\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTrailingSemicolon", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ExtendsTagPositionInspection", - "shortDescription": { - "text": "Misplaced {% extends %} tag" - }, - "fullDescription": { - "text": "Reports the '{% extends %}' tag that is not the first tag in a Django template. Example: '{% load my_custom_tags %}\n{% extends \"../DjangoApp/templatetags/my_custom_tags.py\"%}' In this example, the '{% extends %}' tag is highlighted, because it should be placed before the '{% load %}' tag.", - "markdown": "Reports the `{% extends %}` tag that is not the first tag in a\nDjango template.\n\n**Example:**\n\n\n {% load my_custom_tags %}\n {% extends \"../DjangoApp/templatetags/my_custom_tags.py\"%}\n\nIn this example, the `{% extends %}` tag is highlighted, because it should be placed before\nthe `{% load %}` tag." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ExtendsTagPositionInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyArgumentListInspection", - "shortDescription": { - "text": "Incorrect call arguments" - }, - "fullDescription": { - "text": "Reports discrepancies between declared parameters and actual arguments, as well as incorrect arguments, for example, duplicate named arguments, and incorrect argument order. Example: 'class Foo:\n def __call__(self, p1: int, *, p2: str = \"%\"):\n return p2 * p1\n\n\nbar = Foo()\nbar.__call__() # unfilled parameter\nbar(5, \"#\") # unexpected argument' The correct code fragment looks at follows: 'class Foo:\n def __call__(self, p1: int, *, p2: str = \"%\"):\n return p2 * p1\n\n\nbar = Foo()\nbar.__call__(5)\nbar(5, p2=\"#\")'", - "markdown": "Reports discrepancies between declared parameters and actual arguments, as well as\nincorrect arguments, for example, duplicate named arguments, and incorrect argument order.\n\n**Example:**\n\n\n class Foo:\n def __call__(self, p1: int, *, p2: str = \"%\"):\n return p2 * p1\n\n\n bar = Foo()\n bar.__call__() # unfilled parameter\n bar(5, \"#\") # unexpected argument\n\nThe correct code fragment looks at follows:\n\n\n class Foo:\n def __call__(self, p1: int, *, p2: str = \"%\"):\n return p2 * p1\n\n\n bar = Foo()\n bar.__call__(5)\n bar(5, p2=\"#\")\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyArgumentList", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyInterpreterInspection", - "shortDescription": { - "text": "An invalid interpreter" - }, - "fullDescription": { - "text": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly configured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features. The IDE provides quick access to the interpreter settings.", - "markdown": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyInterpreter", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyPropertyAccessInspection", - "shortDescription": { - "text": "Inappropriate access to properties" - }, - "fullDescription": { - "text": "Reports cases when properties are accessed inappropriately: Read-only properties are set Write-only properties are read Non-deletable properties are deleted Example: 'class MyClass:\n @property\n def read_only(self): return None\n\n def __write_only_setter(self, value): pass\n\n write_only = property(None, __write_only_setter)\n\n\na = MyClass()\na.read_only = 10 # property cannot be set\ndel a.read_only # property cannot be deleted\nprint(a.write_only) # property cannot be read'", - "markdown": "Reports cases when properties are accessed inappropriately:\n\n* Read-only properties are set\n* Write-only properties are read\n* Non-deletable properties are deleted\n\n**Example:**\n\n\n class MyClass:\n @property\n def read_only(self): return None\n\n def __write_only_setter(self, value): pass\n\n write_only = property(None, __write_only_setter)\n\n\n a = MyClass()\n a.read_only = 10 # property cannot be set\n del a.read_only # property cannot be deleted\n print(a.write_only) # property cannot be read\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyPropertyAccess", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyStubPackagesAdvertiser", - "shortDescription": { - "text": "Stub packages advertiser" - }, - "fullDescription": { - "text": "Reports availability of stub packages. Stub package is a package that contains type information for the corresponding runtime package. Using stub packages ensures better coding assistance for the corresponding python package.", - "markdown": "Reports availability of stub packages.\n\n\n[Stub package](https://www.python.org/dev/peps/pep-0561/) is a package that contains type information for the corresponding\nruntime package.\n\nUsing stub packages ensures better coding assistance for the corresponding python package." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyStubPackagesAdvertiser", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyRelativeImportInspection", - "shortDescription": { - "text": "Suspicious relative imports" - }, - "fullDescription": { - "text": "Reports usages of relative imports inside plain directories, for example, directories neither containing '__init__.py' nor explicitly marked as namespace packages.", - "markdown": "Reports usages of relative imports inside plain directories, for example, directories neither containing `__init__.py` nor\nexplicitly marked as namespace packages." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyPackages", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyRedeclarationInspection", - "shortDescription": { - "text": "Redeclared names without usages" - }, - "fullDescription": { - "text": "Reports unconditional redeclarations of names without being used in between. Example: 'def x(): pass\n\n\nx = 2' It applies to function and class declarations, and top-level assignments. When the warning is shown, you can try a recommended action, for example, you might be prompted to rename the variable.", - "markdown": "Reports unconditional redeclarations of names without being used in between.\n\n**Example:**\n\n\n def x(): pass\n\n\n x = 2\n\nIt applies to function and class declarations, and top-level assignments.\n\nWhen the warning is shown, you can try a recommended action, for example, you might be prompted to\nrename the variable." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyRedeclaration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyramidSetupInspection", - "shortDescription": { - "text": "Project is not installed for development" - }, - "fullDescription": { - "text": "Reports cases when no 'python setup.py develop' command was executed for the Pyramid project. You need to execute this command to install the newly created project for development.", - "markdown": "Reports cases when no `python setup.py develop` command was executed for the Pyramid project.\n\nYou need to execute this command to install the newly created project for development." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyramidSetup", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Pyramid", - "index": 62, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyProtectedMemberInspection", - "shortDescription": { - "text": "Accessing a protected member of a class or a module" - }, - "fullDescription": { - "text": "Reports cases when a protected member is accessed outside the class, a descendant of the class where it is defined, or a module. Example: 'class Foo:\n def _protected_method(self):\n pass\n\n\nclass Bar(Foo):\n def public_method(self):\n self._protected_method()\n\n\nfoo = Foo()\nfoo._protected_method() # Access to a protected method'", - "markdown": "Reports cases when a protected member is accessed outside the class,\na descendant of the class where it is defined, or a module.\n\n**Example:**\n\n\n class Foo:\n def _protected_method(self):\n pass\n\n\n class Bar(Foo):\n def public_method(self):\n self._protected_method()\n\n\n foo = Foo()\n foo._protected_method() # Access to a protected method\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyProtectedMember", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyStubPackagesCompatibilityInspection", - "shortDescription": { - "text": "Incompatible stub packages" - }, - "fullDescription": { - "text": "Reports stub packages that do not support the version of the corresponding runtime package. A stub package contains type information for some runtime package.", - "markdown": "Reports stub packages that do not support the version of the corresponding runtime package.\n\nA [stub package](https://www.python.org/dev/peps/pep-0561/) contains type information for some runtime package." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyStubPackagesCompatibility", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyUnboundLocalVariableInspection", - "shortDescription": { - "text": "Unbound local variables" - }, - "fullDescription": { - "text": "Reports local variables referenced before assignment. Example: 'x = 0\nif x > 10:\n b = 3\nprint(b)' The IDE reports a problem for 'print(b)'. A possible fix is: 'x = 0\nif x > 10:\n b = 3\n print(b)'", - "markdown": "Reports local variables referenced before assignment.\n\n**Example:**\n\n\n x = 0\n if x > 10:\n b = 3\n print(b)\n\nThe IDE reports a problem for `print(b)`. A possible fix is:\n\n\n x = 0\n if x > 10:\n b = 3\n print(b)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyUnboundLocalVariable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyNamedTupleInspection", - "shortDescription": { - "text": "Invalid definition of 'typing.NamedTuple'" - }, - "fullDescription": { - "text": "Reports invalid definition of a typing.NamedTuple. Example: 'import typing\n\n\nclass FullName(typing.NamedTuple):\n first: str\n last: str = \"\"\n middle: str' As a fix, place the field with the default value after the fields without default values: 'import typing\n\n\nclass FullName(typing.NamedTuple):\n first: str\n middle: str\n last: str = \"\"'", - "markdown": "Reports invalid definition of a\n[typing.NamedTuple](https://docs.python.org/3/library/typing.html#typing.NamedTuple).\n\n**Example:**\n\n\n import typing\n\n\n class FullName(typing.NamedTuple):\n first: str\n last: str = \"\"\n middle: str\n\nAs a fix, place the field with the default value after the fields without default values:\n\n\n import typing\n\n\n class FullName(typing.NamedTuple):\n first: str\n middle: str\n last: str = \"\"\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyNamedTuple", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyNestedDecoratorsInspection", - "shortDescription": { - "text": "Problematic nesting of decorators" - }, - "fullDescription": { - "text": "Reports problems with nesting decorators. The inspection highlights the cases when 'classmethod' or 'staticmethod' is applied before another decorator. Example: 'def innocent(f):\n return f\n\n\nclass A:\n @innocent # Decorator will not receive a callable it may expect\n @classmethod\n def f2(cls):\n pass\n\n @innocent # Decorator will not receive a callable it may expect\n @staticmethod\n def f1():\n pass' As a quick-fix, the IDE offers to remove the decorator.", - "markdown": "Reports problems with nesting decorators. The inspection highlights the cases when `classmethod` or `staticmethod`\nis applied before another decorator.\n\n**Example:**\n\n\n def innocent(f):\n return f\n\n\n class A:\n @innocent # Decorator will not receive a callable it may expect\n @classmethod\n def f2(cls):\n pass\n\n @innocent # Decorator will not receive a callable it may expect\n @staticmethod\n def f1():\n pass\n\nAs a quick-fix, the IDE offers to remove the decorator." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyNestedDecorators", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DuplicatedBlockNamesInspection", - "shortDescription": { - "text": "Duplicated block names" - }, - "fullDescription": { - "text": "Reports duplicated block names in Django templates. Example: '\n\n\n \n {% block title %}My amazing site{% endblock %}\n\n\n\n
\n {% block title %}\n \n {% endblock %}\n
\n\n
\n {% block content %}{% endblock %}\n
\n\n'", - "markdown": "Reports duplicated block names in Django templates.\n\n**Example:**\n\n\n \n \n \n \n {% block title %}My amazing site{% endblock %}\n \n\n \n
\n {% block title %}\n \n {% endblock %}\n
\n\n
\n {% block content %}{% endblock %}\n
\n \n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DuplicatedBlockNamesInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyOverloadsInspection", - "shortDescription": { - "text": "Overloads in regular Python files" - }, - "fullDescription": { - "text": "Reports cases when overloads in regular Python files are placed after the implementation or when their signatures are not compatible with the implementation. Example: 'from typing import overload\n\n\n@overload\ndef foo(p1, p2): # Overload signature is not compatible with the implementation\n pass\n\n\n@overload\ndef foo(p1): # Overload signature is not compatible with the implementation\n pass\n\n\ndef foo(p1, p2, p3):\n print(p1, p2, p3)'", - "markdown": "Reports cases when overloads in regular Python files are placed after the implementation or when their signatures are\nnot compatible with the implementation.\n\n**Example:**\n\n\n from typing import overload\n\n\n @overload\n def foo(p1, p2): # Overload signature is not compatible with the implementation\n pass\n\n\n @overload\n def foo(p1): # Overload signature is not compatible with the implementation\n pass\n\n\n def foo(p1, p2, p3):\n print(p1, p2, p3)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyOverloads", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "AppEngineThreadsafeInspection", - "shortDescription": { - "text": "Threadsafe is not available or set inappropriately" - }, - "fullDescription": { - "text": "Reports cases when threadsafe is not present or it is not set to either 'yes' or 'no'.", - "markdown": "Reports cases when threadsafe is not present or it is not set to either `yes` or `no`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "AppEngineThreadsafe", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Google App Engine (Python)", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyExceptClausesOrderInspection", - "shortDescription": { - "text": "Wrong order of 'except' clauses" - }, - "fullDescription": { - "text": "Reports cases when 'except' clauses are not in the proper order, from the more specific to the more generic, or one exception class is caught twice. If you do not fix the order, some exceptions may not be caught by the most specific handler. Example: 'try:\n call()\nexcept ValueError:\n pass\nexcept UnicodeError:\n pass' The IDE recommends moving the clause up. When the quick-fix is applied, the code changes to: 'try:\n call()\nexcept UnicodeError:\n pass\nexcept ValueError:\n pass'", - "markdown": "Reports cases when `except` clauses are not in the proper order,\nfrom the more specific to the more generic, or one exception class is caught twice.\n\n\nIf you do not fix the order, some exceptions may not be caught by the most specific handler.\n\n**Example:**\n\n\n try:\n call()\n except ValueError:\n pass\n except UnicodeError:\n pass\n\nThe IDE recommends moving the clause up. When the quick-fix is applied, the code changes to:\n\n\n try:\n call()\n except UnicodeError:\n pass\n except ValueError:\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyExceptClausesOrder", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDataclassInspection", - "shortDescription": { - "text": "Invalid definition and usage of Data Classes" - }, - "fullDescription": { - "text": "Reports invalid definitions and usages of classes created with 'dataclasses' or 'attr' modules. Example: 'import dataclasses\n\n\n@dataclasses.dataclass\nclass FullName:\n first: str\n middle: str = \"\"\n last: str'", - "markdown": "Reports invalid definitions and usages of classes created with\n`dataclasses` or `attr` modules.\n\n**Example:**\n\n\n import dataclasses\n\n\n @dataclasses.dataclass\n class FullName:\n first: str\n middle: str = \"\"\n last: str\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDataclass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyprojectInspection", - "shortDescription": { - "text": "Depencencies in pyproject.toml" - }, - "fullDescription": { - "text": "Reports unsatisfied dependencies, declared [project.dependencies] table in pyproject.toml. Shows a quick-fix to install missing packages.", - "markdown": "Reports unsatisfied dependencies, declared \\[project.dependencies\\] table in pyproject.toml.\n\n\nShows a quick-fix to install missing packages." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyprojectInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyClassicStyleClassInspection", - "shortDescription": { - "text": "Classic style class usage" - }, - "fullDescription": { - "text": "Reports classic style classes usage. This inspection applies only to Python 2. Example: 'class A:\n pass' With quick-fixes provided by the IDE, this code fragment changes to: 'class A(object):\n def __init__(self):\n pass'", - "markdown": "Reports [classic style classes](https://docs.python.org/2/reference/datamodel.html#new-style-and-classic-classes) usage. This inspection applies only to Python 2.\n\n**Example:**\n\n\n class A:\n pass\n\nWith quick-fixes provided by the IDE, this code fragment changes to:\n\n\n class A(object):\n def __init__(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyClassicStyleClass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DjangoUrlArgumentsInspection", - "shortDescription": { - "text": "Incorrect arguments in the ' {% url %}' tag" - }, - "fullDescription": { - "text": "Reports missing parameters in the template file if the 'url()' function has parameters in its URL path. Example: In the 'url.py' file 'url(r'^(?P[0-9]+)/', views.detail, name='detail')' In the template file '{% url 'polls:detail' %}'", - "markdown": "Reports missing parameters in the template file if the `url()`\nfunction has parameters in its URL path.\n\n**Example:**\n\nIn the `url.py` file\n\n\n url(r'^(?P[0-9]+)/', views.detail, name='detail')\n\nIn the template file\n\n\n {% url 'polls:detail' %}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DjangoUrlArgumentsInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Django", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyPropertyDefinitionInspection", - "shortDescription": { - "text": "Incorrect property definition" - }, - "fullDescription": { - "text": "Reports problems with the arguments of 'property()' and functions annotated with '@property'. 'class C:\n @property\n def abc(self): # Getter should return or yield something\n pass\n\n @abc.setter\n def foo(self, value): # Names of function and decorator don't match\n pass\n\n @abc.setter\n def abc(self, v1, v2): # Setter signature should be (self, value)\n pass\n\n @abc.deleter\n def abc(self, v1): # Delete signature should be (self)\n pass' A quick-fix offers to update parameters.", - "markdown": "Reports problems with the arguments of `property()` and functions\nannotated with `@property`.\n\n\n class C:\n @property\n def abc(self): # Getter should return or yield something\n pass\n\n @abc.setter\n def foo(self, value): # Names of function and decorator don't match\n pass\n\n @abc.setter\n def abc(self, v1, v2): # Setter signature should be (self, value)\n pass\n\n @abc.deleter\n def abc(self, v1): # Delete signature should be (self)\n pass\n\nA quick-fix offers to update parameters." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyPropertyDefinition", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyIncorrectDocstringInspection", - "shortDescription": { - "text": "Incorrect docstring" - }, - "fullDescription": { - "text": "Reports mismatched parameters in a docstring. For example, 'b' is highlighted, because there is no such a parameter in the 'add' function. 'def add(a, c):\n \"\"\"\n @param a:\n @param b:\n @return:\n \"\"\"\n pass' The inspection does not warn you of missing parameters if none of them is mentioned in a docstring: 'def mult(a, c):\n \"\"\"\n @return:\n \"\"\"\n pass'", - "markdown": "Reports mismatched parameters in a docstring. For example, `b` is highlighted, because there is no\nsuch a parameter in the `add` function.\n\n\n def add(a, c):\n \"\"\"\n @param a:\n @param b:\n @return:\n \"\"\"\n pass\n\nThe inspection does not warn you of missing parameters if none of them is mentioned in a docstring:\n\n\n def mult(a, c):\n \"\"\"\n @return:\n \"\"\"\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyIncorrectDocstring", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyListCreationInspection", - "shortDescription": { - "text": "Non-optimal list declaration" - }, - "fullDescription": { - "text": "Reports cases when a list declaration can be rewritten with a list literal. This ensures better performance of your application. Example: 'l = [1]\nl.append(2)' When the quick-fix is applied, the code changes to: 'l = [1, 2]'", - "markdown": "Reports cases when a list declaration\ncan be rewritten with a list literal.\n\nThis ensures better performance of your application.\n\n**Example:**\n\n\n l = [1]\n l.append(2)\n\nWhen the quick-fix is applied, the code changes to:\n\n\n l = [1, 2]\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyListCreation", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.editorconfig.editorconfigjetbrains", - "version": "232.9876", - "rules": [ - { - "id": "EditorConfigCharClassRedundancy", - "shortDescription": { - "text": "Unnecessary character class" - }, - "fullDescription": { - "text": "Reports character classes that consist of a single character. Such classes can be simplified to a character, for example '[a]'→'a'.", - "markdown": "Reports character classes that consist of a single character. Such classes can be simplified to a character, for example `[a]`→`a`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigCharClassRedundancy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigRootDeclarationUniqueness", - "shortDescription": { - "text": "Extra top-level declaration" - }, - "fullDescription": { - "text": "Reports multiple top-level declarations. There can be only one optional “root=true” top-level declaration in the EditorConfig file. Using multiple top-level declarations is not allowed.", - "markdown": "Reports multiple top-level declarations. There can be only one optional \"root=true\" top-level declaration in the EditorConfig file. Using multiple top-level declarations is not allowed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigRootDeclarationUniqueness", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigNumerousWildcards", - "shortDescription": { - "text": "Too many wildcards" - }, - "fullDescription": { - "text": "Reports sections that contain too many wildcards. Using a lot of wildcards may lead to performance issues.", - "markdown": "Reports sections that contain too many wildcards. Using a lot of wildcards may lead to performance issues." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "EditorConfigNumerousWildcards", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigPartialOverride", - "shortDescription": { - "text": "Overlapping sections" - }, - "fullDescription": { - "text": "Reports subsets of files specified in the current section that overlap with other subsets in other sections. For example: '[{foo,bar}]' and '[{foo,bas}]' both contain “foo”.", - "markdown": "Reports subsets of files specified in the current section that overlap with other subsets in other sections. For example: `[{foo,bar}]` and `[{foo,bas}]` both contain \"foo\"." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "EditorConfigPartialOverride", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigEmptySection", - "shortDescription": { - "text": "Empty section" - }, - "fullDescription": { - "text": "Reports sections that do not contain any EditorConfig properties.", - "markdown": "Reports sections that do not contain any EditorConfig properties." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigEmptySection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigShadowingOption", - "shortDescription": { - "text": "Overriding property" - }, - "fullDescription": { - "text": "Reports properties that override the same properties defined earlier in the file. For example: '[*.java]\nindent_size=4\n[{*.java,*.js}]\nindent_size=2' The second section includes the same files as '[*.java]' but also sets indent_size to value 2. Thus the first declaration 'indent_size=4'will be ignored.", - "markdown": "Reports properties that override the same properties defined earlier in the file.\n\nFor example:\n\n\n [*.java]\n indent_size=4\n [{*.java,*.js}]\n indent_size=2\n\nThe second section includes the same files as `[*.java]` but also sets indent_size to value 2. Thus the first declaration `indent_size=4`will be ignored." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigShadowingOption", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigListAcceptability", - "shortDescription": { - "text": "Unexpected value list" - }, - "fullDescription": { - "text": "Reports lists of values that are used in properties in which lists are not supported. In this case, only a single value can be specified.", - "markdown": "Reports lists of values that are used in properties in which lists are not supported. In this case, only a single value can be specified." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigListAcceptability", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigKeyCorrectness", - "shortDescription": { - "text": "Unknown property" - }, - "fullDescription": { - "text": "Reports properties that are not supported by the IDE. Note: some “ij” domain properties may require specific language plugins.", - "markdown": "Reports properties that are not supported by the IDE. Note: some \"ij\" domain properties may require specific language plugins." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigKeyCorrectness", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigPatternEnumerationRedundancy", - "shortDescription": { - "text": "Unnecessary braces" - }, - "fullDescription": { - "text": "Reports pattern lists that are either empty '{}' or contain just one pattern, for example '{foo}' in contrast to a list containing multiple patterns, for example '{foo,bar}'. In this case braces are handled as a part of the name. For example, the pattern '*.{a}' will match the file 'my.{a}' but not 'my.a'.", - "markdown": "Reports pattern lists that are either empty `{}` or contain just one pattern, for example `{foo}` in contrast to a list containing multiple patterns, for example `{foo,bar}`. In this case braces are handled as a part of the name. For example, the pattern `*.{a}` will match the file `my.{a}` but not `my.a`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigPatternEnumerationRedundancy", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigEncoding", - "shortDescription": { - "text": "File encoding doesn't match EditorConfig charset" - }, - "fullDescription": { - "text": "Checks that current file encoding matches the encoding defined in \"charset\" property of .editorconfig file.", - "markdown": "Checks that current file encoding matches the encoding defined in \"charset\" property of .editorconfig file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigEncoding", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigRootDeclarationCorrectness", - "shortDescription": { - "text": "Unexpected top-level declaration" - }, - "fullDescription": { - "text": "Reports unexpected top-level declarations. Top-level declarations other than “root=true” are not allowed in the EditorConfig file.", - "markdown": "Reports unexpected top-level declarations. Top-level declarations other than \"root=true\" are not allowed in the EditorConfig file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigRootDeclarationCorrectness", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigReferenceCorrectness", - "shortDescription": { - "text": "Invalid reference" - }, - "fullDescription": { - "text": "Reports identifiers that are either unknown or have a wrong type.", - "markdown": "Reports identifiers that are either unknown or have a wrong type." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigReferenceCorrectness", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigPairAcceptability", - "shortDescription": { - "text": "Unexpected key-value pair" - }, - "fullDescription": { - "text": "Reports key-value pairs that are not allowed in the current context.", - "markdown": "Reports key-value pairs that are not allowed in the current context." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigPairAcceptability", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigPatternRedundancy", - "shortDescription": { - "text": "Duplicate or redundant pattern" - }, - "fullDescription": { - "text": "Reports file patterns that are redundant as there already are other patterns that define the same scope of files or even a broader one. For example, in '[{*.java,*}]' the first '*.java' pattern defines a narrower scope compared to '*'. That is why it is redundant and can be removed.", - "markdown": "Reports file patterns that are redundant as there already are other patterns that define the same scope of files or even a broader one. For example, in `[{*.java,*}]` the first `*.java` pattern defines a narrower scope compared to `*`. That is why it is redundant and can be removed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigPatternRedundancy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigNoMatchingFiles", - "shortDescription": { - "text": "No matching files" - }, - "fullDescription": { - "text": "Reports sections with wildcard patterns that do not match any files under the directory in which the '.editorconfig' file is located.", - "markdown": "Reports sections with wildcard patterns that do not match any files under the directory in which the `.editorconfig` file is located." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigNoMatchingFiles", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigDeprecatedDescriptor", - "shortDescription": { - "text": "Deprecated property" - }, - "fullDescription": { - "text": "Reports EditorConfig properties that are no longer supported.", - "markdown": "Reports EditorConfig properties that are no longer supported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigDeprecatedDescriptor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigWildcardRedundancy", - "shortDescription": { - "text": "Redundant wildcard" - }, - "fullDescription": { - "text": "Reports wildcards that become redundant when the “**” wildcard is used in the same section. The “**” wildcard defines a broader set of files than any other wildcard. That is why, any other wildcard used in the same section has no affect and can be removed.", - "markdown": "Reports wildcards that become redundant when the \"\\*\\*\" wildcard is used in the same section.\n\n\nThe \"\\*\\*\" wildcard defines a broader set of files than any other wildcard.\nThat is why, any other wildcard used in the same section has no affect and can be removed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigWildcardRedundancy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigHeaderUniqueness", - "shortDescription": { - "text": "EditorConfig section is not unique" - }, - "fullDescription": { - "text": "Reports sections that define the same file pattern as other sections.", - "markdown": "Reports sections that define the same file pattern as other sections." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigHeaderUniqueness", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigShadowedOption", - "shortDescription": { - "text": "Overridden property" - }, - "fullDescription": { - "text": "Reports properties that are already defined in other sections. For example: '[*.java]\nindent_size=4\n[{*.java,*.js}]\nindent_size=2' The second section includes all '*.java' files too but it also redefines indent_size. As a result the value 2 will be used for files matching '*.java'.", - "markdown": "Reports properties that are already defined in other sections.\n\nFor example:\n\n\n [*.java]\n indent_size=4\n [{*.java,*.js}]\n indent_size=2\n\nThe second section includes all `*.java` files too but it also redefines indent_size. As a result the value 2 will be used for files matching `*.java`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigShadowedOption", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigEmptyHeader", - "shortDescription": { - "text": "Empty header" - }, - "fullDescription": { - "text": "Reports sections with an empty header. Section header must contain file path globs in the format similar to one supported by 'gitignore'.", - "markdown": "Reports sections with an empty header. Section header must contain file path globs in the format similar to one supported by `gitignore`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigEmptyHeader", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigValueCorrectness", - "shortDescription": { - "text": "Invalid property value" - }, - "fullDescription": { - "text": "Reports property values that do not meet value restrictions. For example, some properties may be only “true” or “false”, others contain only integer numbers etc. If a value has a limited set of variants, use code completion to see all of them.", - "markdown": "Reports property values that do not meet value restrictions. For example, some properties may be only \"true\" or \"false\", others contain only integer numbers etc. If a value has a limited set of variants, use code completion to see all of them." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigValueCorrectness", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigVerifyByCore", - "shortDescription": { - "text": "Invalid .editorconfig file" - }, - "fullDescription": { - "text": "Verifies the whole file using the backing EditorConfig core library and reports any failures. Any such failure would prevent EditorConfig properties from being correctly applied.", - "markdown": "Verifies the whole file using the backing EditorConfig core library and reports any failures. Any such failure would prevent EditorConfig properties from being correctly applied." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigVerifyByCore", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigValueUniqueness", - "shortDescription": { - "text": "Non-unique list value" - }, - "fullDescription": { - "text": "Reports duplicates in lists of values.", - "markdown": "Reports duplicates in lists of values." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigValueUniqueness", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigMissingRequiredDeclaration", - "shortDescription": { - "text": "Required declarations are missing" - }, - "fullDescription": { - "text": "Reports properties that miss the required declarations. Refer to the documentation for more information.", - "markdown": "Reports properties that miss the required declarations. Refer to the documentation for more information." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigMissingRequiredDeclaration", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigCharClassLetterRedundancy", - "shortDescription": { - "text": "Duplicate character class letter" - }, - "fullDescription": { - "text": "Reports wildcard patterns in the EditorConfig section that contain a duplicate character in the character class, for example '[aa]'.", - "markdown": "Reports wildcard patterns in the EditorConfig section that contain a duplicate character in the character class, for example `[aa]`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigCharClassLetterRedundancy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigSpaceInHeader", - "shortDescription": { - "text": "Space in file pattern" - }, - "fullDescription": { - "text": "Reports space characters in wildcard patterns that affect pattern matching. If these characters are not intentional, they should be removed.", - "markdown": "Reports space characters in wildcard patterns that affect pattern matching. If these characters are not intentional, they should be removed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "EditorConfigSpaceInHeader", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigOptionRedundancy", - "shortDescription": { - "text": "Redundant property" - }, - "fullDescription": { - "text": "Reports properties that are redundant when another applicable section already contains the same property and value. For example: '[*]\nindent_size=4\n[*.java]\nindent_size=4' are both applicable to '*.java' files and define the same 'indent_size' value.", - "markdown": "Reports properties that are redundant when another applicable section already contains the same property and value.\n\n\nFor example:\n\n\n [*]\n indent_size=4\n [*.java]\n indent_size=4\n\nare both applicable to `*.java` files and define the same `indent_size` value." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigOptionRedundancy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigUnusedDeclaration", - "shortDescription": { - "text": "Unused declaration" - }, - "fullDescription": { - "text": "Reports unused declarations. Such declarations can be removed.", - "markdown": "Reports unused declarations. Such declarations can be removed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigUnusedDeclaration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigUnexpectedComma", - "shortDescription": { - "text": "Unexpected comma" - }, - "fullDescription": { - "text": "Reports commas that cannot be used in the current context. Commas are allowed only as separators for values in lists.", - "markdown": "Reports commas that cannot be used in the current context. Commas are allowed only as separators for values in lists." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigUnexpectedComma", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "JavaScript", - "version": "232.9876", - "rules": [ - { - "id": "ConstantConditionalExpressionJS", - "shortDescription": { - "text": "Constant conditional expression" - }, - "fullDescription": { - "text": "Reports a conditional expression in the format 'true? result1: result2' or 'false? result1: result2. Suggests simplifying the expression.'", - "markdown": "Reports a conditional expression in the format `true? result1: result2` or `false? result1: result2``.\nSuggests simplifying the expression.\n`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ConstantConditionalExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSTestFailedLine", - "shortDescription": { - "text": "Highlight failure line in test code" - }, - "fullDescription": { - "text": "Reports a failed method call or an assertion in a test.", - "markdown": "Reports a failed method call or an assertion in a test." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSTestFailedLine", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Unit testing", - "index": 8, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NonBlockStatementBodyJS", - "shortDescription": { - "text": "Statement body without braces" - }, - "fullDescription": { - "text": "Reports a 'if', 'while', 'for', or 'with' statements whose body is not a block statement. Using code block in statement bodies is usually safer for downstream maintenance.", - "markdown": "Reports a `if`, `while`, `for`, or `with` statements whose body is not a block statement. Using code block in statement bodies is usually safer for downstream maintenance." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NonBlockStatementBodyJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSValidateJSDoc", - "shortDescription": { - "text": "Syntax errors and unresolved references in JSDoc" - }, - "fullDescription": { - "text": "Reports a syntax discrepancy in a documentation comment.", - "markdown": "Reports a syntax discrepancy in a documentation comment." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSValidateJSDoc", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IfStatementWithTooManyBranchesJS", - "shortDescription": { - "text": "'if' statement with too many branches" - }, - "fullDescription": { - "text": "Reports an 'if' statement with too many branches. Such statements may be confusing, and often indicate inadequate levels of design abstraction. Use the field below to specify the maximum number of branches expected.", - "markdown": "Reports an `if` statement with too many branches. Such statements may be confusing, and often indicate inadequate levels of design abstraction.\n\n\nUse the field below to specify the maximum number of branches expected." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "IfStatementWithTooManyBranchesJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "BreakStatementJS", - "shortDescription": { - "text": "'break' statement" - }, - "fullDescription": { - "text": "Reports a 'break' statements. Ignores 'break' statements that end case blocks.", - "markdown": "Reports a `break` statements. Ignores `break` statements that end case blocks." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "BreakStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FlowJSConfig", - "shortDescription": { - "text": "Missing .flowconfig" - }, - "fullDescription": { - "text": "Reports a JavaScript file with a '@flow' flag that doesn't have an associated '.flowconfig' file in the project.", - "markdown": "Reports a JavaScript file with a `@flow` flag that doesn't have an associated `.flowconfig` file in the project." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FlowJSConfig", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Flow type checker", - "index": 16, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSPotentiallyInvalidUsageOfClassThis", - "shortDescription": { - "text": "Potentially invalid reference to 'this' of a class from closure" - }, - "fullDescription": { - "text": "Reports an attempt to reference a member of an ECMAScript class via the 'this.' qualifier in a nested function that is not a lambda. 'this' in a nested function that is not a lambda is the function's own 'this' and doesn't relate to the outer class.", - "markdown": "Reports an attempt to reference a member of an ECMAScript class via the `this.` qualifier in a nested function that is not a lambda. \n`this` in a nested function that is not a lambda is the function's own `this` and doesn't relate to the outer class." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSPotentiallyInvalidUsageOfClassThis", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DebuggerStatementJS", - "shortDescription": { - "text": "'debugger' statement" - }, - "fullDescription": { - "text": "Reports a 'debugger' statement used for interaction with the Javascript debuggers. Such statements should not appear in production code.", - "markdown": "Reports a `debugger` statement used for interaction with the Javascript debuggers. Such statements should not appear in production code." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DebuggerStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnusedAssignment", - "shortDescription": { - "text": "Unused assignment" - }, - "fullDescription": { - "text": "Reports a variable whose value is never used after assignment. Suggests removing the unused variable to shorten the code and to avoid redundant allocations. The following cases are reported: A variable is never read after assignment. The value of a variable is always overwritten with another assignment before the variable is read next time. The initializer of a variable is redundant (for one of the above-mentioned reasons).", - "markdown": "Reports a variable whose value is never used after assignment. \nSuggests removing the unused variable to shorten the code and to avoid redundant allocations.\n\nThe following cases are reported:\n\n* A variable is never read after assignment.\n* The value of a variable is always overwritten with another assignment before the variable is read next time.\n* The initializer of a variable is redundant (for one of the above-mentioned reasons)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnusedAssignment", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Unused symbols", - "index": 19, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FlowJSError", - "shortDescription": { - "text": "Flow type checker" - }, - "fullDescription": { - "text": "Reports errors from Flow.", - "markdown": "Reports errors from [Flow](https://flowtype.org/)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "FlowJSError", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Flow type checker", - "index": 16, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ReuseOfLocalVariableJS", - "shortDescription": { - "text": "Reuse of local variable" - }, - "fullDescription": { - "text": "Reports reusing a local variable and overwriting its value with a new value that is not related to the original variable usage. Reusing a local variable in this way may be confusing because the intended semantics of the local variable may vary with each usage. It may also cause bugs, if code changes result in values that were expected to be overwritten while they are actually live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity.", - "markdown": "Reports reusing a local variable and overwriting its value with a new value that is not related to the original variable usage. Reusing a local variable in this way may be confusing because the intended semantics of the local variable may vary with each usage. It may also cause bugs, if code changes result in values that were expected to be overwritten while they are actually live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ReuseOfLocalVariableJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Data flow", - "index": 20, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ShiftOutOfRangeJS", - "shortDescription": { - "text": "Shift operation by possibly wrong constant" - }, - "fullDescription": { - "text": "Reports a shift operation where the second operand is a constant outside the reasonable range, for example, an integer shift operation outside the range '0..31', shifting by negative or overly large values.", - "markdown": "Reports a shift operation where the second operand is a constant outside the reasonable range, for example, an integer shift operation outside the range `0..31`, shifting by negative or overly large values." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ShiftOutOfRangeJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Bitwise operation issues", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSClosureCompilerSyntax", - "shortDescription": { - "text": "Incorrect usage of JSDoc tags" - }, - "fullDescription": { - "text": "Reports warnings implied by Google Closure Compiler annotations including correct use of '@abstract', '@interface', and '@implements' tags.", - "markdown": "Reports warnings implied by *Google Closure Compiler* annotations including correct use of `@abstract`, `@interface`, and `@implements` tags." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSClosureCompilerSyntax", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryContinueJS", - "shortDescription": { - "text": "Unnecessary 'continue' statement" - }, - "fullDescription": { - "text": "Reports an unnecessary 'continue' statement at the end of a loop. Suggests removing such statements.", - "markdown": "Reports an unnecessary `continue` statement at the end of a loop. Suggests removing such statements." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryContinueJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertLetToConst", - "shortDescription": { - "text": "'let' is used instead of 'const'" - }, - "fullDescription": { - "text": "Reports a 'let' declaration that can be made 'const'.", - "markdown": "Reports a `let` declaration that can be made `const`. " - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertLetToConst", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSXDomNesting", - "shortDescription": { - "text": "Invalid DOM element nesting" - }, - "fullDescription": { - "text": "Detects HTML elements in JSX files which are not nested properly according to the DOM specification. React reports runtime warnings on incorrectly nested elements.", - "markdown": "Detects HTML elements in JSX files which are not nested properly according to the DOM specification. React reports runtime warnings on incorrectly nested elements." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSXDomNesting", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/React", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptValidateTypes", - "shortDescription": { - "text": "Type mismatch" - }, - "fullDescription": { - "text": "Reports a parameter, return value, or assigned expression of incorrect type.", - "markdown": "Reports a parameter, return value, or assigned expression of incorrect type." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "TypeScriptValidateTypes", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "BadExpressionStatementJS", - "shortDescription": { - "text": "Expression statement which is not assignment or call" - }, - "fullDescription": { - "text": "Reports an expression statement that is neither an assignment nor a call. Such statements usually indicate an error.", - "markdown": "Reports an expression statement that is neither an assignment nor a call. Such statements usually indicate an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "BadExpressionStatementJS", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ConfusingFloatingPointLiteralJS", - "shortDescription": { - "text": "Confusing floating point literal" - }, - "fullDescription": { - "text": "Reports any floating point number that does not have a decimal point, or any numbers before the decimal point, or and numbers after the decimal point. Such literals may be confusing, and violate several coding standards.", - "markdown": "Reports any floating point number that does not have a decimal point, or any numbers before the decimal point, or and numbers after the decimal point. Such literals may be confusing, and violate several coding standards." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ConfusingFloatingPointLiteralJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "BreakStatementWithLabelJS", - "shortDescription": { - "text": "'break' statement with label" - }, - "fullDescription": { - "text": "Reports a labeled 'break' statement.", - "markdown": "Reports a labeled `break` statement." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "BreakStatementWithLabelJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ContinueOrBreakFromFinallyBlockJS", - "shortDescription": { - "text": "'continue' or 'break' inside 'finally' block" - }, - "fullDescription": { - "text": "Reports a 'break' or 'continue' statement inside a 'finally' block. Such statements are very confusing, may hide exceptions, and complicate debugging.", - "markdown": "Reports a `break` or `continue` statement inside a `finally` block. Such statements are very confusing, may hide exceptions, and complicate debugging." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ContinueOrBreakFromFinallyBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "StatementsPerFunctionJS", - "shortDescription": { - "text": "Overly long function" - }, - "fullDescription": { - "text": "Reports an overly long function. Function length is calculated by counting up the number of non-empty statements in the function. Functions that are too long are error-prone and difficult to test. Use the field below to specify the maximum acceptable number of statements in a function.", - "markdown": "Reports an overly long function. Function length is calculated by counting up the number of non-empty statements in the function. Functions that are too long are error-prone and difficult to test.\n\n\nUse the field below to specify the maximum acceptable number of statements in a function." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionTooLongJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 35, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryLocalVariableJS", - "shortDescription": { - "text": "Redundant local variable" - }, - "fullDescription": { - "text": "Reports an unnecessary local variable that does not make a function more comprehensible: a local variable that is immediately returned a local variable that is immediately assigned to another variable and is not used anymore a local variable that always has the same value as another local variable or parameter. Use the checkbox below to have this inspection ignore variables that are immediately returned or thrown. Some coding styles suggest using such variables for clarity and ease of debugging.", - "markdown": "Reports an unnecessary local variable that does not make a function more comprehensible:\n\n* a local variable that is immediately returned\n* a local variable that is immediately assigned to another variable and is not used anymore\n* a local variable that always has the same value as another local variable or parameter.\n\n\nUse the checkbox below to have this inspection ignore variables that are immediately\nreturned or thrown. Some coding styles suggest using such variables for clarity and\nease of debugging." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryLocalVariableJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Data flow", - "index": 20, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSMethodCanBeStatic", - "shortDescription": { - "text": "Method can be made 'static'" - }, - "fullDescription": { - "text": "Reports a class method that can be safely made 'static'. A method can be 'static' if it does not reference any of its class' non-static methods and non-static fields and is not overridden in a subclass. Use the first checkbox below to inspect only 'private' methods.", - "markdown": "Reports a class method that can be safely made `static`. A method can be `static` if it does not reference any of its class' non-static methods and non-static fields and is not overridden in a subclass.\n\n\nUse the first checkbox below to inspect only `private` methods." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSMethodCanBeStatic", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSDeclarationsAtScopeStart", - "shortDescription": { - "text": "'var' declared not at the beginning of a function" - }, - "fullDescription": { - "text": "Checks that declarations of local variables declared with var are at the top of a function scope. By default, variable declarations are always moved (\"hoisted\") invisibly to the top of their containing scope when the code is executed. Therefore, declaring them at the top of the scope helps represent this behavior in the code.", - "markdown": "Checks that declarations of local variables declared with **var** are at the top of a function scope. \n\nBy default, variable declarations are always moved (\"hoisted\") invisibly to the top of their containing scope when the code is executed. Therefore, declaring them at the top of the scope helps represent this behavior in the code." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSDeclarationsAtScopeStart", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ContinueStatementWithLabelJS", - "shortDescription": { - "text": "'continue' statement with label" - }, - "fullDescription": { - "text": "Reports a labeled 'continue' statement.", - "markdown": "Reports a labeled `continue` statement." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ContinueStatementWithLabelJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSObjectNullOrUndefined", - "shortDescription": { - "text": "Object is 'null' or 'undefined'" - }, - "fullDescription": { - "text": "Reports an error caused by invoking a method, accessing a property, or calling a function on an object that is 'undefined' or 'null'.", - "markdown": "Reports an error caused by invoking a method, accessing a property, or calling a function on an object that is `undefined` or `null`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSObjectNullOrUndefined", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptMissingConfigOption", - "shortDescription": { - "text": "Missing tsconfig.json option " - }, - "fullDescription": { - "text": "Reports a usage that requires an explicit option in 'tsconfig.json'. For example, to use JSX in '.tsx' files, 'tsconfig.json' must contain '\"jsx\"' property.", - "markdown": "Reports a usage that requires an explicit option in `tsconfig.json`. For example, to use JSX in `.tsx` files, `tsconfig.json` must contain `\"jsx\"` property." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TypeScriptMissingConfigOption", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSXUnresolvedComponent", - "shortDescription": { - "text": "Unresolved JSX component" - }, - "fullDescription": { - "text": "Reports an unresolved reference to a JSX component. Suggests adding a missing import statement if the referenced component is defined in the project or its dependencies or creating a new component with this name. The template for a new component can be modified in Editor | File and Code Templates.", - "markdown": "Reports an unresolved reference to a JSX component. Suggests adding a missing import statement if the referenced component is defined in the project or its dependencies or creating a new component with this name.\n\nThe template for a new component can be modified in Editor \\| File and Code Templates." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSXUnresolvedComponent", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryLabelOnBreakStatementJS", - "shortDescription": { - "text": "Unnecessary label on 'break' statement" - }, - "fullDescription": { - "text": "Reports a labeled 'break' statement whose labels may be removed without changing the flow of control.", - "markdown": "Reports a labeled `break` statement whose labels may be removed without changing the flow of control." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryLabelOnBreakStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ShorthandObjectProperty", - "shortDescription": { - "text": "Property can be replaced with shorthand" - }, - "fullDescription": { - "text": "Reports an object property that can be converted to ES6 shorthand style and provides a quick-fix to do it. Example: 'var obj = {foo:foo}' After applying the quick-fix the code looks as follows: 'var obj = {foo}'", - "markdown": "Reports an object property that can be converted to ES6 shorthand style and provides a quick-fix to do it.\n\nExample:\n\n\n var obj = {foo:foo}\n\nAfter applying the quick-fix the code looks as follows:\n\n\n var obj = {foo}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ShorthandObjectProperty", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ContinueStatementJS", - "shortDescription": { - "text": "'continue' statement" - }, - "fullDescription": { - "text": "Reports a 'continue' statement.", - "markdown": "Reports a `continue` statement." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ContinueStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "AssignmentToForLoopParameterJS", - "shortDescription": { - "text": "Assignment to 'for' loop parameter" - }, - "fullDescription": { - "text": "Reports an assignment to a variable declared as a 'for' loop parameter. Although occasionally intended, this construct can be extremely confusing, and is often a result of an error.", - "markdown": "Reports an assignment to a variable declared as a `for` loop parameter. Although occasionally intended, this construct can be extremely confusing, and is often a result of an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "AssignmentToForLoopParameterJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Assignment issues", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSPotentiallyInvalidConstructorUsage", - "shortDescription": { - "text": "Potentially invalid constructor usage" - }, - "fullDescription": { - "text": "Reports a usage of a potentially invalid constructor function, for example: a function that is not a constructor after 'new', using a constructor's prototype or calling a constructor without 'new'. A constructor function is assumed to have an upper case name (optional) or have an explicit JSDoc '@constructor' tag.", - "markdown": "Reports a usage of a potentially invalid constructor function, for example: a function that is not a constructor after `new`, using a constructor's prototype or calling a constructor without `new`. A constructor function is assumed to have an upper case name (optional) or have an explicit JSDoc `@constructor` tag." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSPotentiallyInvalidConstructorUsage", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PointlessArithmeticExpressionJS", - "shortDescription": { - "text": "Pointless arithmetic expression" - }, - "fullDescription": { - "text": "Reports an arithmetic expression that include adding or subtracting zero, multiplying by zero or one, division by one, and shift by zero. Such expressions may result from not fully completed automated refactoring.", - "markdown": "Reports an arithmetic expression that include adding or subtracting zero, multiplying by zero or one, division by one, and shift by zero. Such expressions may result from not fully completed automated refactoring." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PointlessArithmeticExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NodeCoreCodingAssistance", - "shortDescription": { - "text": "Unresolved Node.js APIs" - }, - "fullDescription": { - "text": "Suggests configuring coding assistance for Node.js, for example, 'require' and/or core modules ('path', 'http', 'fs', etc.). See https://nodejs.org/api/ for the complete list.", - "markdown": "Suggests configuring coding assistance for Node.js, for example, `require` and/or core modules ('path', 'http', 'fs', etc.).\n\n\nSee for the complete list." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NodeCoreCodingAssistance", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Node.js", - "index": 45, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUndeclaredVariable", - "shortDescription": { - "text": "Implicitly declared global JavaScript variable" - }, - "fullDescription": { - "text": "Reports an implicit declaration of a global variable. Example: 'var aaa = 1; // good\n bbb = 2; // bad, if bbb is not declared with 'var' somewhere'", - "markdown": "Reports an implicit declaration of a global variable.\n\nExample:\n\n\n var aaa = 1; // good\n bbb = 2; // bad, if bbb is not declared with 'var' somewhere\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSUndeclaredVariable", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DivideByZeroJS", - "shortDescription": { - "text": "Division by zero" - }, - "fullDescription": { - "text": "Reports division by zero or a remainder by zero.", - "markdown": "Reports division by zero or a remainder by zero." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DivideByZeroJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSPrimitiveTypeWrapperUsage", - "shortDescription": { - "text": "Primitive type object wrapper used" - }, - "fullDescription": { - "text": "Reports an improper usage of a wrapper for primitive types or a property of a primitive type being modified, as in the latter case the assigned value will be lost.", - "markdown": "Reports an improper usage of a wrapper for primitive types or a property of a primitive type being modified, as in the latter case the assigned value will be lost." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSPrimitiveTypeWrapperUsage", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptSmartCast", - "shortDescription": { - "text": "Narrowed type" - }, - "fullDescription": { - "text": "Reports a usage of a variable where the variable type is narrowed by a type guard. Note that severity level doesn't affect this inspection.", - "markdown": "Reports a usage of a variable where the variable type is narrowed by a type guard. Note that severity level doesn't affect this inspection." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TypeScriptSmartCast", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertIndexedForToForOf", - "shortDescription": { - "text": "Indexed 'for' is used instead of 'for..of'" - }, - "fullDescription": { - "text": "Reports an indexed 'for' loop used on an array. Suggests replacing it with a 'for..of' loop. 'for..of' loops are introduced in ECMAScript 6 and iterate over 'iterable' objects.", - "markdown": "Reports an indexed [for](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for) loop used on an array. Suggests replacing it with a [for..of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) loop. \n`for..of` loops are introduced in ECMAScript 6 and iterate over `iterable` objects." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertIndexedForToForOf", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSLastCommaInArrayLiteral", - "shortDescription": { - "text": "Unneeded last comma in array literal" - }, - "fullDescription": { - "text": "Reports a usage of a trailing comma in an array literal. The warning is reported only when the JavaScript language version is set to ECMAScript 5.1. Although trailing commas in arrays are allowed by the specification, some browsers may throw an error when a trailing comma is used. You can configure formatting options for trailing commas in Code Style | JavaScript or TypeScript | Punctuation.", - "markdown": "Reports a usage of a trailing comma in an array literal.\n\nThe warning is reported only when the JavaScript language version is set to ECMAScript 5.1.\n\nAlthough trailing commas in arrays are allowed by the specification, some browsers may throw an error when a trailing comma is used.\n\nYou can configure formatting options for trailing commas in **Code Style** \\| **JavaScript** or **TypeScript** \\| **Punctuation**." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSLastCommaInArrayLiteral", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ConditionalExpressionJS", - "shortDescription": { - "text": "Conditional expression" - }, - "fullDescription": { - "text": "Reports a ternary conditional expression. Some coding standards prohibit such expressions in favor of explicit 'if' statements.", - "markdown": "Reports a ternary conditional expression. Some coding standards prohibit such expressions in favor of explicit `if` statements." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ConditionalExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertVarToLetConst", - "shortDescription": { - "text": "'var' is used instead of 'let' or 'const'" - }, - "fullDescription": { - "text": "Reports a 'var' declaration that is used instead of 'let' or 'const'. Both 'let' and 'const' are block-scoped and behave more strictly. Suggests replacing all 'var' declarations with 'let' or 'const' declarations, depending on the semantics of a particular value. The declarations may be moved to the top of the function or placed before the first usage of the variable to avoid Reference errors. Select the 'Conservatively convert var with Fix all action' option to prevent any changes in these complex cases when using the 'Fix all' action.", - "markdown": "Reports a `var` declaration that is used instead of `let` or `const`. \nBoth `let` and `const` are block-scoped and behave more strictly. \n\nSuggests replacing all `var` declarations with `let` or `const` declarations, depending on the semantics of a particular value. The declarations may be moved to the top of the function or placed before the first usage of the variable to avoid Reference errors. \nSelect the 'Conservatively convert var with Fix all action' option to prevent any changes in these complex cases when using the 'Fix all' action." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertVarToLetConst", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PointlessBooleanExpressionJS", - "shortDescription": { - "text": "Pointless statement or boolean expression" - }, - "fullDescription": { - "text": "Reports a pointless or pointlessly complicated boolean expression or statement. Example: 'let a = !(false && x);\n let b = false || x;' After the quick fix is applied the result looks like: 'let a = true;\n let b = x;'", - "markdown": "Reports a pointless or pointlessly complicated boolean expression or statement.\n\nExample:\n\n\n let a = !(false && x);\n let b = false || x;\n\nAfter the quick fix is applied the result looks like:\n\n\n let a = true;\n let b = x;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PointlessBooleanExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSReferencingMutableVariableFromClosure", - "shortDescription": { - "text": "Referencing mutable variable from closure" - }, - "fullDescription": { - "text": "Reports access to outer mutable variables from functions. Example: 'for (var i = 1; i <= 3; i++) {\n setTimeout(function() {\n console.log(i); // bad\n }, 0);\n }'", - "markdown": "Reports access to outer mutable variables from functions.\n\nExample:\n\n\n for (var i = 1; i <= 3; i++) {\n setTimeout(function() {\n console.log(i); // bad\n }, 0);\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSReferencingMutableVariableFromClosure", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DynamicallyGeneratedCodeJS", - "shortDescription": { - "text": "Execution of dynamically generated code" - }, - "fullDescription": { - "text": "Reports a call of the 'eval()', 'setTimeout()', or 'setInterval()' function or an allocation of a 'Function' object. These functions are used to execute arbitrary strings of JavaScript text, which often dynamically generated. This can be very confusing, and may be a security risk. Ignores the cases when a callback function is provided to these methods statically, without code generation.", - "markdown": "Reports a call of the `eval()`, `setTimeout()`, or `setInterval()` function or an allocation of a `Function` object. These functions are used to execute arbitrary strings of JavaScript text, which often dynamically generated. This can be very confusing, and may be a security risk. \n\nIgnores the cases when a callback function is provided to these methods statically, without code generation." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DynamicallyGeneratedCodeJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NegatedConditionalExpressionJS", - "shortDescription": { - "text": "Negated conditional expression" - }, - "fullDescription": { - "text": "Reports a conditional expression whose condition is negated. Suggests flipping the order of branches in the conditional expression to increase the clarity of the statement. Example: '!condition ? 2 : 1'", - "markdown": "Reports a conditional expression whose condition is negated. Suggests flipping the order of branches in the conditional expression to increase the clarity of the statement. Example: `!condition ? 2 : 1`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NegatedConditionalExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUrlImportUsage", - "shortDescription": { - "text": "URL import is used" - }, - "fullDescription": { - "text": "Checks used URL imports in the JavaScript language. Suggests downloading the module for the specified remote URL. Such association enables the IDE to provide proper code completion and navigation. URLs in import specifiers are supported only for ECMAScript modules in the JavaScript language.", - "markdown": "Checks used URL imports in the JavaScript language. Suggests downloading the module for the specified remote URL. Such association enables the IDE to provide proper code completion and navigation. \n\nURLs in import specifiers are supported only for ECMAScript modules in the JavaScript language." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSUrlImportUsage", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Imports and dependencies", - "index": 47, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryLabelOnContinueStatementJS", - "shortDescription": { - "text": "Unnecessary label on 'continue' statement" - }, - "fullDescription": { - "text": "Reports a labeled 'continue' statement whose labels may be removed without changing the flow of control.", - "markdown": "Reports a labeled `continue` statement whose labels may be removed without changing the flow of control." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryLabelOnContinueStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ChainedEqualityJS", - "shortDescription": { - "text": "Chained equality" - }, - "fullDescription": { - "text": "Reports a chained equality comparison (i.e. 'a==b==c'). Such comparisons are confusing.", - "markdown": "Reports a chained equality comparison (i.e. `a==b==c`). Such comparisons are confusing." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ChainedEqualityComparisonsJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SillyAssignmentJS", - "shortDescription": { - "text": "Variable is assigned to itself" - }, - "fullDescription": { - "text": "Reports an assignment in the form 'x = x'.", - "markdown": "Reports an assignment in the form `x = x`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SillyAssignmentJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Assignment issues", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSPotentiallyInvalidTargetOfIndexedPropertyAccess", - "shortDescription": { - "text": "Possibly incorrect target of indexed property access" - }, - "fullDescription": { - "text": "Reports a potentially invalid indexed property access, for example, 'Array[1]'.", - "markdown": "Reports a potentially invalid indexed property access, for example, `Array[1]`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSPotentiallyInvalidTargetOfIndexedPropertyAccess", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSAccessibilityCheck", - "shortDescription": { - "text": "Inaccessible @private and @protected members referenced" - }, - "fullDescription": { - "text": "Reports a reference to a JavaScript member that is marked with a '@private' or '@protected' tag but does not comply with visibility rules that these tags imply.", - "markdown": "Reports a reference to a JavaScript member that is marked with a `@private` or `@protected` tag but does not comply with visibility rules that these tags imply." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSAccessibilityCheck", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertRequireIntoImport", - "shortDescription": { - "text": "'require()' is used instead of 'import'" - }, - "fullDescription": { - "text": "Reports a 'require()' statement. Suggests converting it to a 'require()' call with an 'import' statement. Enable 'Convert require() inside inner scopes with Fix all action' to convert all 'require()' calls inside the nested functions and statements when using the 'Fix all' action. Please note that converting 'require()' statements inside inner scopes to 'import' statements may cause changes in the semantics of the code. Import statements are static module dependencies and are hoisted, which means that they are moved to the top of the current module. 'require()' calls load modules dynamically. They can be executed conditionally, and their scope is defined by the expression in which they are used. Clear the 'Convert require() inside inner scopes with Fix all action' checkbox to prevent any changes in these complex cases when using the 'Fix all' action.", - "markdown": "Reports a `require()` statement. Suggests converting it to a `require()` call with an `import` statement. \n\nEnable 'Convert require() inside inner scopes with Fix all action' to convert all `require()` calls inside the nested functions and statements when using the 'Fix all' action. \n\nPlease note that converting `require()` statements inside inner scopes to `import` statements may cause changes in the semantics of the code. Import statements are static module dependencies and are hoisted, which means that they are moved to the top of the current module. `require()` calls load modules dynamically. They can be executed conditionally, and their scope is defined by the expression in which they are used. \nClear the 'Convert require() inside inner scopes with Fix all action' checkbox to prevent any changes in these complex cases when using the 'Fix all' action." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertRequireIntoImport", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FunctionWithMultipleLoopsJS", - "shortDescription": { - "text": "Function with multiple loops" - }, - "fullDescription": { - "text": "Reports a function with multiple loop statements.", - "markdown": "Reports a function with multiple loop statements." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionWithMultipleLoopsJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 35, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LabeledStatementJS", - "shortDescription": { - "text": "Labeled statement" - }, - "fullDescription": { - "text": "Reports a labeled statement.", - "markdown": "Reports a labeled statement." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LabeledStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnusedCatchParameterJS", - "shortDescription": { - "text": "Unused 'catch' parameter" - }, - "fullDescription": { - "text": "Reports a 'catch' parameter that is not used in the corresponding block. The 'catch' parameters named 'ignore' or 'ignored' are ignored. Use the checkbox below to disable this inspection for 'catch' blocks with comments.", - "markdown": "Reports a `catch` parameter that is not used in the corresponding block. The `catch` parameters named `ignore` or `ignored` are ignored.\n\n\nUse the checkbox below to disable this inspection for `catch`\nblocks with comments." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnusedCatchParameterJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NpmUsedModulesInstalled", - "shortDescription": { - "text": "Missing module dependency" - }, - "fullDescription": { - "text": "Reports a module from a 'require()' call or an 'import' statement that is not installed or is not listed in package.json dependencies. Suggests installing the module and/or including it into package.json. For 'require()' calls, works only in the files from the scope of Node.js Core JavaScript library.", - "markdown": "Reports a module from a `require()` call or an `import` statement that is not installed or is not listed in package.json dependencies.\n\nSuggests installing the module and/or including it into package.json.\n\nFor `require()` calls, works only in the files from the scope of *Node.js Core* JavaScript library." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "NpmUsedModulesInstalled", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Imports and dependencies", - "index": 47, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "WithStatementJS", - "shortDescription": { - "text": "'with' statement" - }, - "fullDescription": { - "text": "Reports a 'with' statements. Such statements result in potentially confusing implicit bindings, and may behave strangely in setting new variables.", - "markdown": "Reports a `with` statements. Such statements result in potentially confusing implicit bindings, and may behave strangely in setting new variables." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "WithStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptCheckImport", - "shortDescription": { - "text": "Unresolved imported name" - }, - "fullDescription": { - "text": "Reports an unresolved name or binding in an 'import' declaration in TypeScript code.", - "markdown": "Reports an unresolved name or binding in an `import` declaration in TypeScript code." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "TypeScriptCheckImport", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSConstantReassignment", - "shortDescription": { - "text": "Attempt to assign to const or readonly variable" - }, - "fullDescription": { - "text": "Reports reassigning a value to a constant or a readonly variable.", - "markdown": "Reports reassigning a value to a constant or a readonly variable." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JSConstantReassignment", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MagicNumberJS", - "shortDescription": { - "text": "Magic number" - }, - "fullDescription": { - "text": "Reports a \"magic number\" that is a numeric literal used without being named by a constant declaration. Magic numbers can result in code whose intention is unclear, and may result in errors if a magic number is changed in one code location but remains unchanged in another. The numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000, 0.0 and 1.0 are ignored.", - "markdown": "Reports a \"magic number\" that is a numeric literal used without being named by a constant declaration. Magic numbers can result in code whose intention is unclear, and may result in errors if a magic number is changed in one code location but remains unchanged in another. The numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000, 0.0 and 1.0 are ignored." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MagicNumberJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FunctionNamingConventionJS", - "shortDescription": { - "text": "Function naming convention" - }, - "fullDescription": { - "text": "Reports a function whose name is too short, too long, or does not follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length, and a regular expression for function names. Use the standard 'java.util.regex' format for regular expressions.", - "markdown": "Reports a function whose name is too short, too long, or does not follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length, and a regular expression\nfor function names. Use the standard `java.util.regex` format for regular expressions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionNamingConventionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Naming conventions", - "index": 50, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSXSyntaxUsed", - "shortDescription": { - "text": "JSX syntax used" - }, - "fullDescription": { - "text": "Reports a usage of a JSX tag in JavaScript code.", - "markdown": "Reports a usage of a JSX tag in JavaScript code." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JSXSyntaxUsed", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSJoinVariableDeclarationAndAssignment", - "shortDescription": { - "text": "Variable declaration can be merged with the first assignment to the variable" - }, - "fullDescription": { - "text": "Reports a variable that is declared without an initializer and is used much further in the code or in a single nested scope. Suggests moving the variable closer to its usages and joining it with the initializer expression.", - "markdown": "Reports a variable that is declared without an initializer and is used much further in the code or in a single nested scope. Suggests moving the variable closer to its usages and joining it with the initializer expression." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSJoinVariableDeclarationAndAssignment", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSRedundantSwitchStatement", - "shortDescription": { - "text": "'switch' statement is redundant and can be replaced" - }, - "fullDescription": { - "text": "Reports a 'switch' statement with an empty body, or with only one 'case' branch, or with a 'default' branch only.", - "markdown": "Reports a `switch` statement with an empty body, or with only one `case` branch, or with a `default` branch only." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSRedundantSwitchStatement", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Switch statement issues", - "index": 51, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptLibrary", - "shortDescription": { - "text": "Missing global library" - }, - "fullDescription": { - "text": "Reports a TypeScript library file that is required for a symbol but is not listed under the 'lib' compiler option in 'tsconfig.json'.", - "markdown": "Reports a TypeScript library file that is required for a symbol but is not listed under the `lib` compiler option in `tsconfig.json`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "TypeScriptLibrary", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptMissingAugmentationImport", - "shortDescription": { - "text": "Missing augmentation import" - }, - "fullDescription": { - "text": "Reports a usage from augmentation module without an explicit import.", - "markdown": "Reports a usage from [augmentation module](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation) without an explicit import." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptMissingAugmentationImport", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnusedGlobalSymbols", - "shortDescription": { - "text": "Unused global symbol" - }, - "fullDescription": { - "text": "Reports an unused globally accessible public function, variable, class, or property.", - "markdown": "Reports an unused globally accessible public function, variable, class, or property." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnusedGlobalSymbols", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Unused symbols", - "index": 19, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertModuleExportToExport", - "shortDescription": { - "text": "'module.exports' is used instead of 'export'" - }, - "fullDescription": { - "text": "Reports a 'module.export' statement. Suggests replacing it with an 'export' or 'export default' statement. Please note that the quick-fix for converting 'module.export' into 'export' is not available for 'module.export' inside functions or statements because 'export' statements can only be at the top level of a module.", - "markdown": "Reports a `module.export` statement. Suggests replacing it with an `export` or `export default` statement. \n\nPlease note that the quick-fix for converting `module.export` into `export` is not available for `module.export` inside functions or statements because `export` statements can only be at the top level of a module." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertModuleExportToExport", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DocumentWriteJS", - "shortDescription": { - "text": "Call to 'document.write()'" - }, - "fullDescription": { - "text": "Reports a method call to 'document.write()' or 'document.writeln()'. Most usages of such calls are performed better with explicit DOM calls, such as 'getElementByID()' and 'createElement()'. Additionally, the 'write()' and 'writeln()' calls will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can result in difficulty to point out bugs.", - "markdown": "Reports a method call to `document.write()` or `document.writeln()`. Most usages of such calls are performed better with explicit DOM calls, such as `getElementByID()` and `createElement()`. Additionally, the `write()` and `writeln()` calls will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can result in difficulty to point out bugs." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DocumentWriteJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/DOM issues", - "index": 52, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "AnonymousFunctionJS", - "shortDescription": { - "text": "Anonymous function" - }, - "fullDescription": { - "text": "Reports an anonymous function. An explicit name of a function expression may be helpful for debugging. Ignores function expressions without names if they have a 'name' property specified in the ECMAScript 6 standard. For example, 'var bar = function() {};' is not reported.", - "markdown": "Reports an anonymous function. An explicit name of a function expression may be helpful for debugging. Ignores function expressions without names if they have a `name` property specified in the ECMAScript 6 standard. For example, `var bar = function() {};` is not reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "AnonymousFunctionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "BlockStatementJS", - "shortDescription": { - "text": "Unnecessary block statement" - }, - "fullDescription": { - "text": "Reports a block statement that is not used as the body of 'if', 'for', 'while', 'do', 'with', or 'try' statements, or as the body of a function declaration. Starting from ECMAScript 6, JavaScript blocks introduce new scopes for 'let' and 'const' variables, but still free-standing block statements may be confusing and result in subtle bugs when used with 'var' variables.", - "markdown": "Reports a block statement that is not used as the body of `if`, `for`, `while`, `do`, `with`, or `try` statements, or as the body of a function declaration. Starting from ECMAScript 6, JavaScript blocks introduce new scopes for `let` and `const` variables, but still free-standing block statements may be confusing and result in subtle bugs when used with `var` variables." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "BlockStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ObjectAllocationIgnoredJS", - "shortDescription": { - "text": "Result of object allocation ignored" - }, - "fullDescription": { - "text": "Reports object allocation where the result of the allocated object is ignored, for example, 'new Error();' as a statement, without any assignment. Such allocation expressions may indicate an odd object initialization strategy.", - "markdown": "Reports object allocation where the result of the allocated object is ignored, for example, `new Error();` as a statement, without any assignment. Such allocation expressions may indicate an odd object initialization strategy." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ObjectAllocationIgnored", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "InfiniteRecursionJS", - "shortDescription": { - "text": "Infinite recursion" - }, - "fullDescription": { - "text": "Reports a function which must either recurse infinitely or throw an exception. Such functions may not return normally.", - "markdown": "Reports a function which must either recurse infinitely or throw an exception. Such functions may not return normally." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "InfiniteRecursionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NestedConditionalExpressionJS", - "shortDescription": { - "text": "Nested conditional expression" - }, - "fullDescription": { - "text": "Reports a ternary conditional expression within another ternary condition. Such nested conditionals may be extremely confusing, and best replaced by more explicit conditional logic.", - "markdown": "Reports a ternary conditional expression within another ternary condition. Such nested conditionals may be extremely confusing, and best replaced by more explicit conditional logic." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NestedConditionalExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSTypeOfValues", - "shortDescription": { - "text": "'typeof' comparison with non-standard value" - }, - "fullDescription": { - "text": "Reports a comparison of a 'typeof' expression with a literal string which is not one of the standard types: 'undefined', 'object', 'boolean', 'number', 'string', 'function', or 'symbol'. Such comparisons always return 'false'.", - "markdown": "Reports a comparison of a `typeof` expression with a literal string which is not one of the standard types: `undefined`, `object`, `boolean`, `number`, `string`, `function`, or `symbol`. Such comparisons always return `false`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSTypeOfValues", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IncompatibleMaskJS", - "shortDescription": { - "text": "Incompatible bitwise mask operation" - }, - "fullDescription": { - "text": "Reports a bitwise mask expression which for sure evaluates to 'true' or 'false'. Expressions are of the form '(var & constant1) == constant2' or '(var | constant1) == constant2', where 'constant1' and 'constant2' are incompatible bitmask constants. Example: '// Incompatible mask: as the last byte in mask is zero,\n// something like 0x1200 would be possible, but not 0x1234\nif ((mask & 0xFF00) == 0x1234) {...}'", - "markdown": "Reports a bitwise mask expression which for sure evaluates to `true` or `false`. Expressions are of the form `(var & constant1) == constant2` or `(var | constant1) == constant2`, where `constant1` and `constant2` are incompatible bitmask constants.\n\nExample:\n\n\n // Incompatible mask: as the last byte in mask is zero,\n // something like 0x1200 would be possible, but not 0x1234\n if ((mask & 0xFF00) == 0x1234) {...}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "IncompatibleBitwiseMaskOperation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Bitwise operation issues", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TextLabelInSwitchStatementJS", - "shortDescription": { - "text": "Text label in 'switch' statement" - }, - "fullDescription": { - "text": "Reports a labeled statement inside a 'switch' statement, which often results from a typo. Example: 'switch(x)\n {\n case 1:\n case2: //typo!\n case 3:\n break;\n }'", - "markdown": "Reports a labeled statement inside a `switch` statement, which often results from a typo.\n\nExample:\n\n\n switch(x)\n {\n case 1:\n case2: //typo!\n case 3:\n break;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TextLabelInSwitchStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Switch statement issues", - "index": 51, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6PossiblyAsyncFunction", - "shortDescription": { - "text": "'await' in non-async function" - }, - "fullDescription": { - "text": "Reports a usage of 'await' in a function that was possibly intended to be async but is actually missing the 'async' modifier. Although 'await' can be used as an identifier, it is likely that it was intended to be used as an operator, so the containing function should be made 'async'.", - "markdown": "Reports a usage of `await` in a function that was possibly intended to be async but is actually missing the `async` modifier. Although `await` can be used as an identifier, it is likely that it was intended to be used as an operator, so the containing function should be made `async`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6PossiblyAsyncFunction", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Async code and promises", - "index": 53, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EmptyCatchBlockJS", - "shortDescription": { - "text": "Empty 'catch' block" - }, - "fullDescription": { - "text": "Reports an empty 'catch' block. This indicates that errors are simply ignored instead of handling them. Any comment in a 'catch' block mutes the inspection.", - "markdown": "Reports an empty `catch` block. This indicates that errors are simply ignored instead of handling them. \n\nAny comment in a `catch` block mutes the inspection." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EmptyCatchBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSHint", - "shortDescription": { - "text": "JSHint" - }, - "fullDescription": { - "text": "Reports a problem detected by the JSHint linter.", - "markdown": "Reports a problem detected by the [JSHint](https://jshint.com/) linter." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JSHint", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code quality tools", - "index": 54, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FlowJSFlagCommentPlacement", - "shortDescription": { - "text": "Misplaced @flow flag" - }, - "fullDescription": { - "text": "Reports a '@flow' flag comment that is not located at the top of a file.", - "markdown": "Reports a `@flow` flag comment that is not located at the top of a file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FlowJSFlagCommentPlacement", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Flow type checker", - "index": 16, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Eslint", - "shortDescription": { - "text": "ESLint" - }, - "fullDescription": { - "text": "Reports a discrepancy detected by the ESLint linter. The highlighting is based on the rule severity specified in the ESLint configuration file for each individual rule. Clear the 'Use rule severity from the configuration file' checkbox to use the severity configured in this inspection for all ESLint rules.", - "markdown": "Reports a discrepancy detected by the [ESLint](https://eslint.org) linter. \n\nThe highlighting is based on the rule severity specified in the [ESLint configuration file](https://eslint.org/docs/user-guide/configuring) for each individual rule. \n\nClear the 'Use rule severity from the configuration file' checkbox to use the severity configured in this inspection for all ESLint rules." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "Eslint", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code quality tools", - "index": 54, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSDuplicatedDeclaration", - "shortDescription": { - "text": "Duplicate declaration" - }, - "fullDescription": { - "text": "Reports multiple declarations in a scope.", - "markdown": "Reports multiple declarations in a scope." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSDuplicatedDeclaration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSEqualityComparisonWithCoercion.TS", - "shortDescription": { - "text": "Equality operator may cause type coercion" - }, - "fullDescription": { - "text": "Reports a usage of equality operators may cause unexpected type coercions. Suggests replacing '==' or '!=' equality operators with type-safe '===' or '!==' operators. Depending on the option selected, one of the following cases will be reported: All usages of '==' and '!=' operators. All usages except comparison with null. Some code styles allow using 'x == null' as a replacement for 'x === null || x === undefined'. Only suspicious expressions, such as: '==' or '!=' comparisons with '0', '''', 'null', 'true', 'false', or 'undefined'.", - "markdown": "Reports a usage of equality operators may cause unexpected type coercions. Suggests replacing `==` or `!=` equality operators with type-safe `===` or `!==` operators.\n\nDepending on the option selected, one of the following cases will be reported:\n\n* All usages of `==` and `!=` operators.\n* All usages except comparison with null. Some code styles allow using `x == null` as a replacement for `x === null || x === undefined`.\n* Only suspicious expressions, such as: `==` or `!=` comparisons with `0`, `''`, `null`, `true`, `false`, or `undefined`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EqualityComparisonWithCoercionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSOctalInteger", - "shortDescription": { - "text": "Octal integer" - }, - "fullDescription": { - "text": "Reports a deprecated octal integer literal prefixed with '0' instead of '0o'. Such literals are not allowed in modern ECMAScript code, and using them in the strict mode is an error. To force this inspection for ES5 and ES3 language levels, select the 'Warn about obsolete octal literals in ES5- code' checkbox below.", - "markdown": "Reports a deprecated octal integer literal prefixed with `0` instead of `0o`. \nSuch literals are not allowed in modern ECMAScript code, and using them in the strict mode is an error. \nTo force this inspection for ES5 and ES3 language levels, select the 'Warn about obsolete octal literals in ES5- code' checkbox below." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JSOctalInteger", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ExceptionCaughtLocallyJS", - "shortDescription": { - "text": "Exception used for local control-flow" - }, - "fullDescription": { - "text": "Reports a 'throw' statement whose exceptions are always caught by the containing 'try' statement. Using 'throw' statements as a 'goto' to change the local flow of control is confusing.", - "markdown": "Reports a `throw` statement whose exceptions are always caught by the containing `try` statement. Using `throw` statements as a `goto` to change the local flow of control is confusing." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ExceptionCaughtLocallyJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ThrowFromFinallyBlockJS", - "shortDescription": { - "text": "'throw' inside 'finally' block" - }, - "fullDescription": { - "text": "Reports s 'throw' statement inside a 'finally' block. Such 'throw' statements may mask exceptions thrown, and complicate debugging.", - "markdown": "Reports s `throw` statement inside a `finally` block. Such `throw` statements may mask exceptions thrown, and complicate debugging." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ThrowInsideFinallyBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptValidateGenericTypes", - "shortDescription": { - "text": "Incorrect generic type argument" - }, - "fullDescription": { - "text": "Reports an invalid type argument in a function, interface, or class declaration.", - "markdown": "Reports an invalid type argument in a function, interface, or class declaration." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "TypeScriptValidateGenericTypes", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CyclomaticComplexityJS", - "shortDescription": { - "text": "Overly complex function" - }, - "fullDescription": { - "text": "Reports a function with too many branching points in a function (too high cyclomatic complexity). Such functions may be confusing and hard to test. Use the field provided below to specify the maximum acceptable cyclomatic complexity for a function.", - "markdown": "Reports a function with too many branching points in a function (too high cyclomatic complexity). Such functions may be confusing and hard to test.\n\n\nUse the field provided below to specify the maximum acceptable cyclomatic complexity for a function." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "OverlyComplexFunctionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 35, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSMismatchedCollectionQueryUpdate", - "shortDescription": { - "text": "Mismatched query and update of collection" - }, - "fullDescription": { - "text": "Reports a collection of fields or variables whose contents are either queried and not updated or updated and not queried. Such mismatched queries and updates are pointless and may indicate either dead code or a typographical error. Query methods are automatically detected, based on whether they return something, or a callback is passed to them. Use the table below to specify which methods are update methods.", - "markdown": "Reports a collection of fields or variables whose contents are either queried and not updated or updated and not queried. Such mismatched queries and updates are pointless and may indicate either dead code or a typographical error.\n\n\nQuery methods are automatically detected, based on whether they return something, or a callback is passed to them.\nUse the table below to specify which methods are update methods." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSMismatchedCollectionQueryUpdate", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PackageJsonMismatchedDependency", - "shortDescription": { - "text": "Mismatched dependencies in package.json" - }, - "fullDescription": { - "text": "Reports a dependency from package.json that is not installed or doesn't match the specified version range.", - "markdown": "Reports a dependency from package.json that is not installed or doesn't match the specified [version range](https://docs.npmjs.com/about-semantic-versioning)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PackageJsonMismatchedDependency", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Imports and dependencies", - "index": 47, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSPotentiallyInvalidUsageOfThis", - "shortDescription": { - "text": "Potentially invalid reference to 'this' from closure" - }, - "fullDescription": { - "text": "Reports a 'this' in closure that is used for referencing properties of outer context. Example: 'function Outer() {\n this.outerProp = 1;\n function inner() {\n // bad, because 'outerProp' of Outer\n // won't be updated here\n // on calling 'new Outer()' as may be expected\n this.outerProp = 2;\n }\n inner();\n}'", - "markdown": "Reports a `this` in closure that is used for referencing properties of outer context.\n\nExample:\n\n\n function Outer() {\n this.outerProp = 1;\n function inner() {\n // bad, because 'outerProp' of Outer\n // won't be updated here\n // on calling 'new Outer()' as may be expected\n this.outerProp = 2;\n }\n inner();\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSPotentiallyInvalidUsageOfThis", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSMissingSwitchDefault", - "shortDescription": { - "text": "'switch' statement has no 'default' branch" - }, - "fullDescription": { - "text": "Reports a 'switch' statement without a 'default' clause when some possible values are not enumerated.", - "markdown": "Reports a `switch` statement without a `default` clause when some possible values are not enumerated." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSMissingSwitchDefault", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Switch statement issues", - "index": 51, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSXNamespaceValidation", - "shortDescription": { - "text": "Missing JSX namespace" - }, - "fullDescription": { - "text": "Reports a usage of a JSX construction without importing namespace. Having the namespace in the file scope ensures proper code compilation.", - "markdown": "Reports a usage of a JSX construction without importing namespace. Having the namespace in the file scope ensures proper code compilation." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSXNamespaceValidation", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Imports and dependencies", - "index": 47, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnresolvedLibraryURL", - "shortDescription": { - "text": "Missed locally stored library for HTTP link" - }, - "fullDescription": { - "text": "Reports a URL of an external JavaScript library that is not associated with any locally stored file. Suggests downloading the library. Such association enables the IDE to provide proper code completion and navigation.", - "markdown": "Reports a URL of an external JavaScript library that is not associated with any locally stored file. Suggests downloading the library. Such association enables the IDE to provide proper code completion and navigation." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnresolvedLibraryURL", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6PreferShortImport", - "shortDescription": { - "text": "Import can be shortened" - }, - "fullDescription": { - "text": "Reports an ES6 import whose 'from' part can be shortened. Suggests importing the parent directory.", - "markdown": "Reports an ES6 import whose `from` part can be shortened. Suggests importing the parent directory." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ES6PreferShortImport", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PointlessBitwiseExpressionJS", - "shortDescription": { - "text": "Bitwise expression can be simplified" - }, - "fullDescription": { - "text": "Reports an expression that includes 'and' with zero, 'or' by zero, or shifting by zero. Such expressions may result from not fully completed automated refactorings.", - "markdown": "Reports an expression that includes `and` with zero, `or` by zero, or shifting by zero. Such expressions may result from not fully completed automated refactorings." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PointlessBitwiseExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Bitwise operation issues", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "InfiniteLoopJS", - "shortDescription": { - "text": "Infinite loop statement" - }, - "fullDescription": { - "text": "Reports a 'for', 'while', or 'do' statement which can only exit by throwing an exception. Such statements often indicate coding errors.", - "markdown": "Reports a `for`, `while`, or `do` statement which can only exit by throwing an exception. Such statements often indicate coding errors." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "InfiniteLoopJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSStringConcatenationToES6Template", - "shortDescription": { - "text": "String concatenation is used instead of template literal" - }, - "fullDescription": { - "text": "Reports a string concatenation. Suggests replacing it with a template literal Example '\"result: \" + a + \".\"' After applying the quick-fix the code looks as follows: '`result: ${a}.`'", - "markdown": "Reports a string concatenation. Suggests replacing it with a [template literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)\n\nExample\n\n \"result: \" + a + \".\" \n\nAfter applying the quick-fix the code looks as follows:\n\n `result: ${a}.` \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSStringConcatenationToES6Template", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSArrowFunctionBracesCanBeRemoved", - "shortDescription": { - "text": "Redundant braces around arrow function body" - }, - "fullDescription": { - "text": "Reports an arrow function whose body only consists of braces and exactly one statement. Suggests converting to concise syntax without braces. 'let incrementer = (x) => {return x + 1};' After the quick-fix is applied, the code fragment looks as follows: 'let incrementer = (x) => x + 1;'", - "markdown": "Reports an arrow function whose body only consists of braces and exactly one statement. Suggests converting to concise syntax without braces.\n\n\n let incrementer = (x) => {return x + 1};\n\nAfter the quick-fix is applied, the code fragment looks as follows:\n\n\n let incrementer = (x) => x + 1;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSArrowFunctionBracesCanBeRemoved", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ReplaceAssignmentWithOperatorAssignmentJS", - "shortDescription": { - "text": "Assignment could be replaced with operator assignment" - }, - "fullDescription": { - "text": "Reports an assignment operation that can be replaced by an operator assignment to make your code shorter and probably clearer. Example: 'x = x + 3;'\n 'x = x / 3;'\n After the quick fix is applied the result looks like: 'x += 3;'\n 'x /= 3;'", - "markdown": "Reports an assignment operation that can be replaced by an operator assignment to make your code shorter and probably clearer.\n\n\nExample:\n\n x = x + 3;\n x = x / 3;\n\nAfter the quick fix is applied the result looks like:\n\n x += 3;\n x /= 3;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "AssignmentReplaceableWithOperatorAssignmentJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Assignment issues", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSFileReferences", - "shortDescription": { - "text": "Unresolved file reference" - }, - "fullDescription": { - "text": "Reports an unresolved file reference in a JavaScript file, including CommonJS and AMD modules references.", - "markdown": "Reports an unresolved file reference in a JavaScript file, including CommonJS and AMD modules references." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSFileReferences", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Stylelint", - "shortDescription": { - "text": "Stylelint" - }, - "fullDescription": { - "text": "Reports a discrepancy detected by the Stylelint linter. The highlighting is based on the rule severity specified in the Stylelint configuration file for each individual rule.", - "markdown": "Reports a discrepancy detected by the [Stylelint](http://stylelint.io) linter. \n\nThe highlighting is based on the rule severity specified in the [Stylelint configuration file](https://stylelint.io/user-guide/configure) for each individual rule." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "Stylelint", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Code quality tools", - "index": 58, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FunctionWithInconsistentReturnsJS", - "shortDescription": { - "text": "Function with inconsistent returns" - }, - "fullDescription": { - "text": "Reports a function that returns a value in some cases while in other cases no value is returned. This usually indicates an error. Example: 'function foo() {\n if (true)\n return 3;\n return;\n}'", - "markdown": "Reports a function that returns a value in some cases while in other cases no value is returned. This usually indicates an error.\n\nExample:\n\n\n function foo() {\n if (true)\n return 3;\n return;\n }\n\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionWithInconsistentReturnsJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ClassMemberInitializationOrder", - "shortDescription": { - "text": "Use of possibly unassigned property in a static initializer" - }, - "fullDescription": { - "text": "Reports a class member initializer which references another non-hoisted class member while the latter may be not initialized yet. Initialization of class members happens consequently for fields, so a field cannot reference another field that is declared later.", - "markdown": "Reports a class member initializer which references another non-hoisted class member while the latter may be not initialized yet. \n\nInitialization of class members happens consequently for fields, so a field cannot reference another field that is declared later." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ES6ClassMemberInitializationOrder", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EmptyTryBlockJS", - "shortDescription": { - "text": "Empty 'try' block" - }, - "fullDescription": { - "text": "Reports an empty 'try' block, which usually indicates an error.", - "markdown": "Reports an empty `try` block, which usually indicates an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EmptyTryBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ReservedWordUsedAsNameJS", - "shortDescription": { - "text": "Reserved word used as name" - }, - "fullDescription": { - "text": "Reports a JavaScript reserved word used as a name. The JavaScript specification reserves a number of words which are currently not used as keywords. Using those words as identifiers may result in broken code if later versions of JavaScript start using them as keywords.", - "markdown": "Reports a JavaScript reserved word used as a name. The JavaScript specification reserves a number of words which are currently not used as keywords. Using those words as identifiers may result in broken code if later versions of JavaScript start using them as keywords." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ReservedWordAsName", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSClassNamingConvention", - "shortDescription": { - "text": "Class naming convention" - }, - "fullDescription": { - "text": "Reports a class or a function that is annotated with a JSDoc '@constructor' or '@class' tag whose names are too short, too long, or do not follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length, and a regular expression expected for classes names. Use the standard 'java.util.regex' format for regular expressions.", - "markdown": "Reports a class or a function that is annotated with a JSDoc `@constructor` or `@class` tag whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length, and a regular expression\nexpected for classes names. Use the standard `java.util.regex` format for regular expressions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSClassNamingConvention", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Naming conventions", - "index": 50, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptValidateJSTypes", - "shortDescription": { - "text": "Type mismatch in 'any' type" - }, - "fullDescription": { - "text": "Reports a function call with a parameter, return value, or assigned expression or incorrect type, if the context symbol can be implicitly resolved to the 'any' type. declare var test: any;\ntest.hasOwnProperty(true); //reports 'true'", - "markdown": "Reports a function call with a parameter, return value, or assigned expression or incorrect type, if the context symbol can be implicitly resolved to the `any` type.\n\n```\ndeclare var test: any;\ntest.hasOwnProperty(true); //reports 'true'\n```" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptValidateJSTypes", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NestedFunctionJS", - "shortDescription": { - "text": "Nested function" - }, - "fullDescription": { - "text": "Reports a function nested inside another function. Although JavaScript allows functions to be nested, such constructs may be confusing. Use the checkbox below to ignore anonymous nested functions.", - "markdown": "Reports a function nested inside another function. Although JavaScript allows functions to be nested, such constructs may be confusing.\n\n\nUse the checkbox below to ignore anonymous nested functions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NestedFunctionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XHTMLIncompatabilitiesJS", - "shortDescription": { - "text": "Incompatible XHTML usages" - }, - "fullDescription": { - "text": "Reports common JavaScript DOM patterns which may present problems with XHTML documents. In particular, the patterns detected will behave completely differently depending on whether the document is loaded as XML or HTML. This can result in subtle bugs where script behaviour is dependent on the MIME-type of the document, rather than its content. Patterns detected include document.body, document.images, document.applets, document.links, document.forms, and document.anchors.", - "markdown": "Reports common JavaScript DOM patterns which may present problems with XHTML documents. In particular, the patterns detected will behave completely differently depending on whether the document is loaded as XML or HTML. This can result in subtle bugs where script behaviour is dependent on the MIME-type of the document, rather than its content. Patterns detected include **document.body** , **document.images** , **document.applets** , **document.links** , **document.forms** , and **document.anchors**." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "XHTMLIncompatabilitiesJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/DOM issues", - "index": 52, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IncrementDecrementResultUsedJS", - "shortDescription": { - "text": "Result of increment or decrement used" - }, - "fullDescription": { - "text": "Reports an increment ('++') or decrement ('--') expression where the result of the assignment is used in a containing expression. Such assignments can result in confusion due to the order of operations, as evaluation of the assignment may affect the outer expression in unexpected ways. Example: 'var a = b++'", - "markdown": "Reports an increment (`++`) or decrement (`--`) expression where the result of the assignment is used in a containing expression. Such assignments can result in confusion due to the order of operations, as evaluation of the assignment may affect the outer expression in unexpected ways. Example: `var a = b++`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "IncrementDecrementResultUsedJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SuspiciousTypeOfGuard", - "shortDescription": { - "text": "Unsound type guard check" - }, - "fullDescription": { - "text": "Reports a 'typeof' or 'instanceof' unsound type guard check. The 'typeof x' type guard can be unsound in one of the following two cases: 'typeof x' never corresponds to the specified value (for example, 'typeof x === 'number'' when 'x' is of the type 'string | boolean') 'typeof x' always corresponds to the specified value (for example, 'typeof x === 'string'' when 'x' is of the type 'string') The 'x instanceof A' type guard can be unsound in one of the following two cases: The type of 'x' is not related to 'A' The type of 'x' is 'A' or a subtype of 'A'", - "markdown": "Reports a `typeof` or `instanceof` unsound type guard check. The `typeof x` type guard can be unsound in one of the following two cases:\n\n* `typeof x` never corresponds to the specified value (for example, `typeof x === 'number'` when `x` is of the type 'string \\| boolean')\n* `typeof x` always corresponds to the specified value (for example, `typeof x === 'string'` when `x` is of the type 'string')\n\n
\n\nThe `x instanceof A` type guard can be unsound in one of the following two cases:\n\n* The type of `x` is not related to `A`\n* The type of `x` is `A` or a subtype of `A`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SuspiciousTypeOfGuard", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptJSXUnresolvedComponent", - "shortDescription": { - "text": "Unresolved JSX component" - }, - "fullDescription": { - "text": "Reports an unresolved reference to a JSX component. Suggests adding an import statement if the referenced component is defined in the project or its dependencies or creating a new component with the specified name. The template for a new component can be modified in Editor | File and Code Templates.", - "markdown": "Reports an unresolved reference to a JSX component. Suggests adding an import statement if the referenced component is defined in the project or its dependencies or creating a new component with the specified name.\n\nThe template for a new component can be modified in Editor \\| File and Code Templates." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptJSXUnresolvedComponent", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptFieldCanBeMadeReadonly", - "shortDescription": { - "text": "Field can be readonly" - }, - "fullDescription": { - "text": "Reports a private field that can be made readonly (for example, if the field is assigned only in the constructor).", - "markdown": "Reports a private field that can be made readonly (for example, if the field is assigned only in the constructor)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptFieldCanBeMadeReadonly", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6DestructuringVariablesMerge", - "shortDescription": { - "text": "Destructuring properties with the same key" - }, - "fullDescription": { - "text": "Reports multiple destructuring properties with identical keys. Suggests merging the properties.", - "markdown": "Reports multiple destructuring properties with identical keys. Suggests merging the properties." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6DestructuringVariablesMerge", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LoopStatementThatDoesntLoopJS", - "shortDescription": { - "text": "Loop statement that doesn't loop" - }, - "fullDescription": { - "text": "Reports a 'for', 'while', or 'do' statement whose bodies are guaranteed to execute at most once. Normally, this indicates an error.", - "markdown": "Reports a `for`, `while`, or `do` statement whose bodies are guaranteed to execute at most once. Normally, this indicates an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LoopStatementThatDoesntLoopJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NegatedIfStatementJS", - "shortDescription": { - "text": "Negated 'if' statement" - }, - "fullDescription": { - "text": "Reports if statements which have an else branch and a negated condition. Flipping the order of the if and else branches will usually increase the clarity of such statements.", - "markdown": "Reports **if** statements which have an **else** branch and a negated condition. Flipping the order of the **if** and **else** branches will usually increase the clarity of such statements." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NegatedIfStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSNonASCIINames", - "shortDescription": { - "text": "Identifiers with non-ASCII symbols" - }, - "fullDescription": { - "text": "Reports a non-ASCII symbol in a name. If the 'Allow only ASCII names' option is selected, reports all names that contain non-ASCII symbols. Otherwise reports all names that contain both ASCII and non-ASCII symbols.", - "markdown": "Reports a non-ASCII symbol in a name. \n\nIf the 'Allow only ASCII names' option is selected, reports all names that contain non-ASCII symbols. \nOtherwise reports all names that contain both ASCII and non-ASCII symbols." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSNonASCIINames", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Naming conventions", - "index": 50, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptRedundantGenericType", - "shortDescription": { - "text": "Redundant type arguments" - }, - "fullDescription": { - "text": "Reports a type argument that is equal to the default one and can be removed. Example: 'type Foo = T;\nlet z: Foo;'", - "markdown": "Reports a type argument that is equal to the default one and can be removed.\n\n\nExample:\n\n\n type Foo = T;\n let z: Foo;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptRedundantGenericType", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptUMDGlobal", - "shortDescription": { - "text": "Referenced UMD global variable" - }, - "fullDescription": { - "text": "Reports a usage of a Universal Module Definition (UMD) global variable if the current file is a module (ECMAScript or CommonJS). Referencing UMD variables without explicit imports can lead to a runtime error if the library isn't included implicitly.", - "markdown": "Reports a usage of a Universal Module Definition (UMD) global variable if the current file is a module (ECMAScript or CommonJS). Referencing UMD variables without explicit imports can lead to a runtime error if the library isn't included implicitly." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptUMDGlobal", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryReturnJS", - "shortDescription": { - "text": "Unnecessary 'return' statement" - }, - "fullDescription": { - "text": "Reports an unnecessary 'return' statement, that is, a 'return' statement that returns no value and occurs just before the function would have \"fallen through\" the bottom. These statements may be safely removed.", - "markdown": "Reports an unnecessary `return` statement, that is, a `return` statement that returns no value and occurs just before the function would have \"fallen through\" the bottom. These statements may be safely removed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryReturnStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ConditionalExpressionWithIdenticalBranchesJS", - "shortDescription": { - "text": "Conditional expression with identical branches" - }, - "fullDescription": { - "text": "Reports a ternary conditional expression with identical 'then' and 'else' branches.", - "markdown": "Reports a ternary conditional expression with identical `then` and `else` branches." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ConditionalExpressionWithIdenticalBranchesJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnfilteredForInLoop", - "shortDescription": { - "text": "Unfiltered for..in loop" - }, - "fullDescription": { - "text": "Reports unfiltered 'for-in' loops. The use of this construct results in processing not only own properties of an object but properties from its prototype as well. It may be unexpected in some specific cases, for example, in utility methods that copy or modify all properties or when 'Object''s prototype may be incorrectly modified. For example, the following code will print 42 and myMethod: 'Object.prototype.myMethod = function myMethod() {};\nlet a = { foo: 42 };\nfor (let i in a) {\n console.log(a[i]);\n}' Suggests replacing the whole loop with a 'Object.keys()' method or adding a 'hasOwnProperty()' check. After applying the quick-fix the code looks as follows: 'for (let i in a) {\n if (a.hasOwnProperty(i)) {\n console.log(a[i]);\n }\n}'", - "markdown": "Reports unfiltered `for-in` loops. \n\nThe use of this construct results in processing not only own properties of an object but properties from its prototype as well. It may be unexpected in some specific cases, for example, in utility methods that copy or modify all properties or when `Object`'s prototype may be incorrectly modified. For example, the following code will print **42** and **myMethod** : \n\n\n Object.prototype.myMethod = function myMethod() {};\n let a = { foo: 42 };\n for (let i in a) {\n console.log(a[i]);\n }\n\nSuggests replacing the whole loop with a `Object.keys()` method or adding a `hasOwnProperty()` check. After applying the quick-fix the code looks as follows:\n\n\n for (let i in a) {\n if (a.hasOwnProperty(i)) {\n console.log(a[i]);\n }\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnfilteredForInLoop", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSIncompatibleTypesComparison", - "shortDescription": { - "text": "Comparison of expressions having incompatible types" - }, - "fullDescription": { - "text": "Reports a comparison with operands of incompatible types or an operand with a type without possible common values.", - "markdown": "Reports a comparison with operands of incompatible types or an operand with a type without possible common values." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSIncompatibleTypesComparison", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSAnnotator", - "shortDescription": { - "text": "ECMAScript specification is not followed" - }, - "fullDescription": { - "text": "Reports basic syntax issues and inconsistencies with language specification, such as invalid usages of keywords, usages of incompatible numeric format, or multiple parameters to getters/setters. Generally, such errors must always be reported and shouldn't be disabled. But in some cases, such as issues due to the dynamic nature of JavaScript, the use of not yet supported language features, or bugs in IDE's checker, it may be handy to disable reporting these very basic errors.", - "markdown": "Reports basic syntax issues and inconsistencies with language specification, such as invalid usages of keywords, usages of incompatible numeric format, or multiple parameters to getters/setters. \nGenerally, such errors must always be reported and shouldn't be disabled. But in some cases, such as issues due to the dynamic nature of JavaScript, the use of not yet supported language features, or bugs in IDE's checker, it may be handy to disable reporting these very basic errors." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JSAnnotator", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSLastCommaInObjectLiteral", - "shortDescription": { - "text": "Unneeded last comma in object literal" - }, - "fullDescription": { - "text": "Reports usages of a trailing comma in object literals. The warning is reported only when the JavaScript language version is set to ECMAScript 5.1. Trailing commas in object literals are allowed by the specification, however, some browsers might throw an error when a trailing comma is used. You can configure formatting options for trailing commas in Code Style | JavaScript or TypeScript | Punctuation.", - "markdown": "Reports usages of a trailing comma in object literals.\n\nThe warning is reported only when the JavaScript language version is set to ECMAScript 5.1.\n\nTrailing commas in object literals are allowed by the specification, however, some browsers might throw an error when a trailing comma is used.\n\nYou can configure formatting options for trailing commas in **Code Style** \\| **JavaScript** or **TypeScript** \\| **Punctuation**." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSLastCommaInObjectLiteral", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSFunctionExpressionToArrowFunction", - "shortDescription": { - "text": "Function expression is used instead of arrow function" - }, - "fullDescription": { - "text": "Reports a function expression. Suggests converting it to an arrow function. Example: 'arr.map(function(el) {return el + 1})' After applying the quick-fix the code looks as follows: 'arr.map(el => el + 1)'", - "markdown": "Reports a [function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function) expression. Suggests converting it to an [arrow function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions).\n\nExample:\n\n arr.map(function(el) {return el + 1})\n\nAfter applying the quick-fix the code looks as follows:\n\n arr.map(el => el + 1)\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSFunctionExpressionToArrowFunction", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6TopLevelAwaitExpression", - "shortDescription": { - "text": "Top-level 'await' expression" - }, - "fullDescription": { - "text": "Reports a usage of a top-level 'await' expression. While the new 'top-level async' proposal is on its way, using 'await' outside async functions is not allowed.", - "markdown": "Reports a usage of a top-level `await` expression. While the new 'top-level async' proposal is on its way, using `await` outside async functions is not allowed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "ES6TopLevelAwaitExpression", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Async code and promises", - "index": 53, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6MissingAwait", - "shortDescription": { - "text": "Missing await for an async function call" - }, - "fullDescription": { - "text": "Reports an 'async' function call without an expected 'await' prefix inside an 'async' function. Such call returns a 'Promise' and control flow is continued immediately. Example: 'async function bar() { /* ... */ }\nasync function foo() {\n bar(); // bad\n}' After the quick-fix is applied, the 'await' prefix is added: 'async function bar() { /* ... */ }\nasync function foo() {\n await bar(); // good\n}' When the 'Report for promises in return statements' checkbox is selected, also suggests adding 'await' in return statements. While this is generally not necessary, it gives two main benefits. You won't forget to add 'await' when surrounding your code with 'try-catch'. An explicit 'await' helps V8 runtime to provide async stack traces.", - "markdown": "Reports an `async` function call without an expected `await` prefix inside an `async` function. Such call returns a `Promise` and control flow is continued immediately.\n\nExample:\n\n\n async function bar() { /* ... */ }\n async function foo() {\n bar(); // bad\n }\n\n\nAfter the quick-fix is applied, the `await` prefix is added:\n\n\n async function bar() { /* ... */ }\n async function foo() {\n await bar(); // good\n }\n\n
\n\nWhen the 'Report for promises in return statements' checkbox is selected, also suggests adding `await` in return statements. \nWhile this is generally not necessary, it gives two main benefits. \n\n* You won't forget to add `await` when surrounding your code with `try-catch`.\n* An explicit `await` helps V8 runtime to provide [async stack traces](https://bit.ly/v8-zero-cost-async-stack-traces)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6MissingAwait", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Async code and promises", - "index": 53, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TailRecursionJS", - "shortDescription": { - "text": "Tail recursion" - }, - "fullDescription": { - "text": "Reports a tail recursion, that is, when a function calls itself as its last action before returning. A tail recursion can always be replaced by looping, which will be considerably faster. Some JavaScript engines perform this optimization, while others do not. Thus, tail recursive solutions may have considerably different performance characteristics in different environments.", - "markdown": "Reports a tail recursion, that is, when a function calls itself as its last action before returning. A tail recursion can always be replaced by looping, which will be considerably faster. Some JavaScript engines perform this optimization, while others do not. Thus, tail recursive solutions may have considerably different performance characteristics in different environments." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TailRecursionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertToForOf", - "shortDescription": { - "text": "'for..in' is used instead of 'for..of'" - }, - "fullDescription": { - "text": "Reports a usage of a 'for..in' loop on an array. Suggests replacing it with a 'for..of' loop. 'for..of' loops, which are introduced in ECMAScript 6, iterate over 'iterable' objects. For arrays, this structure is preferable to 'for..in', because it works only with array values but not with array object's properties.", - "markdown": "Reports a usage of a [for..in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in) loop on an array. Suggests replacing it with a [for..of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) loop. \n`for..of` loops, which are introduced in ECMAScript 6, iterate over `iterable` objects. For arrays, this structure is preferable to `for..in`, because it works only with array values but not with array object's properties." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertToForOf", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FlowJSCoverage", - "shortDescription": { - "text": "Code is not covered by Flow" - }, - "fullDescription": { - "text": "Reports JavaScript code fragments that are not covered by the Flow type checker. To use this inspection, configure the Flow executable in Settings | Languages & Frameworks | JavaScript.", - "markdown": "Reports JavaScript code fragments that are not covered by the Flow type checker. To use this inspection, configure the Flow executable in [Settings \\| Languages \\& Frameworks \\| JavaScript](settings://Settings.JavaScript)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "FlowJSCoverage", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Flow type checker", - "index": 16, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ParameterNamingConventionJS", - "shortDescription": { - "text": "Function parameter naming convention" - }, - "fullDescription": { - "text": "Reports a function parameter whose name is too short, too long, or doesn't follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length and regular expression expected for local variables names. Use the standard 'java.util.regex' format regular expressions.", - "markdown": "Reports a function parameter whose name is too short, too long, or doesn't follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length and regular expression\nexpected for local variables names. Use the standard `java.util.regex` format regular expressions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ParameterNamingConventionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Naming conventions", - "index": 50, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUndefinedPropertyAssignment", - "shortDescription": { - "text": "Undefined property assignment" - }, - "fullDescription": { - "text": "Reports an assignment to a property that is not defined in the type of a variable. Example: '/**\n * @type {{ property1: string, property2: number }}\n */\nlet myVariable = create();\n\nmyVariable.newProperty = 3; // bad'", - "markdown": "Reports an assignment to a property that is not defined in the type of a variable.\n\nExample:\n\n\n /**\n * @type {{ property1: string, property2: number }}\n */\n let myVariable = create();\n\n myVariable.newProperty = 3; // bad\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSUndefinedPropertyAssignment", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "StandardJS", - "shortDescription": { - "text": "Standard code style" - }, - "fullDescription": { - "text": "Reports a discrepancy detected by the JavaScript Standard Style linter. The highlighting severity in the editor is based on the severity level the linter reports.", - "markdown": "Reports a discrepancy detected by the [JavaScript Standard Style](https://standardjs.com/) linter. \n\nThe highlighting severity in the editor is based on the severity level the linter reports." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "StandardJS", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code quality tools", - "index": 54, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ParametersPerFunctionJS", - "shortDescription": { - "text": "Function with too many parameters" - }, - "fullDescription": { - "text": "Reports a function with too many parameters. Such functions often indicate problems with design. Use the field below to specify the maximum acceptable number of parameters for a function.", - "markdown": "Reports a function with too many parameters. Such functions often indicate problems with design.\n\n\nUse the field below to specify the maximum acceptable number of parameters for a function." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "OverlyComplexFunctionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 35, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ThisExpressionReferencesGlobalObjectJS", - "shortDescription": { - "text": "'this' expression which references the global object" - }, - "fullDescription": { - "text": "Reports a 'this' expression outside an object literal or a constructor body. Such 'this' expressions reference the top-level \"global\" JavaScript object, but are mostly useless.", - "markdown": "Reports a `this` expression outside an object literal or a constructor body. Such `this` expressions reference the top-level \"global\" JavaScript object, but are mostly useless." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ThisExpressionReferencesGlobalObjectJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NestedAssignmentJS", - "shortDescription": { - "text": "Nested assignment" - }, - "fullDescription": { - "text": "Reports an assignment expression nested inside another expression, for example, 'a = b = 1'. Such expressions may be confusing and violate the general design principle that a given construct should do precisely one thing.", - "markdown": "Reports an assignment expression nested inside another expression, for example, `a = b = 1`. Such expressions may be confusing and violate the general design principle that a given construct should do precisely one thing." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NestedAssignmentJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Assignment issues", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DefaultNotLastCaseInSwitchJS", - "shortDescription": { - "text": "'default' not last case in 'switch'" - }, - "fullDescription": { - "text": "Reports a 'switch' statement where the 'default' case comes before another case instead of being the very last case, which may cause confusion.", - "markdown": "Reports a `switch` statement where the `default` case comes before another case instead of being the very last case, which may cause confusion." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DefaultNotLastCaseInSwitchJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Switch statement issues", - "index": 51, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ConfusingPlusesOrMinusesJS", - "shortDescription": { - "text": "Confusing sequence of '+' or '-'" - }, - "fullDescription": { - "text": "Reports a suspicious combination of '+' or '-' characters in JavaScript code (for example, 'a+++b'. Such sequences are confusing, and their semantics may change through changes in the whitespace.", - "markdown": "Reports a suspicious combination of `+` or `-` characters in JavaScript code (for example, `a+++b`. Such sequences are confusing, and their semantics may change through changes in the whitespace." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ConfusingPlusesOrMinusesJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSDeprecatedSymbols", - "shortDescription": { - "text": "Deprecated symbol used" - }, - "fullDescription": { - "text": "Reports a usage of a deprecated function variable.", - "markdown": "Reports a usage of a deprecated function variable." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSDeprecatedSymbols", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LocalVariableNamingConventionJS", - "shortDescription": { - "text": "Local variable naming convention" - }, - "fullDescription": { - "text": "Reports a local variable whose name is too short, too long, or doesn't follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length, and a regular expression expected for local variables names. Use the standard 'java.util.regex' format regular expressions.", - "markdown": "Reports a local variable whose name is too short, too long, or doesn't follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length, and a regular expression\nexpected for local variables names. Use the standard `java.util.regex` format regular expressions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LocalVariableNamingConventionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Naming conventions", - "index": 50, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EmptyFinallyBlockJS", - "shortDescription": { - "text": "Empty 'finally' block" - }, - "fullDescription": { - "text": "Reports an empty 'finally' block, which usually indicates an error.", - "markdown": "Reports an empty `finally` block, which usually indicates an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EmptyFinallyBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSCommentMatchesSignature", - "shortDescription": { - "text": "Mismatched JSDoc and function signature" - }, - "fullDescription": { - "text": "Reports mismatch between the names and the number of parameters within a JSDoc comment and the actual parameters of a function. Suggests updating parameters in JSDoc comment. Example: '/**\n * @param height Height in pixels\n */\nfunction sq(height, width) {} // width is not documented' After the quick-fix is applied: '/**\n * @param height Height in pixels\n * @param width\n */\nfunction sq(height, width) {}'", - "markdown": "Reports mismatch between the names and the number of parameters within a JSDoc comment and the actual parameters of a function. Suggests updating parameters in JSDoc comment.\n\n**Example:**\n\n\n /**\n * @param height Height in pixels\n */\n function sq(height, width) {} // width is not documented\n\nAfter the quick-fix is applied:\n\n\n /**\n * @param height Height in pixels\n * @param width\n */\n function sq(height, width) {}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSCommentMatchesSignature", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UpdateDependencyToLatestVersion", - "shortDescription": { - "text": "Update package.json dependencies to latest versions" - }, - "fullDescription": { - "text": "Suggests to upgrade your package.json dependencies to the latest versions, ignoring specified versions.", - "markdown": "Suggests to upgrade your package.json dependencies to the latest versions, ignoring specified versions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "UpdateDependencyToLatestVersion", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Imports and dependencies", - "index": 47, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptConfig", - "shortDescription": { - "text": "Inconsistent tsconfig.json properties" - }, - "fullDescription": { - "text": "Reports inconsistency of a 'paths', 'checkJs', or 'extends' property in a tsconfig.json file. The 'checkJs' property requires 'allowJs'. The 'extends' property should be a valid file reference.", - "markdown": "Reports inconsistency of a `paths`, `checkJs`, or `extends` property in a tsconfig.json file. \nThe `checkJs` property requires `allowJs`. \nThe `extends` property should be a valid file reference." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TypeScriptConfig", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSSuspiciousNameCombination", - "shortDescription": { - "text": "Suspicious variable/parameter name combination" - }, - "fullDescription": { - "text": "Reports an assignment or a function call where the name of the target variable or the function parameter does not match the name of the value assigned to it. Example: 'var x = 0;\n var y = x;' or 'var x = 0, y = 0;\n var rc = new Rectangle(y, x, 20, 20);' Here the inspection guesses that 'x' and 'y' are mixed up. Specify the names that should not be used together. An error is reported if a parameter name or an assignment target name contains words from one group while the name of the assigned or passed variable contains words from another group.", - "markdown": "Reports an assignment or a function call where the name of the target variable or the function parameter does not match the name of the value assigned to it.\n\nExample:\n\n\n var x = 0;\n var y = x;\n\nor\n\n\n var x = 0, y = 0;\n var rc = new Rectangle(y, x, 20, 20);\n\nHere the inspection guesses that `x` and `y` are mixed up.\n\nSpecify the names that should not be used together. An error is reported\nif a parameter name or an assignment target name contains words from one group while the name of the assigned or passed\nvariable contains words from another group." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSSuspiciousNameCombination", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnresolvedExtXType", - "shortDescription": { - "text": "Unresolved Ext JS xtype" - }, - "fullDescription": { - "text": "Reports an Ext JS 'xtype' reference that doesn't have a corresponding class.", - "markdown": "Reports an Ext JS `xtype` reference that doesn't have a corresponding class." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnresolvedExtXType", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ForLoopThatDoesntUseLoopVariableJS", - "shortDescription": { - "text": "'for' loop where update or condition does not use loop variable" - }, - "fullDescription": { - "text": "Reports a 'for' loop where the condition or update does not use the 'for' loop variable.", - "markdown": "Reports a `for` loop where the condition or update does not use the `for` loop variable." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ForLoopThatDoesntUseLoopVariableJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptAbstractClassConstructorCanBeMadeProtected", - "shortDescription": { - "text": "Abstract class constructor can be made protected" - }, - "fullDescription": { - "text": "Reports a public constructor of an abstract class and suggests making it protected (because it is useless to have it public).", - "markdown": "Reports a public constructor of an abstract class and suggests making it protected (because it is useless to have it public)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptAbstractClassConstructorCanBeMadeProtected", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FunctionWithMultipleReturnPointsJS", - "shortDescription": { - "text": "Function with multiple return points" - }, - "fullDescription": { - "text": "Reports a function with multiple return points. Such functions are hard to understand and maintain.", - "markdown": "Reports a function with multiple return points. Such functions are hard to understand and maintain." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionWithMultipleReturnPointsJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 35, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSIgnoredPromiseFromCall", - "shortDescription": { - "text": "Result of method call returning a promise is ignored" - }, - "fullDescription": { - "text": "Reports a function call that returns a 'Promise' that is not used later. Such calls are usually unintended and indicate an error.", - "markdown": "Reports a function call that returns a `Promise` that is not used later. Such calls are usually unintended and indicate an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSIgnoredPromiseFromCall", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Async code and promises", - "index": 53, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ThreeNegationsPerFunctionJS", - "shortDescription": { - "text": "Function with more than three negations" - }, - "fullDescription": { - "text": "Reports a function with three or more negation operations ('!' or '!='). Such functions may be unnecessarily confusing.", - "markdown": "Reports a function with three or more negation operations (`!` or `!=`). Such functions may be unnecessarily confusing." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionWithMoreThanThreeNegationsJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 35, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSRemoveUnnecessaryParentheses", - "shortDescription": { - "text": "Unnecessary parentheses" - }, - "fullDescription": { - "text": "Reports redundant parentheses. In expressions: 'var x = ((1) + 2) + 3' In arrow function argument lists: 'var incrementer = (x) => x + 1' In TypeScript and Flow type declarations: 'type Card = (Suit & Rank) | (Suit & Number)'", - "markdown": "Reports redundant parentheses.\n\nIn expressions:\n\n var x = ((1) + 2) + 3\n\nIn arrow function argument lists:\n\n var incrementer = (x) => x + 1\n\nIn TypeScript and Flow type declarations:\n\n type Card = (Suit & Rank) | (Suit & Number)\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSRemoveUnnecessaryParentheses", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "OverlyComplexBooleanExpressionJS", - "shortDescription": { - "text": "Overly complex boolean expression" - }, - "fullDescription": { - "text": "Reports a boolean expression with too many terms. Such expressions may be confusing and bug-prone. Use the field below to specify the maximum number of terms allowed in an arithmetic expression.", - "markdown": "Reports a boolean expression with too many terms. Such expressions may be confusing and bug-prone.\n\n\nUse the field below to specify the maximum number of terms allowed in an arithmetic expression." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "OverlyComplexBooleanExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "OverlyComplexArithmeticExpressionJS", - "shortDescription": { - "text": "Overly complex arithmetic expression" - }, - "fullDescription": { - "text": "Reports an arithmetic expression with too many terms. Such expressions may be confusing and bug-prone. Use the field below to specify the maximum number of terms allowed in an arithmetic expression.", - "markdown": "Reports an arithmetic expression with too many terms. Such expressions may be confusing and bug-prone.\n\n\nUse the field below to specify the maximum number of terms allowed in an arithmetic expression." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "OverlyComplexArithmeticExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6RedundantNestingInTemplateLiteral", - "shortDescription": { - "text": "Redundant nesting in template literal" - }, - "fullDescription": { - "text": "Reports nested instances of a string or a template literal. Suggests inlining the nested instances into the containing template string. Example: 'let a = `Hello, ${`Brave ${\"New\"}`} ${\"World\"}!`' After applying the quick-fix the code looks as follows: 'let a = `Hello, Brave New World!`'", - "markdown": "Reports nested instances of a string or a template literal. Suggests inlining the nested instances into the containing template string.\n\nExample:\n\n\n let a = `Hello, ${`Brave ${\"New\"}`} ${\"World\"}!`\n\nAfter applying the quick-fix the code looks as follows:\n\n\n let a = `Hello, Brave New World!`\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6RedundantNestingInTemplateLiteral", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "StringLiteralBreaksHTMLJS", - "shortDescription": { - "text": "String literal which breaks HTML parsing" - }, - "fullDescription": { - "text": "Reports a string literal that contains a '\n\nThe following usages are ignored:\n\n* Inside a return statement\n* In some binary operations\n* For overridden non-void functions" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSVoidFunctionReturnValueUsed", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ReturnFromFinallyBlockJS", - "shortDescription": { - "text": "'return' inside 'finally' block" - }, - "fullDescription": { - "text": "Reports a 'return' statement inside a 'finally' block. Such 'return' statements may mask exceptions thrown, and complicate debugging.", - "markdown": "Reports a `return` statement inside a `finally` block. Such `return` statements may mask exceptions thrown, and complicate debugging." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ReturnInsideFinallyBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnusedLocalSymbols", - "shortDescription": { - "text": "Unused local symbol" - }, - "fullDescription": { - "text": "Reports an unused locally accessible parameter, local variable, function, class, or private member declaration.", - "markdown": "Reports an unused locally accessible parameter, local variable, function, class, or private member declaration." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnusedLocalSymbols", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Unused symbols", - "index": 19, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSValidateTypes", - "shortDescription": { - "text": "Type mismatch" - }, - "fullDescription": { - "text": "Reports incorrect type of: a parameter in a function call a return value an assigned expression TypeScript code is ignored.", - "markdown": "Reports incorrect type of:\n\n* a parameter in a function call\n* a return value\n* an assigned expression\n\nTypeScript code is ignored." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSValidateTypes", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.intellij.plugins.postcss", - "version": "232.9876", - "rules": [ - { - "id": "PostCssCustomSelector", - "shortDescription": { - "text": "Invalid custom selector" - }, - "fullDescription": { - "text": "Reports a syntax error in PostCSS Custom Selector. Example: '@custom-selector :--heading h1, h2, h3;'", - "markdown": "Reports a syntax error in [PostCSS Custom Selector](https://github.com/postcss/postcss-custom-selectors).\n\nExample:\n\n\n @custom-selector :--heading h1, h2, h3;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "PostCssCustomSelector", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "PostCSS", - "index": 5, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PostCssUnresolvedModuleValueReference", - "shortDescription": { - "text": "Unresolved CSS module value" - }, - "fullDescription": { - "text": "Reports an unresolved reference to a CSS Module Value ('@value' declaration). Example: '@value foo from unknown;'", - "markdown": "Reports an unresolved reference to a [CSS Module Value](https://github.com/css-modules/postcss-modules-values) (`@value` declaration).\n\nExample:\n\n\n @value foo from unknown;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "PostCssUnresolvedModuleValueReference", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "PostCSS", - "index": 5, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PostCssNesting", - "shortDescription": { - "text": "Invalid nested rule" - }, - "fullDescription": { - "text": "Reports a nested style rule whose syntax doesn't comply with the PostCSS Nested or the PostCSS Nesting specification. Example: '.phone {\n &_title {}\n}'", - "markdown": "Reports a nested style rule whose syntax doesn't comply with the [PostCSS Nested](https://github.com/postcss/postcss-nested) or the [PostCSS Nesting](https://github.com/csstools/postcss-nesting) specification.\n\nExample:\n\n\n .phone {\n &_title {}\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PostCssNesting", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "PostCSS", - "index": 5, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PostCssCustomMedia", - "shortDescription": { - "text": "Invalid custom media" - }, - "fullDescription": { - "text": "Reports a syntax error in a PostCSS Custom Media query. Example: '@custom-media --small-viewport (max-width: 30em);'", - "markdown": "Reports a syntax error in a [PostCSS Custom Media](https://github.com/postcss/postcss-custom-media) query.\n\nExample:\n\n\n @custom-media --small-viewport (max-width: 30em);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "PostCssCustomMedia", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "PostCSS", - "index": 5, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PostCssMediaRange", - "shortDescription": { - "text": "Invalid media query range" - }, - "fullDescription": { - "text": "Checks range context syntax, which may alternatively be used for media features with a 'range' type. Example: '@media screen and (500px <= width <= 1200px) {}'", - "markdown": "Checks [range context](https://github.com/postcss/postcss-media-minmax) syntax, which may alternatively be used for media features with a 'range' type.\n\nExample:\n\n\n @media screen and (500px <= width <= 1200px) {}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "PostCssMediaRange", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "PostCSS", - "index": 5, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.jetbrains.plugins.sass", - "version": "232.9876", - "rules": [ - { - "id": "SassScssUnresolvedMixin", - "shortDescription": { - "text": "Unresolved mixin" - }, - "fullDescription": { - "text": "Reports an unresolved Sass/SCSS mixin reference. Example: '* {\n @include unknown-mixin;\n}'", - "markdown": "Reports an unresolved [Sass/SCSS mixin](https://sass-lang.com/documentation/at-rules/mixin) reference.\n\n**Example:**\n\n\n * {\n @include unknown-mixin;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SassScssUnresolvedMixin", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Sass/SCSS", - "index": 6, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SassScssResolvedByNameOnly", - "shortDescription": { - "text": "Missing import" - }, - "fullDescription": { - "text": "Reports a reference to a variable, mixin, or function that is declared in another file but this file isn't explicitly imported in the current file. Example: '* {\n margin: $var-in-other-file;\n}'", - "markdown": "Reports a reference to a variable, mixin, or function that is declared in another file but this file isn't explicitly [imported](https://sass-lang.com/documentation/at-rules/import) in the current file.\n\n**Example:**\n\n\n * {\n margin: $var-in-other-file;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "SassScssResolvedByNameOnly", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Sass/SCSS", - "index": 6, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SassScssUnresolvedPlaceholderSelector", - "shortDescription": { - "text": "Unresolved placeholder selector" - }, - "fullDescription": { - "text": "Reports an unresolved Sass/SCSS placeholder selector reference. Example: '* {\n @extend %unknown-placeholder-selector;\n}'", - "markdown": "Reports an unresolved [Sass/SCSS placeholder selector](https://sass-lang.com/documentation/variables) reference.\n\n**Example:**\n\n\n * {\n @extend %unknown-placeholder-selector;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SassScssUnresolvedPlaceholderSelector", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Sass/SCSS", - "index": 6, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SassScssUnresolvedVariable", - "shortDescription": { - "text": "Unresolved variable" - }, - "fullDescription": { - "text": "Reports an unresolved Sass/SCSS variable reference. Example: '* {\n margin: $unknown-var;\n}'", - "markdown": "Reports an unresolved [Sass/SCSS variable](https://sass-lang.com/documentation/variables) reference.\n\n**Example:**\n\n\n * {\n margin: $unknown-var;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SassScssUnresolvedVariable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Sass/SCSS", - "index": 6, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.jetbrains.sh", - "version": "232.9876", - "rules": [ - { - "id": "ShellCheck", - "shortDescription": { - "text": "ShellCheck" - }, - "fullDescription": { - "text": "Reports shell script bugs detected by the integrated ShellCheck static analysis tool.", - "markdown": "Reports shell script bugs detected by the integrated [ShellCheck](https://github.com/koalaman/shellcheck) static analysis tool." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "ShellCheck", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "Shell script", - "index": 7, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "Karma", - "version": "232.9876", - "rules": [ - { - "id": "KarmaConfigFile", - "shortDescription": { - "text": "Invalid Karma configuration file" - }, - "fullDescription": { - "text": "Reports a potential error in a file path ('basePath', 'files') for a Karma configuration file, for example, 'karma.conf.js'.", - "markdown": "Reports a potential error in a file path ('basePath', 'files') for a Karma configuration file, for example, `karma.conf.js`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "KarmaConfigFile", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Unit testing", - "index": 8, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij", - "version": "232.9876.134", - "rules": [ - { - "id": "JsonSchemaDeprecation", - "shortDescription": { - "text": "Deprecated JSON property" - }, - "fullDescription": { - "text": "Reports a deprecated property in a JSON file. Note that deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard extension 'deprecationMessage'.", - "markdown": "Reports a deprecated property in a JSON file. \nNote that deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard extension 'deprecationMessage'." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JsonSchemaDeprecation", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsonSchemaRefReference", - "shortDescription": { - "text": "Unresolved '$ref' and '$schema' references" - }, - "fullDescription": { - "text": "Reports an unresolved '$ref' or '$schema' path in a JSON schema.", - "markdown": "Reports an unresolved `$ref` or `$schema` path in a JSON schema. " - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsonSchemaRefReference", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlUnknownBooleanAttribute", - "shortDescription": { - "text": "Incorrect boolean attribute" - }, - "fullDescription": { - "text": "Reports an HTML non-boolean attribute without a value. Suggests configuring attributes that should not be reported.", - "markdown": "Reports an HTML non-boolean attribute without a value. Suggests configuring attributes that should not be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlUnknownBooleanAttribute", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DuplicatedCode", - "shortDescription": { - "text": "Duplicated code fragment" - }, - "fullDescription": { - "text": "Reports duplicated blocks of code from the selected scope: the same file or the entire project. The inspection features quick-fixes that help you to set the size of detected duplicates, navigate to repetitive code fragments, and compare them in a tool window. The inspection options allow you to select the scope of the reported duplicated fragments and set the initial size for the duplicated language constructs.", - "markdown": "Reports duplicated blocks of code from the selected scope: the same file or the entire project.\n\nThe inspection features quick-fixes that help you to set the size of detected duplicates, navigate to repetitive code fragments, and compare them in a tool window.\n\nThe inspection options allow you to select the scope of the reported duplicated fragments and set the initial size for the duplicated language constructs." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "DuplicatedCode", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "InconsistentLineSeparators", - "shortDescription": { - "text": "Inconsistent line separators" - }, - "fullDescription": { - "text": "Reports files with line separators different from the ones that are specified in the project's settings. For example, the inspection will be triggered if you set the line separator to '\\n' in Settings | Editor | Code Style | Line separator, while the file you are editing uses '\\r\\n' as a line separator. The inspection also warns you about mixed line separators within a file.", - "markdown": "Reports files with line separators different from the ones that are specified in the project's settings.\n\nFor example, the inspection will be triggered if you set the line separator to `\\n` in\n[Settings \\| Editor \\| Code Style \\| Line separator](settings://preferences.sourceCode?Line%20separator),\nwhile the file you are editing uses `\\r\\n` as a line separator.\n\nThe inspection also warns you about mixed line separators within a file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "InconsistentLineSeparators", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RedundantSuppression", - "shortDescription": { - "text": "Redundant suppression" - }, - "fullDescription": { - "text": "Reports usages of the following elements that can be safely removed because the inspection they affect is no longer applicable in this context: '@SuppressWarning' annotation, or '// noinspection' line comment, or '/** noinspection */' JavaDoc comment Example: 'public class C {\n // symbol is already private,\n // but annotation is still around\n @SuppressWarnings({\"WeakerAccess\"})\n private boolean CONST = true;\n void f() {\n CONST = false;\n }\n}'", - "markdown": "Reports usages of the following elements that can be safely removed because the inspection they affect is no longer applicable in this context:\n\n* `@SuppressWarning` annotation, or\n* `// noinspection` line comment, or\n* `/** noinspection */` JavaDoc comment\n\nExample:\n\n\n public class C {\n // symbol is already private,\n // but annotation is still around\n @SuppressWarnings({\"WeakerAccess\"})\n private boolean CONST = true;\n void f() {\n CONST = false;\n }\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "RedundantSuppression", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ProblematicWhitespace", - "shortDescription": { - "text": "Problematic whitespace" - }, - "fullDescription": { - "text": "Reports the following problems: Tabs used for indentation when the code style is configured to use only spaces. Spaces used for indentation when the code style is configured to use only tabs. Spaces used for indentation and tabs used for alignment when the code style is configured to use smart tabs.", - "markdown": "Reports the following problems:\n\n* Tabs used for indentation when the code style is configured to use only spaces.\n* Spaces used for indentation when the code style is configured to use only tabs.\n* Spaces used for indentation and tabs used for alignment when the code style is configured to use smart tabs." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ProblematicWhitespace", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlUnknownTarget", - "shortDescription": { - "text": "Unresolved file in a link" - }, - "fullDescription": { - "text": "Reports an unresolved file in a link.", - "markdown": "Reports an unresolved file in a link." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlUnknownTarget", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SSBasedInspection", - "shortDescription": { - "text": "Structural search inspection" - }, - "fullDescription": { - "text": "Allows configuring Structural Search/Structural Replace templates that you can apply to the file you are editing. All matches will be highlighted and marked with the template name that you have configured. If you configure the Structural Replace pattern as well, the corresponding replace option will be available as a quick-fix.", - "markdown": "Allows configuring **Structural Search/Structural Replace** templates that you can apply to the file you are editing.\n\nAll matches will be highlighted and marked with the template name that you have configured.\nIf you configure the **Structural Replace** pattern as well, the corresponding replace option will be available as a quick-fix." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SSBasedInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Structural search", - "index": 34, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LongLine", - "shortDescription": { - "text": "Line is longer than allowed by code style" - }, - "fullDescription": { - "text": "Reports lines that are longer than the Hard wrap at parameter specified in Settings | Editor | Code Style | General.", - "markdown": "Reports lines that are longer than the **Hard wrap at** parameter specified in [Settings \\| Editor \\| Code Style \\| General](settings://preferences.sourceCode?Hard%20wrap%20at)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LongLine", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlWrongRootElement", - "shortDescription": { - "text": "Wrong root element" - }, - "fullDescription": { - "text": "Reports a root tag name different from the name specified in the '' tag.", - "markdown": "Reports a root tag name different from the name specified in the `` tag." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlWrongRootElement", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckValidXmlInScriptTagBody", - "shortDescription": { - "text": "Malformed content of 'script' tag" - }, - "fullDescription": { - "text": "Reports contents of 'script' tags that are invalid XML. Example: '' After the quick-fix is applied: ''", - "markdown": "Reports contents of `script` tags that are invalid XML. \n\n**Example:**\n\n\n \n\nAfter the quick-fix is applied:\n\n\n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CheckValidXmlInScriptTagBody", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpSuspiciousBackref", - "shortDescription": { - "text": "Suspicious back reference" - }, - "fullDescription": { - "text": "Reports back references that will not be resolvable at runtime. This means that the back reference can never match anything. A back reference will not be resolvable when the group is defined after the back reference, or if the group is defined in a different branch of an alternation. Example of a group defined after its back reference: '\\1(abc)' Example of a group and a back reference in different branches: 'a(b)c|(xy)\\1z' New in 2022.1", - "markdown": "Reports back references that will not be resolvable at runtime. This means that the back reference can never match anything. A back reference will not be resolvable when the group is defined after the back reference, or if the group is defined in a different branch of an alternation.\n\n**Example of a group defined after its back reference:**\n\n\n \\1(abc)\n\n**Example of a group and a back reference in different branches:**\n\n\n a(b)c|(xy)\\1z\n\nNew in 2022.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpSuspiciousBackref", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpSingleCharAlternation", - "shortDescription": { - "text": "Single character alternation" - }, - "fullDescription": { - "text": "Reports single char alternation in a RegExp. It is simpler to use a character class instead. This may also provide better matching performance. Example: 'a|b|c|d' After the quick-fix is applied: '[abcd]' New in 2017.1", - "markdown": "Reports single char alternation in a RegExp. It is simpler to use a character class instead. This may also provide better matching performance.\n\n**Example:**\n\n\n a|b|c|d\n\nAfter the quick-fix is applied:\n\n\n [abcd]\n\n\nNew in 2017.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpSingleCharAlternation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlUnknownAttribute", - "shortDescription": { - "text": "Unknown attribute" - }, - "fullDescription": { - "text": "Reports an unknown HTML attribute. Suggests configuring attributes that should not be reported.", - "markdown": "Reports an unknown HTML attribute. Suggests configuring attributes that should not be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlUnknownAttribute", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckTagEmptyBody", - "shortDescription": { - "text": "Empty element content" - }, - "fullDescription": { - "text": "Reports XML elements without contents. Example: '\n \n ' After the quick-fix is applied: '\n \n '", - "markdown": "Reports XML elements without contents.\n\n**Example:**\n\n\n \n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CheckTagEmptyBody", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpRedundantEscape", - "shortDescription": { - "text": "Redundant character escape" - }, - "fullDescription": { - "text": "Reports redundant character escape sequences that can be replaced with unescaped characters preserving the meaning. Many escape sequences that are necessary outside of a character class are redundant inside square brackets '[]' of a character class. Although unescaped opening curly braces '{' outside of character classes are allowed in some dialects (JavaScript, Python, and so on), it can cause confusion and make the pattern less portable, because there are dialects that require escaping curly braces as characters. For this reason the inspection does not report escaped opening curly braces. Example: '\\-\\;[\\.]' After the quick-fix is applied: '-;[.]' The Ignore escaped closing brackets '}' and ']' option specifies whether to report '\\}' and '\\]' outside of a character class when they are allowed to be unescaped by the RegExp dialect. New in 2017.3", - "markdown": "Reports redundant character escape sequences that can be replaced with unescaped characters preserving the meaning. Many escape sequences that are necessary outside of a character class are redundant inside square brackets `[]` of a character class.\n\n\nAlthough unescaped opening curly braces `{` outside of character classes are allowed in some dialects (JavaScript, Python, and so on),\nit can cause confusion and make the pattern less portable, because there are dialects that require escaping curly braces as characters.\nFor this reason the inspection does not report escaped opening curly braces.\n\n**Example:**\n\n\n \\-\\;[\\.]\n\nAfter the quick-fix is applied:\n\n\n -;[.]\n\n\nThe **Ignore escaped closing brackets '}' and '\\]'** option specifies whether to report `\\}` and `\\]` outside of a character class\nwhen they are allowed to be unescaped by the RegExp dialect.\n\nNew in 2017.3" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpRedundantEscape", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnresolvedReference", - "shortDescription": { - "text": "Unresolved reference" - }, - "fullDescription": { - "text": "Reports an unresolved reference to a named pattern ('define') in RELAX-NG files that use XML syntax. Suggests creating the referenced 'define' element.", - "markdown": "Reports an unresolved reference to a named pattern (`define`) in RELAX-NG files that use XML syntax. Suggests creating the referenced `define` element." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "UnresolvedReference", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "RELAX NG", - "index": 48, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlMissingClosingTag", - "shortDescription": { - "text": "Missing closing tag" - }, - "fullDescription": { - "text": "Reports an HTML element without a closing tag. Some coding styles require that HTML elements have closing tags even where this is optional. Example: '\n \n

Behold!\n \n ' After the quick-fix is applied: '\n \n

Behold!

\n \n '", - "markdown": "Reports an HTML element without a closing tag. Some coding styles require that HTML elements have closing tags even where this is optional.\n\n**Example:**\n\n\n \n \n

Behold!\n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n

Behold!

\n \n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HtmlMissingClosingTag", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CustomRegExpInspection", - "shortDescription": { - "text": "Custom RegExp inspection" - }, - "fullDescription": { - "text": "Custom Regex Inspection", - "markdown": "Custom Regex Inspection" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "CustomRegExpInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IncorrectFormatting", - "shortDescription": { - "text": "Incorrect formatting" - }, - "fullDescription": { - "text": "Reports formatting issues that appear if your code doesn't follow your project's code style settings. This inspection is not compatible with languages that require third-party formatters for code formatting, for example, Go or C with CLangFormat enabled.", - "markdown": "Reports formatting issues that appear if your code doesn't\nfollow your project's code style settings.\n\n\nThis inspection is not compatible with languages that require\nthird-party formatters for code formatting, for example, Go or\nC with CLangFormat enabled." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "IncorrectFormatting", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlExtraClosingTag", - "shortDescription": { - "text": "Redundant closing tag" - }, - "fullDescription": { - "text": "Reports redundant closing tags on empty elements, for example, 'img' or 'br'. Example: '\n \n

\n \n ' After the quick-fix is applied: '\n \n
\n \n '", - "markdown": "Reports redundant closing tags on empty elements, for example, `img` or `br`.\n\n**Example:**\n\n\n \n \n

\n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n
\n \n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlExtraClosingTag", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlUnknownAnchorTarget", - "shortDescription": { - "text": "Unresolved fragment in a link" - }, - "fullDescription": { - "text": "Reports an unresolved last part of an URL after the '#' sign.", - "markdown": "Reports an unresolved last part of an URL after the `#` sign." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlUnknownAnchorTarget", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpUnexpectedAnchor", - "shortDescription": { - "text": "Begin or end anchor in unexpected position" - }, - "fullDescription": { - "text": "Reports '^' or '\\A' anchors not at the beginning of the pattern and '$', '\\Z' or '\\z' anchors not at the end of the pattern. In the wrong position these RegExp anchors prevent the pattern from matching anything. In case of the '^' and '$' anchors, most likely the literal character was meant and the escape forgotten. Example: '(Price $10)' New in 2018.1", - "markdown": "Reports `^` or `\\A` anchors not at the beginning of the pattern and `$`, `\\Z` or `\\z` anchors not at the end of the pattern. In the wrong position these RegExp anchors prevent the pattern from matching anything. In case of the `^` and `$` anchors, most likely the literal character was meant and the escape forgotten.\n\n**Example:**\n\n\n (Price $10)\n\n\nNew in 2018.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpUnexpectedAnchor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SpellCheckingInspection", - "shortDescription": { - "text": "Typo" - }, - "fullDescription": { - "text": "Reports typos and misspellings in your code, comments, and literals and fixes them with one click.", - "markdown": "Reports typos and misspellings in your code, comments, and literals and fixes them with one click." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "SpellCheckingInspection", - "ideaSeverity": "TYPO", - "qodanaSeverity": "Low" - } - }, - "relationships": [ - { - "target": { - "id": "Proofreading", - "index": 56, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckXmlFileWithXercesValidator", - "shortDescription": { - "text": "Failed external validation" - }, - "fullDescription": { - "text": "Reports a discrepancy in an XML file with the specified DTD or schema detected by the Xerces validator.", - "markdown": "Reports a discrepancy in an XML file with the specified DTD or schema detected by the Xerces validator." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CheckXmlFileWithXercesValidator", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlUnknownTag", - "shortDescription": { - "text": "Unknown tag" - }, - "fullDescription": { - "text": "Reports an unknown HTML tag. Suggests configuring tags that should not be reported.", - "markdown": "Reports an unknown HTML tag. Suggests configuring tags that should not be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlUnknownTag", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpEscapedMetaCharacter", - "shortDescription": { - "text": "Escaped meta character" - }, - "fullDescription": { - "text": "Reports escaped meta characters. Some RegExp coding styles specify that meta characters should be placed inside a character class, to make the regular expression easier to understand. This inspection does not warn about the meta character '[', ']' and '^', because those would need additional escaping inside a character class. Example: '\\d+\\.\\d+' After the quick-fix is applied: '\\d+[.]\\d+' New in 2017.1", - "markdown": "Reports escaped meta characters. Some RegExp coding styles specify that meta characters should be placed inside a character class, to make the regular expression easier to understand. This inspection does not warn about the meta character `[`, `]` and `^`, because those would need additional escaping inside a character class.\n\n**Example:**\n\n\n \\d+\\.\\d+\n\nAfter the quick-fix is applied:\n\n\n \\d+[.]\\d+\n\nNew in 2017.1" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "RegExpEscapedMetaCharacter", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlHighlighting", - "shortDescription": { - "text": "XML highlighting" - }, - "fullDescription": { - "text": "Reports XML validation problems in the results of a batch code inspection.", - "markdown": "Reports XML validation problems in the results of a batch code inspection." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlHighlighting", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlDuplicatedId", - "shortDescription": { - "text": "Duplicate 'id' attribute" - }, - "fullDescription": { - "text": "Reports a duplicate 'id' attribute in XML.", - "markdown": "Reports a duplicate `id` attribute in XML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlDuplicatedId", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpDuplicateCharacterInClass", - "shortDescription": { - "text": "Duplicate character in character class" - }, - "fullDescription": { - "text": "Reports duplicate characters inside a RegExp character class. Duplicate characters are unnecessary and can be removed without changing the semantics of the regex. Example: '[aabc]' After the quick-fix is applied: '[abc]'", - "markdown": "Reports duplicate characters inside a RegExp character class. Duplicate characters are unnecessary and can be removed without changing the semantics of the regex.\n\n**Example:**\n\n\n [aabc]\n\nAfter the quick-fix is applied:\n\n\n [abc]\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpDuplicateCharacterInClass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlInvalidId", - "shortDescription": { - "text": "Unresolved 'id' reference" - }, - "fullDescription": { - "text": "Reports an unresolved 'id' reference in XML.", - "markdown": "Reports an unresolved `id` reference in XML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlInvalidId", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlUnboundNsPrefix", - "shortDescription": { - "text": "Unbound namespace prefix" - }, - "fullDescription": { - "text": "Reports an unbound namespace prefix in XML.", - "markdown": "Reports an unbound namespace prefix in XML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "XmlUnboundNsPrefix", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RequiredAttributes", - "shortDescription": { - "text": "Missing required attribute" - }, - "fullDescription": { - "text": "Reports a missing mandatory attribute in an XML/HTML tag. Suggests configuring attributes that should not be reported.", - "markdown": "Reports a missing mandatory attribute in an XML/HTML tag. Suggests configuring attributes that should not be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "RequiredAttributes", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ReassignedToPlainText", - "shortDescription": { - "text": "Reassigned to plain text" - }, - "fullDescription": { - "text": "Reports files that were explicitly re-assigned to Plain Text File Type. This association is unnecessary because the platform auto-detects text files by content automatically. You can dismiss this warning by removing the file type association in Settings | Editor | File Types | Text.", - "markdown": "Reports files that were explicitly re-assigned to Plain Text File Type. This association is unnecessary because the platform auto-detects text files by content automatically.\n\nYou can dismiss this warning by removing the file type association\nin **Settings \\| Editor \\| File Types \\| Text**." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ReassignedToPlainText", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlUnusedNamespaceDeclaration", - "shortDescription": { - "text": "Unused schema declaration" - }, - "fullDescription": { - "text": "Reports an unused namespace declaration or location hint in XML.", - "markdown": "Reports an unused namespace declaration or location hint in XML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "XmlUnusedNamespaceDeclaration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpRedundantClassElement", - "shortDescription": { - "text": "Redundant '\\d', '[:digit:]', or '\\D' class elements" - }, - "fullDescription": { - "text": "Reports redundant '\\d' or '[:digit:]' that are used in one class with '\\w' or '[:word:]' ('\\D' with '\\W') and can be removed. Example: '[\\w\\d]' After the quick-fix is applied: '[\\w]' New in 2022.2", - "markdown": "Reports redundant `\\d` or `[:digit:]` that are used in one class with `\\w` or `[:word:]` (`\\D` with `\\W`) and can be removed.\n\n**Example:**\n\n\n [\\w\\d]\n\nAfter the quick-fix is applied:\n\n\n [\\w]\n\nNew in 2022.2" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "RegExpRedundantClassElement", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpSimplifiable", - "shortDescription": { - "text": "Regular expression can be simplified" - }, - "fullDescription": { - "text": "Reports regular expressions that can be simplified. Example: '[a] xx* [ah-hz]' After the quick-fix is applied: 'a x+ [ahz]' New in 2022.1", - "markdown": "Reports regular expressions that can be simplified.\n\n**Example:**\n\n\n [a] xx* [ah-hz]\n\nAfter the quick-fix is applied:\n\n\n a x+ [ahz]\n\nNew in 2022.1" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "RegExpSimplifiable", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpEmptyAlternationBranch", - "shortDescription": { - "text": "Empty branch in alternation" - }, - "fullDescription": { - "text": "Reports empty branches in a RegExp alternation. An empty branch will only match the empty string, and in most cases that is not what is desired. This inspection will not report a single empty branch at the start or the end of an alternation. Example: '(alpha||bravo)' After the quick-fix is applied: '(alpha|bravo)' New in 2017.2", - "markdown": "Reports empty branches in a RegExp alternation. An empty branch will only match the empty string, and in most cases that is not what is desired. This inspection will not report a single empty branch at the start or the end of an alternation.\n\n**Example:**\n\n\n (alpha||bravo)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo)\n\nNew in 2017.2" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpEmptyAlternationBranch", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Annotator", - "shortDescription": { - "text": "Annotator" - }, - "fullDescription": { - "text": "Reports issues essential to this file (e.g., syntax errors) in the result of a batch code inspection run. These issues are usually always highlighted in the editor and can't be configured, unlike inspections. These options control the scope of checks performed by this inspection: Option \"Report syntax errors\": report parser-related issues. Option \"Report issues from language-specific annotators\": report issues found by annotators configured for the relevant language. See Custom Language Support: Annotators for details. Option \"Report other highlighting problems\": report issues specific to the language of the current file (e.g., type mismatches or unreported exceptions). See Custom Language Support: Highlighting for details.", - "markdown": "Reports issues essential to this file (e.g., syntax errors) in the result of a batch code inspection run. These issues are usually always highlighted in the editor and can't be configured, unlike inspections. These options control the scope of checks performed by this inspection:\n\n* Option \"**Report syntax errors**\": report parser-related issues.\n* Option \"**Report issues from language-specific annotators** \": report issues found by annotators configured for the relevant language. See [Custom Language Support: Annotators](https://plugins.jetbrains.com/docs/intellij/annotator.html) for details.\n* Option \"**Report other highlighting problems** \": report issues specific to the language of the current file (e.g., type mismatches or unreported exceptions). See [Custom Language Support: Highlighting](https://plugins.jetbrains.com/docs/intellij/syntax-highlighting-and-error-highlighting.html#semantic-highlighting) for details." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "Annotator", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlPathReference", - "shortDescription": { - "text": "Unresolved file reference" - }, - "fullDescription": { - "text": "Reports an unresolved file reference in XML.", - "markdown": "Reports an unresolved file reference in XML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlPathReference", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpUnnecessaryNonCapturingGroup", - "shortDescription": { - "text": "Unnecessary non-capturing group" - }, - "fullDescription": { - "text": "Reports unnecessary non-capturing groups, which have no influence on the match result. Example: 'Everybody be cool, (?:this) is a robbery!' After the quick-fix is applied: 'Everybody be cool, this is a robbery!' New in 2021.1", - "markdown": "Reports unnecessary non-capturing groups, which have no influence on the match result.\n\n**Example:**\n\n\n Everybody be cool, (?:this) is a robbery!\n\nAfter the quick-fix is applied:\n\n\n Everybody be cool, this is a robbery!\n\nNew in 2021.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpUnnecessaryNonCapturingGroup", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TodoComment", - "shortDescription": { - "text": "TODO comment" - }, - "fullDescription": { - "text": "Reports TODO comments in your code. You can configure the format for TODO comments in Settings | Editor | TODO. Enable the Only warn on TODO comments without any details option to only warn on empty TODO comments, that don't provide any description on the task that should be done. Disable to report all TODO comments.", - "markdown": "Reports **TODO** comments in your code.\n\nYou can configure the format for **TODO** comments in [Settings \\| Editor \\| TODO](settings://preferences.toDoOptions).\n\nEnable the **Only warn on TODO comments without any details** option to only warn on empty TODO comments, that\ndon't provide any description on the task that should be done. Disable to report all TODO comments." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TodoComment", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Json5StandardCompliance", - "shortDescription": { - "text": "Compliance with JSON5 standard" - }, - "fullDescription": { - "text": "Reports inconsistency with the language specification in a JSON5 file.", - "markdown": "Reports inconsistency with [the language specification](http://json5.org) in a JSON5 file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "Json5StandardCompliance", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsonDuplicatePropertyKeys", - "shortDescription": { - "text": "Duplicate keys in object literals" - }, - "fullDescription": { - "text": "Reports a duplicate key in an object literal.", - "markdown": "Reports a duplicate key in an object literal." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsonDuplicatePropertyKeys", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpRedundantNestedCharacterClass", - "shortDescription": { - "text": "Redundant nested character class" - }, - "fullDescription": { - "text": "Reports unnecessary nested character classes. Example: '[a-c[x-z]]' After the quick-fix is applied: '[a-cx-z]' New in 2020.2", - "markdown": "Reports unnecessary nested character classes.\n\n**Example:**\n\n\n [a-c[x-z]]\n\nAfter the quick-fix is applied:\n\n\n [a-cx-z]\n\nNew in 2020.2" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpRedundantNestedCharacterClass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlDeprecatedElement", - "shortDescription": { - "text": "Deprecated symbol" - }, - "fullDescription": { - "text": "Reports a deprecated XML element or attribute. Symbols can be marked by XML comment or documentation tag with text 'deprecated'.", - "markdown": "Reports a deprecated XML element or attribute.\n\nSymbols can be marked by XML comment or documentation tag with text 'deprecated'." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "XmlDeprecatedElement", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlWrongAttributeValue", - "shortDescription": { - "text": "Wrong attribute value" - }, - "fullDescription": { - "text": "Reports an incorrect HTML attribute value.", - "markdown": "Reports an incorrect HTML attribute value." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlWrongAttributeValue", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlDefaultAttributeValue", - "shortDescription": { - "text": "Redundant attribute with default value" - }, - "fullDescription": { - "text": "Reports a redundant assignment of the default value to an XML attribute.", - "markdown": "Reports a redundant assignment of the default value to an XML attribute." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "XmlDefaultAttributeValue", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpOctalEscape", - "shortDescription": { - "text": "Octal escape" - }, - "fullDescription": { - "text": "Reports octal escapes, which are easily confused with back references. Use hexadecimal escapes to avoid confusion. Example: '\\07' After the quick-fix is applied: '\\x07' New in 2017.1", - "markdown": "Reports octal escapes, which are easily confused with back references. Use hexadecimal escapes to avoid confusion.\n\n**Example:**\n\n\n \\07\n\nAfter the quick-fix is applied:\n\n\n \\x07\n\nNew in 2017.1" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "RegExpOctalEscape", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnusedDefine", - "shortDescription": { - "text": "Unused define" - }, - "fullDescription": { - "text": "Reports an unused named pattern ('define') in a RELAX-NG file (XML or Compact Syntax). 'define' elements that are used through an include in another file are ignored.", - "markdown": "Reports an unused named pattern (`define`) in a RELAX-NG file (XML or Compact Syntax). `define` elements that are used through an include in another file are ignored." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnusedDefine", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RELAX NG", - "index": 48, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsonSchemaCompliance", - "shortDescription": { - "text": "Compliance with JSON schema" - }, - "fullDescription": { - "text": "Reports inconsistence between a JSON file and the JSON schema that is assigned to it.", - "markdown": "Reports inconsistence between a JSON file and the [JSON schema](https://json-schema.org) that is assigned to it. " - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsonSchemaCompliance", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EmptyDirectory", - "shortDescription": { - "text": "Empty directory" - }, - "fullDescription": { - "text": "Reports empty directories. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Only report empty directories located under a source folder option to have only directories under source roots reported.", - "markdown": "Reports empty directories.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Only report empty directories located under a source folder** option to have only directories under source\nroots reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EmptyDirectory", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpAnonymousGroup", - "shortDescription": { - "text": "Anonymous capturing group or numeric back reference" - }, - "fullDescription": { - "text": "Reports anonymous capturing groups and numeric back references in a RegExp. These are only reported when the RegExp dialect supports named group and named group references. Named groups and named back references improve code readability and are recommended to use instead. When a capture is not needed, matching can be more performant and use less memory by using a non-capturing group, i.e. '(?:xxx)' instead of '(xxx)'. Example: '(\\d\\d\\d\\d)\\1' A better regex pattern could look like this: '(?\\d\\d\\d\\d)\\k' New in 2017.2", - "markdown": "Reports anonymous capturing groups and numeric back references in a RegExp. These are only reported when the RegExp dialect supports named group and named group references. Named groups and named back references improve code readability and are recommended to use instead. When a capture is not needed, matching can be more performant and use less memory by using a non-capturing group, i.e. `(?:xxx)` instead of `(xxx)`.\n\n**Example:**\n\n\n (\\d\\d\\d\\d)\\1\n\nA better regex pattern could look like this:\n\n\n (?\\d\\d\\d\\d)\\k\n\nNew in 2017.2" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpAnonymousGroup", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckDtdRefs", - "shortDescription": { - "text": "Unresolved DTD reference" - }, - "fullDescription": { - "text": "Reports inconsistency in a DTD-specific reference, for example, in a reference to an XML entity or to a DTD element declaration. Works in DTD an XML files.", - "markdown": "Reports inconsistency in a DTD-specific reference, for example, in a reference to an XML entity or to a DTD element declaration. Works in DTD an XML files." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CheckDtdRefs", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NonAsciiCharacters", - "shortDescription": { - "text": "Non-ASCII characters" - }, - "fullDescription": { - "text": "Reports code elements that use non-ASCII symbols in an unusual context. Example: Non-ASCII characters used in identifiers, strings, or comments. Identifiers written in different languages, such as 'myСollection' with the letter 'C' written in Cyrillic. Comments or strings containing Unicode symbols, such as long dashes and arrows.", - "markdown": "Reports code elements that use non-ASCII symbols in an unusual context.\n\nExample:\n\n* Non-ASCII characters used in identifiers, strings, or comments.\n* Identifiers written in different languages, such as `my`**С**`ollection` with the letter **C** written in Cyrillic.\n* Comments or strings containing Unicode symbols, such as long dashes and arrows." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NonAsciiCharacters", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Internationalization", - "index": 64, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LossyEncoding", - "shortDescription": { - "text": "Lossy encoding" - }, - "fullDescription": { - "text": "Reports characters that cannot be displayed because of the current document encoding. Examples: If you type international characters in a document with the US-ASCII charset, some characters will be lost on save. If you load a UTF-8-encoded file using the ISO-8859-1 one-byte charset, some characters will be displayed incorrectly. You can fix this by changing the file encoding either by specifying the encoding directly in the file, e.g. by editing 'encoding=' attribute in the XML prolog of XML file, or by changing the corresponding options in Settings | Editor | File Encodings.", - "markdown": "Reports characters that cannot be displayed because of the current document encoding.\n\nExamples:\n\n* If you type international characters in a document with the **US-ASCII** charset, some characters will be lost on save.\n* If you load a **UTF-8** -encoded file using the **ISO-8859-1** one-byte charset, some characters will be displayed incorrectly.\n\nYou can fix this by changing the file encoding\neither by specifying the encoding directly in the file, e.g. by editing `encoding=` attribute in the XML prolog of XML file,\nor by changing the corresponding options in **Settings \\| Editor \\| File Encodings**." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LossyEncoding", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Internationalization", - "index": 64, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpRepeatedSpace", - "shortDescription": { - "text": "Consecutive spaces" - }, - "fullDescription": { - "text": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier. Example: '( )' After the quick-fix is applied: '( {5})' New in 2017.1", - "markdown": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier.\n\n**Example:**\n\n\n ( )\n\nAfter the quick-fix is applied:\n\n\n ( {5})\n\n\nNew in 2017.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpRepeatedSpace", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpDuplicateAlternationBranch", - "shortDescription": { - "text": "Duplicate branch in alternation" - }, - "fullDescription": { - "text": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression. Example: '(alpha|bravo|charlie|alpha)' After the quick-fix is applied: '(alpha|bravo|charlie)' New in 2017.1", - "markdown": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression.\n\n**Example:**\n\n\n (alpha|bravo|charlie|alpha)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo|charlie)\n\nNew in 2017.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpDuplicateAlternationBranch", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IgnoreFileDuplicateEntry", - "shortDescription": { - "text": "Ignore file duplicates" - }, - "fullDescription": { - "text": "Reports duplicate entries (patterns) in the ignore file (e.g. .gitignore, .hgignore). Duplicate entries in these files are redundant and can be removed. Example: '# Output directories\n /out/\n /target/\n /out/'", - "markdown": "Reports duplicate entries (patterns) in the ignore file (e.g. .gitignore, .hgignore). Duplicate entries in these files are redundant and can be removed.\n\nExample:\n\n\n # Output directories\n /out/\n /target/\n /out/\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "IgnoreFileDuplicateEntry", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Version control", - "index": 65, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsonStandardCompliance", - "shortDescription": { - "text": "Compliance with JSON standard" - }, - "fullDescription": { - "text": "Reports the following discrepancies of a JSON file with the language specification: A line or block comment (configurable). Multiple top-level values (expect for JSON Lines files, configurable for others). A trailing comma in an object or array (configurable). A single quoted string. A property key is a not a double quoted strings. A NaN or Infinity/-Infinity numeric value as a floating point literal (configurable).", - "markdown": "Reports the following discrepancies of a JSON file with [the language specification](https://tools.ietf.org/html/rfc7159):\n\n* A line or block comment (configurable).\n* Multiple top-level values (expect for JSON Lines files, configurable for others).\n* A trailing comma in an object or array (configurable).\n* A single quoted string.\n* A property key is a not a double quoted strings.\n* A NaN or Infinity/-Infinity numeric value as a floating point literal (configurable)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JsonStandardCompliance", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckEmptyScriptTag", - "shortDescription": { - "text": "Empty tag" - }, - "fullDescription": { - "text": "Reports empty tags that do not work in some browsers. Example: '\n \n '", - "markdown": "Reports empty tags that do not work in some browsers.\n\n**Example:**\n\n\n \n \n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CheckEmptyScriptTag", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.database", - "version": "232.9876", - "rules": [ - { - "id": "MongoJSSideEffectsInspection", - "shortDescription": { - "text": "Statement with side effects" - }, - "fullDescription": { - "text": "Reports statements that can cause side effects while the data source is in read-only mode. For more information about enabling read-only mode, see Enable read-only mode for a connection in the IDE documentation. The Disable read-only mode quick-fix turns off the read-only mode for the respective data source. Example: 'db.my_collection.insertOne()'", - "markdown": "Reports statements that can cause side effects while the data source is in read-only mode.\n\nFor more information about enabling read-only mode, see\n[Enable\nread-only mode for a connection in the IDE documentation](https://www.jetbrains.com/help/datagrip/configuring-database-connections.html#enable-read-only-mode-for-a-connection).\n\nThe **Disable read-only mode** quick-fix turns off the read-only mode for the respective data source.\n\nExample:\n\n\n db.my_collection.insertOne()\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSSideEffects", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MysqlLoadDataPathInspection", - "shortDescription": { - "text": "LOAD statement path" - }, - "fullDescription": { - "text": "Reports paths that start with the tilde character in LOAD statements. Example (MySQL): 'CREATE TABLE table_name (id int);\nLOAD DATA LOCAL INFILE '~/Documents/some_file.txt'\nINTO TABLE table_name FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n'\nIGNORE 1 LINES;' Instead of the tilde character, use a full path to the file.", - "markdown": "Reports paths that start with the tilde character in LOAD statements.\n\nExample (MySQL):\n\n CREATE TABLE table_name (id int);\n LOAD DATA LOCAL INFILE '~/Documents/some_file.txt'\n INTO TABLE table_name FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n'\n IGNORE 1 LINES;\n\nInstead of the tilde character, use a full path to the file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MysqlLoadDataPath", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "MySQL", - "index": 13, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MongoJSExtSideEffectsInspection", - "shortDescription": { - "text": "Statement with side effects" - }, - "fullDescription": { - "text": "Reports statements that may cause side effects while the data source is in read-only mode. The quick-fix turns off the read-only mode for the respective data source. Example: 'db.my_collection.insertOne()'", - "markdown": "Reports statements that may cause side effects while the data source is in read-only mode.\n\nThe quick-fix turns off the read-only mode for the respective data source.\n\nExample:\n\n\n db.my_collection.insertOne()\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSSideEffects", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MysqlSpaceAfterFunctionNameInspection", - "shortDescription": { - "text": "Whitespace between the function name and the open parenthesis" - }, - "fullDescription": { - "text": "Reports any whitespace in a function call between the function name and the open parenthesis, which is not supported by default. Example (MySQL): 'SELECT MAX (qty) FROM orders;'", - "markdown": "Reports any whitespace in a function call between the function name and the open parenthesis, which is not supported by default.\n\nExample (MySQL):\n\n SELECT MAX (qty) FROM orders;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "MysqlSpaceAfterFunctionName", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "MySQL", - "index": 13, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlMissingReturnInspection", - "shortDescription": { - "text": "Missing return statement" - }, - "fullDescription": { - "text": "Reports functions that have no RETURN statements. Example (Oracle): 'CREATE FUNCTION foo RETURN int AS\nBEGIN\nEND;' The 'foo' function must return the integer value but the function body returns nothing. To fix the error, add a RETURN statement (for example, 'return 1;'). 'CREATE FUNCTION foo RETURN int AS\nBEGIN\n RETURN 1;\nEND;'", - "markdown": "Reports functions that have no RETURN statements.\n\nExample (Oracle):\n\n CREATE FUNCTION foo RETURN int AS\n BEGIN\n END;\n\nThe `foo` function must return the integer value but the function body returns nothing. To fix the error,\nadd a RETURN statement (for example, `return 1;`).\n\n CREATE FUNCTION foo RETURN int AS\n BEGIN\n RETURN 1;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "SqlMissingReturn", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlUnusedSubqueryItemInspection", - "shortDescription": { - "text": "Unused subquery item" - }, - "fullDescription": { - "text": "Reports columns, aliases, and other subquery items that are not referenced in the outer query expression. Example (PostgreSQL): 'CREATE TABLE for_subquery(id INT);\nSELECT a, q FROM (SELECT 1 AS a, 10 AS b, 2 + 3 AS q, id\n FROM for_subquery) x;' We reference 'a' and 'q' aliases from a subquery. But the 'b' alias and the 'id' column are not referenced in the outer SELECT statement. Therefore, 'b' and 'id' are grayed out.", - "markdown": "Reports columns, aliases, and other subquery items that are not referenced in the outer query expression.\n\nExample (PostgreSQL):\n\n CREATE TABLE for_subquery(id INT);\n SELECT a, q FROM (SELECT 1 AS a, 10 AS b, 2 + 3 AS q, id\n FROM for_subquery) x;\n\nWe reference `a` and `q` aliases from a subquery. But the `b` alias and the `id` column are\nnot referenced in the outer SELECT statement. Therefore, `b` and `id` are grayed out." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlUnused", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlCaseVsIfInspection", - "shortDescription": { - "text": "Using CASE instead of conditional function and vice versa" - }, - "fullDescription": { - "text": "Reports situations when CASE and IF are interchangeable. Example (MySQL): 'SELECT CASE\nWHEN C1 IS NULL THEN 1\nELSE 0\nEND\nFROM dual;' To keep your code short, you can replace the CASE structure with IF. You can do that by applying the Replace with 'IF' call intention action. The example code will look as follows: 'SELECT IF(C1 IS NULL, 1, 0)\nFROM dual;' To revert IF to CASE, click IF and apply the Replace with CASE expression intention action.", - "markdown": "Reports situations when CASE and IF are interchangeable.\n\nExample (MySQL):\n\n SELECT CASE\n WHEN C1 IS NULL THEN 1\n ELSE 0\n END\n FROM dual;\n\nTo keep your code short, you can replace the CASE structure with IF. You can do that by applying the **Replace with 'IF' call**\nintention action. The example code will look as follows:\n\n SELECT IF(C1 IS NULL, 1, 0)\n FROM dual;\n\nTo revert IF to CASE, click IF and apply the **Replace with CASE expression** intention action." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlCaseVsIf", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlShouldBeInGroupByInspection", - "shortDescription": { - "text": "Column should be in group by clause" - }, - "fullDescription": { - "text": "Reports columns that are not in the GROUP BY clause or inside an aggregate function call. Example (Microsoft SQL Server): 'CREATE TABLE t1 (a INT, b INT);\nSELECT a, b FROM t1 GROUP BY a;' If you run the SELECT query, you will receive an error because Microsoft SQL Server expects the 'b' column in GROUP BY or used inside an aggregate function. The following two examples will fix the error. 'SELECT a, b FROM t1 GROUP BY a, b;\nSELECT a, max(b) max_b FROM t1 GROUP BY a;'", - "markdown": "Reports columns that are not in the GROUP BY clause or inside an aggregate function call.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE t1 (a INT, b INT);\n SELECT a, b FROM t1 GROUP BY a;\n\nIf you run the SELECT query, you will receive an error because Microsoft SQL Server expects the `b` column in GROUP BY or used\ninside an aggregate function. The following two examples will fix the error.\n\n SELECT a, b FROM t1 GROUP BY a, b;\n SELECT a, max(b) max_b FROM t1 GROUP BY a;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlShouldBeInGroupBy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlAutoIncrementDuplicateInspection", - "shortDescription": { - "text": "Auto-increment duplicate" - }, - "fullDescription": { - "text": "Reports tables that contain two columns with an automatic increment. In MySQL, Microsoft SQL Server, and Db2 dialects, a table can have only one field with a auto-increment option, and this field must be a key. Example (MySQL): 'CREATE TABLE my_table\n(\n id INT AUTO_INCREMENT,\n c2 INT AUTO_INCREMENT,\n);' The AUTO_INCREMENT constraint for 'c2' will be highlighted as 'c1' already has this constraint. To fix the warning, you can make 'id' a primary key and delete AUTO_INCREMENT for 'c2'. 'CREATE TABLE my_table\n(\n id INT AUTO_INCREMENT PRIMARY KEY,\n c2 INT,\n);'", - "markdown": "Reports tables that contain two columns with an automatic increment. In MySQL, Microsoft SQL Server, and Db2 dialects, a table can have only one field with a auto-increment option, and this field must be a key.\n\nExample (MySQL):\n\n CREATE TABLE my_table\n (\n id INT AUTO_INCREMENT,\n c2 INT AUTO_INCREMENT,\n );\n\nThe AUTO_INCREMENT constraint for `c2` will be highlighted as `c1` already has this constraint. To fix the warning,\nyou can make `id` a primary key and delete AUTO_INCREMENT for `c2`.\n\n CREATE TABLE my_table\n (\n id INT AUTO_INCREMENT PRIMARY KEY,\n c2 INT,\n );\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlAutoIncrementDuplicate", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlStringLengthExceededInspection", - "shortDescription": { - "text": "Implicit string truncation" - }, - "fullDescription": { - "text": "Reports variables that exceed the defined length in characters. Example (Microsoft SQL Server): 'CREATE PROCEDURE test() AS\nBEGIN\nDECLARE myVarOk VARCHAR(5) = 'abcde';\nDECLARE myVarExceeded VARCHAR(5) = 'abcde12345';\n\nSET myVarOk = 'xyz';\nSET myVarExceeded = '123456789';\nEND;' The 'myVarExceeded' variable is defined as 'VARCHAR(5)' but both assigned values (''abcde12345'' and ''123456789'') exceed this limitation. You can truncate assigned values or increase the defined length. To increase the length, use the Increase type length quick-fix. After the quick-fix is applied: 'CREATE PROCEDURE test() AS\nBEGIN\nDECLARE myVarOk VARCHAR(5) = 'abcde';\nDECLARE myVarExceeded VARCHAR(10) = 'abcde12345';\n\nSET myVarOk = 'xyz';\nSET myVarExceeded = '123456789';\nEND;'", - "markdown": "Reports variables that exceed the defined length in characters.\n\nExample (Microsoft SQL Server):\n\n CREATE PROCEDURE test() AS\n BEGIN\n DECLARE myVarOk VARCHAR(5) = 'abcde';\n DECLARE myVarExceeded VARCHAR(5) = 'abcde12345';\n\n SET myVarOk = 'xyz';\n SET myVarExceeded = '123456789';\n END;\n\nThe `myVarExceeded` variable is defined as `VARCHAR(5)` but both assigned values (`'abcde12345'` and\n`'123456789'`) exceed this limitation. You can truncate assigned values or increase the defined length.\nTo increase the length, use the **Increase type length** quick-fix.\n\nAfter the quick-fix is applied:\n\n CREATE PROCEDURE test() AS\n BEGIN\n DECLARE myVarOk VARCHAR(5) = 'abcde';\n DECLARE myVarExceeded VARCHAR(10) = 'abcde12345';\n\n SET myVarOk = 'xyz';\n SET myVarExceeded = '123456789';\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlStringLengthExceeded", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlSideEffectsInspection", - "shortDescription": { - "text": "Statement with side effects" - }, - "fullDescription": { - "text": "Reports statements that might lead to modification of a database during a read-only connection. To enable read-only mode for a connection, right-click a data source in the Database tool window (View | Tool Windows | Database) and select Properties. In the Data Sources and Drivers dialog, click the Options tab and select the Read-only checkbox. Example (MySQL): 'CREATE TABLE foo(a INT);\nINSERT INTO foo VALUES (1);' As 'CREATE TABLE' and 'INSERT INTO' statements lead to a database modification, these statements will be highlighted in read-only connection mode.", - "markdown": "Reports statements that might lead to modification of a database during a read-only connection.\n\nTo enable read-only mode for a\nconnection,\nright-click a data source in the **Database** tool window (**View \\| Tool Windows \\| Database** ) and select **Properties** .\nIn the **Data Sources and Drivers** dialog, click the **Options** tab and select the **Read-only** checkbox.\n\nExample (MySQL):\n\n CREATE TABLE foo(a INT);\n INSERT INTO foo VALUES (1);\n\nAs `CREATE TABLE` and `INSERT INTO` statements lead to a database modification, these statements will be highlighted\nin read-only connection mode." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlSideEffects", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDtInspection", - "shortDescription": { - "text": "Ill-formed date/time literals" - }, - "fullDescription": { - "text": "Reports errors in date and time literals. This inspection is available in MySQL, Oracle, Db2, and H2. Example (MySQL): 'SELECT TIME '10 -12:13:14' FROM dual;\nSELECT TIME ' 12 : 13 : 14 ' FROM dual;\nSELECT TIME '12 13 14' FROM dual;\nSELECT TIME '12-13-14' FROM dual;\nSELECT TIME '12.13.14' FROM dual;\nSELECT TIME '12:13:' FROM dual;\nSELECT TIME '12:13' FROM dual;\nSELECT TIME '12:' FROM dual;' In this example, dates ignore the MySQL standard for date and time literals. Therefore, they will be highlighted. For more information about date and time literals in MySQL, see Date and Time Literals at dev.mysql.com. The following date and type literals are valid for MySQL. 'SELECT TIME '12:13:14' FROM dual;\nSELECT TIME '12:13:14.555' FROM dual;\nSELECT TIME '12:13:14.' FROM dual;\nSELECT TIME '-12:13:14' FROM dual;\nSELECT TIME '10 12:13:14' FROM dual;\nSELECT TIME '-10 12:13:14' FROM dual;'", - "markdown": "Reports errors in date and time literals. This inspection is available in MySQL, Oracle, Db2, and H2.\n\nExample (MySQL):\n\n SELECT TIME '10 -12:13:14' FROM dual;\n SELECT TIME ' 12 : 13 : 14 ' FROM dual;\n SELECT TIME '12 13 14' FROM dual;\n SELECT TIME '12-13-14' FROM dual;\n SELECT TIME '12.13.14' FROM dual;\n SELECT TIME '12:13:' FROM dual;\n SELECT TIME '12:13' FROM dual;\n SELECT TIME '12:' FROM dual;\n\nIn this example, dates ignore the MySQL standard for date and time literals. Therefore, they will be highlighted.\nFor more information about date and time literals in MySQL, see [Date and Time Literals at dev.mysql.com](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-literals.html).\n\nThe following date and type literals are valid for MySQL.\n\n SELECT TIME '12:13:14' FROM dual;\n SELECT TIME '12:13:14.555' FROM dual;\n SELECT TIME '12:13:14.' FROM dual;\n SELECT TIME '-12:13:14' FROM dual;\n SELECT TIME '10 12:13:14' FROM dual;\n SELECT TIME '-10 12:13:14' FROM dual;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDateTime", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlIllegalCursorStateInspection", - "shortDescription": { - "text": "Illegal cursor state" - }, - "fullDescription": { - "text": "Reports illegal cursor states inside SQL routines. A routine has CLOSE or FETCH statements but a cursor might be closed. A routine has the OPEN statement but a cursor might be opened. Example (Microsoft SQL Server): 'CREATE TABLE t(col INT);\n\nCREATE PROCEDURE foo() AS\nBEGIN\nDECLARE my_cursor CURSOR FOR SELECT * FROM t;\nDECLARE a INT;\nFETCH my_cursor INTO a;\nCLOSE my_cursor;\nEND;' According to CLOSE (Transact-SQL) at docs.microsoft.com, CLOSE must be issued on an open cursor, and CLOSE is not allowed on cursors that have only been declared or are already closed. So, we need to open the cursor to fix the warning. 'CREATE PROCEDURE foo() AS\nBEGIN\nDECLARE my_cursor CURSOR FOR SELECT * FROM t;\nDECLARE a INT;\nOPEN my_cursor;\nFETCH my_cursor INTO a;\nCLOSE my_cursor;\nEND;'", - "markdown": "Reports illegal cursor states inside SQL routines.\n\n* A routine has CLOSE or FETCH statements but a cursor might be closed.\n* A routine has the OPEN statement but a cursor might be opened.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE t(col INT);\n\n CREATE PROCEDURE foo() AS\n BEGIN\n DECLARE my_cursor CURSOR FOR SELECT * FROM t;\n DECLARE a INT;\n FETCH my_cursor INTO a;\n CLOSE my_cursor;\n END;\n\nAccording to [CLOSE (Transact-SQL) at\ndocs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/close-transact-sql), CLOSE must be issued on an open cursor, and CLOSE is not allowed on cursors that have only been declared or are\nalready closed. So, we need to open the cursor to fix the warning.\n\n CREATE PROCEDURE foo() AS\n BEGIN\n DECLARE my_cursor CURSOR FOR SELECT * FROM t;\n DECLARE a INT;\n OPEN my_cursor;\n FETCH my_cursor INTO a;\n CLOSE my_cursor;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlIllegalCursorState", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlJoinWithoutOnInspection", - "shortDescription": { - "text": "Unsafe 'join' clause in 'delete' statement" - }, - "fullDescription": { - "text": "Reports missing conditional checks for statements that might modify the whole database. For example, usages of JOIN clauses inside DELETE statements without ON or WHERE. Without conditional checks on JOIN, DELETE drops contents of the entire table. Example (MySQL): 'CREATE TABLE foo (a INT,b INT,c INT);\nCREATE TABLE bar (a INT,b INT,c INT);\n\nDELETE table1 FROM foo table1 INNER JOIN bar table2;'", - "markdown": "Reports missing conditional checks for statements that might modify the whole database.\n\nFor example, usages of JOIN clauses inside DELETE statements without ON or WHERE. Without conditional checks on JOIN, DELETE drops\ncontents of the entire table.\n\nExample (MySQL):\n\n CREATE TABLE foo (a INT,b INT,c INT);\n CREATE TABLE bar (a INT,b INT,c INT);\n\n DELETE table1 FROM foo table1 INNER JOIN bar table2;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlJoinWithoutOn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDropIndexedColumnInspection", - "shortDescription": { - "text": "Index is dependent on column" - }, - "fullDescription": { - "text": "Reports cases when you try to drop columns from indexed tables. This inspection is available in Microsoft SQL Server and Sybase ASE. Example (Microsoft SQL Server): 'CREATE TABLE test_index\n(\ncol INT NOT NULL,\ncol2 INT NOT NULL,\ncol3 INT NOT NULL UNIQUE,\ncol4 VARCHAR(200)\n);\n\nCREATE UNIQUE INDEX aaaa ON test_index (col, col2);\n\nALTER TABLE test_index\nDROP COLUMN col;' You cannot delete the 'col' column because it is in the indexed table. To delete the column, you need to delete the 'aaaa' index first (for example, DROP INDEX aaaa).", - "markdown": "Reports cases when you try to drop columns from indexed tables. This inspection is available in Microsoft SQL Server and Sybase ASE.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE test_index\n (\n col INT NOT NULL,\n col2 INT NOT NULL,\n col3 INT NOT NULL UNIQUE,\n col4 VARCHAR(200)\n );\n\n CREATE UNIQUE INDEX aaaa ON test_index (col, col2);\n\n ALTER TABLE test_index\n DROP COLUMN col;\n\nYou cannot delete the `col` column because it is in the indexed table. To delete the column, you need to delete the\n`aaaa` index first (for example, DROP INDEX aaaa)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDropIndexedColumn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlCheckUsingColumnsInspection", - "shortDescription": { - "text": "Check using clause columns" - }, - "fullDescription": { - "text": "Reports columns in the USING clause that does not exist in both tables. Example (MySQL): 'CREATE TABLE t1 (i INT, j INT);\nCREATE TABLE t2 (k INT, l INT);\nSELECT * FROM t1 JOIN t2 USING (j);' In USING clauses, a column name must be present in both tables, and the SELECT query will automatically join those tables by using the given column name. As we do not have the 'j' column in 't2', we can rewrite the query using ON. The ON clause can join tables where the column names do not match in both tables. 'SELECT * FROM t1 JOIN t2 ON t1.j = t2.l;'", - "markdown": "Reports columns in the USING clause that does not exist in both tables.\n\nExample (MySQL):\n\n CREATE TABLE t1 (i INT, j INT);\n CREATE TABLE t2 (k INT, l INT);\n SELECT * FROM t1 JOIN t2 USING (j);\n\nIn USING clauses, a column name must be present in both tables, and the SELECT query will automatically join\nthose tables by using the given column name. As we do not have the `j` column in `t2`, we can\nrewrite the query using ON. The ON clause can join tables where the column names do not match in both tables.\n\n SELECT * FROM t1 JOIN t2 ON t1.j = t2.l;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlCheckUsingColumns", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlInsertValuesInspection", - "shortDescription": { - "text": "VALUES clause cardinality" - }, - "fullDescription": { - "text": "Reports situations when a number of parameters in VALUES does not match a number of columns in a target table. Example (MySQL): 'CREATE TABLE foo(a INT, b INT, c INT);\n\nINSERT INTO foo VALUES (1,2,3,4)' The 'foo' table has three columns but in the INSERT INTO statement we pass four.", - "markdown": "Reports situations when a number of parameters in VALUES does not match a number of columns in a target table.\n\nExample (MySQL):\n\n CREATE TABLE foo(a INT, b INT, c INT);\n\n INSERT INTO foo VALUES (1,2,3,4)\n\nThe `foo` table has three columns but in the INSERT INTO statement we pass four." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlInsertValues", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlConstantConditionInspection", - "shortDescription": { - "text": "Constant condition" - }, - "fullDescription": { - "text": "Reports conditions in WHERE or JOIN clauses that are always TRUE or always FALSE. Example (MySQL): 'CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\nSELECT a FROM t1 WHERE 'Cat' = 'Cat';' The ''Cat' = 'Cat'' is always true and will be reported.", - "markdown": "Reports conditions in WHERE or JOIN clauses that are always TRUE or always FALSE.\n\nExample (MySQL):\n\n CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\n SELECT a FROM t1 WHERE 'Cat' = 'Cat';\n\nThe `'Cat' = 'Cat'` is always true and will be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlConstantCondition", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDialectInspection", - "shortDescription": { - "text": "SQL dialect detection" - }, - "fullDescription": { - "text": "Reports situations when a dialect is not assigned to an SQL file. For example, when you open a new SQL file without assigning a dialect to it, you see a notification where the best matching dialect is advised. Click the Use link to use the advised dialect. Alternatively, click the Change dialect to link to select the other dialect.", - "markdown": "Reports situations when a dialect is not assigned to an SQL file.\n\nFor example, when you open a new SQL file without assigning a dialect\nto it, you see a notification where the best matching dialect is advised. Click the **Use \\** link to use the advised\ndialect. Alternatively, click the **Change dialect to** link to select the other dialect." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDialectInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlRedundantElseNullInspection", - "shortDescription": { - "text": "Redundant ELSE NULL clause" - }, - "fullDescription": { - "text": "Reports redundant ELSE NULL clauses. Example (MySQL): 'SELECT CASE WHEN 2 > 1 THEN 'OK' ELSE NULL END AS alias FROM foo;' The 'ELSE NULL' part will never be executed and may be omitted.", - "markdown": "Reports redundant ELSE NULL clauses.\n\nExample (MySQL):\n\n SELECT CASE WHEN 2 > 1 THEN 'OK' ELSE NULL END AS alias FROM foo;\n\nThe `ELSE NULL` part will never be executed and may be omitted." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlRedundantElseNull", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlCallNotationInspection", - "shortDescription": { - "text": "Using of named and positional arguments" - }, - "fullDescription": { - "text": "Reports calls in which positional arguments go after the named ones. Works in PostgreSQL, Oracle, and Db2. Example (In PostgreSQL): 'CREATE FUNCTION foo(a int, b int, c int) RETURNS int\n LANGUAGE plpgsql AS\n$$\nBEGIN\n RETURN a + b + c;\nEND\n$$;\nSELECT foo(a => 1, b => 2, c => 3);\n -- `3` goes after the named argument\nSELECT foo(1, b => 2, 3);\n -- `1` and `3` go after the named argument\nSELECT foo(b => 2, 1, 3);'", - "markdown": "Reports calls in which positional arguments go after the named ones. Works in PostgreSQL, Oracle, and Db2.\n\nExample (In PostgreSQL):\n\n CREATE FUNCTION foo(a int, b int, c int) RETURNS int\n LANGUAGE plpgsql AS\n $$\n BEGIN\n RETURN a + b + c;\n END\n $$;\n SELECT foo(a => 1, b => 2, c => 3);\n -- `3` goes after the named argument\n SELECT foo(1, b => 2, 3);\n -- `1` and `3` go after the named argument\n SELECT foo(b => 2, 1, 3);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "SqlCallNotation", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MysqlParsingInspection", - "shortDescription": { - "text": "Unsupported syntax in pre-8.0 versions" - }, - "fullDescription": { - "text": "Reports invalid usages of UNION in queries. The inspection works in MySQL versions that are earlier than 8.0. Example (MySQL): 'SELECT * FROM (SELECT 1 UNION (SELECT 1 UNION SELECT 2)) a;'", - "markdown": "Reports invalid usages of UNION in queries.\n\nThe inspection works in MySQL versions that are earlier than 8.0.\n\nExample (MySQL):\n\n\n SELECT * FROM (SELECT 1 UNION (SELECT 1 UNION SELECT 2)) a;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MysqlParsing", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "MySQL", - "index": 13, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MongoJSExtDeprecationInspection", - "shortDescription": { - "text": "Deprecated element" - }, - "fullDescription": { - "text": "Reports usages of deprecated methods in MongoDB and JavaScript code. The quick-fix replaces deprecated methods with recommended alternatives. Example: 'db.my_collection.insert()' After the quick-fix is applied: 'db.my_collection.insertOne()'", - "markdown": "Reports usages of deprecated methods in MongoDB and JavaScript code.\n\nThe quick-fix replaces deprecated methods with recommended alternatives.\n\nExample:\n\n\n db.my_collection.insert()\n\nAfter the quick-fix is applied:\n\n\n db.my_collection.insertOne()\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSDeprecation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDuplicateColumnInspection", - "shortDescription": { - "text": "Duplicating column name in SELECT" - }, - "fullDescription": { - "text": "Reports duplicated names of column aliases in SELECT lists. Example (Sybase ASE): 'CREATE TABLE t1 (a TEXT, b INT, c INT);\n\nSELECT a AS x, b AS x FROM t1;' The 'x' alias name is used for 'a' and 'b' columns. These assignments are highlighted as errors because you cannot use identical alias names for columns in Sybase ASE.", - "markdown": "Reports duplicated names of column aliases in SELECT lists.\n\nExample (Sybase ASE):\n\n CREATE TABLE t1 (a TEXT, b INT, c INT);\n\n SELECT a AS x, b AS x FROM t1;\n\nThe `x` alias name is used for `a` and `b` columns. These assignments are highlighted as errors because\nyou cannot use identical alias names for columns in Sybase ASE." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDuplicateColumn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlShadowingAliasInspection", - "shortDescription": { - "text": "Column is shadowed by alias" - }, - "fullDescription": { - "text": "Reports SELECT aliases with names that match column names in the FROM clause. Example (MySQL): 'CREATE TABLE foo (a INT, b INT, c INT);\nSELECT a b, c FROM foo;' The 'a' column uses the 'b' alias but the 'b' name is also used by the column from the 'foo' table.", - "markdown": "Reports SELECT aliases with names that match column names in the FROM clause.\n\nExample (MySQL):\n\n CREATE TABLE foo (a INT, b INT, c INT);\n SELECT a b, c FROM foo;\n\nThe `a` column uses the `b` alias but the `b` name is also used by the column from the `foo`\ntable." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlShadowingAlias", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MongoJSDeprecationInspection", - "shortDescription": { - "text": "Deprecated element" - }, - "fullDescription": { - "text": "Reports usages of deprecated methods in MongoDB and JavaScript code. The quick-fix replaces deprecated methods with recommended alternatives. Example: 'db.my_collection.insert()' After the quick-fix is applied: 'db.my_collection.insertOne()'", - "markdown": "Reports usages of deprecated methods in MongoDB and JavaScript code.\n\nThe quick-fix replaces deprecated methods with recommended alternatives.\n\nExample:\n\n db.my_collection.insert()\n\nAfter the quick-fix is applied:\n\n db.my_collection.insertOne()\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSDeprecation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlTypeInspection", - "shortDescription": { - "text": "Types compatibility" - }, - "fullDescription": { - "text": "Reports type-related errors.", - "markdown": "Reports type-related errors." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlType", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlUnreachableCodeInspection", - "shortDescription": { - "text": "Unreachable code" - }, - "fullDescription": { - "text": "Reports unreachable statements inside SQL routines. Example (Microsoft SQL Server): 'CREATE FUNCTION foo() RETURNS INT AS\nBEGIN\n THROW;\n RETURN 1;\nEND;' In Microsoft SQL Server, the 'THROW' statement raises an exception and transfers execution to the CATCH block of the TRY...CATCH construct. Therefore, the 'RETURN 1;' part will never be executed.", - "markdown": "Reports unreachable statements inside SQL routines.\n\nExample (Microsoft SQL Server):\n\n CREATE FUNCTION foo() RETURNS INT AS\n BEGIN\n THROW;\n RETURN 1;\n END;\n\nIn Microsoft SQL Server, the `THROW` statement raises an exception and transfers execution to the CATCH block of the TRY...CATCH\nconstruct. Therefore, the `RETURN 1;` part will never be executed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlUnreachable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlUnicodeStringLiteralInspection", - "shortDescription": { - "text": "Unicode usage in SQL" - }, - "fullDescription": { - "text": "Reports string literals that use national characters without the 'N' prefix. Without the N prefix, the string is converted to the default code page of the database. This default code page may not recognize certain characters. For more information, see nchar and nvarchar (Transact-SQL) at docs.microsoft.com. Example (Microsoft SQL Server): 'SELECT 'abcde' AS a;\nSELECT N'abcde' AS b;\nSELECT 'абвгд' AS c;\nSELECT N'абвгд' AS d;' The 'SELECT 'абвгд' AS c;' does not have the 'N' prefix, the ''абвгд'' part will be highlighted.", - "markdown": "Reports string literals that use national characters without the `N` prefix.\n\nWithout the N prefix, the string is converted to the default\ncode page of the database. This default code page may not recognize certain characters. For more information, see\n[nchar and nvarchar\n(Transact-SQL)\nat docs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql).\n\nExample (Microsoft SQL Server):\n\n SELECT 'abcde' AS a;\n SELECT N'abcde' AS b;\n SELECT 'абвгд' AS c;\n SELECT N'абвгд' AS d;\n\nThe `SELECT 'абвгд' AS c;` does not have the `N` prefix, the `'абвгд'` part will be highlighted." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlUnicodeStringLiteral", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlNoDataSourceInspection", - "shortDescription": { - "text": "No data sources configured" - }, - "fullDescription": { - "text": "Reports the absence of data sources in the Database tool window (View | Tool Windows | Database).", - "markdown": "Reports the absence of data sources in the **Database** tool window (**View \\| Tool Windows \\| Database**)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlNoDataSourceInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlUnusedVariableInspection", - "shortDescription": { - "text": "Unused variable" - }, - "fullDescription": { - "text": "Reports unused arguments, variables, or parameters. Example (PostgreSQL): 'CREATE FUNCTION foo(PARAMUSED INT, PARAMUNUSED INT) RETURNS INT AS\n$$\nBEGIN\n RETURN PARAMUSED;\nEND\n$$ LANGUAGE plpgsql;' The 'PARAMUNUSED' parameter is not used in the function and might be deleted.", - "markdown": "Reports unused arguments, variables, or parameters.\n\nExample (PostgreSQL):\n\n CREATE FUNCTION foo(PARAMUSED INT, PARAMUNUSED INT) RETURNS INT AS\n $$\n BEGIN\n RETURN PARAMUSED;\n END\n $$ LANGUAGE plpgsql;\n\nThe `PARAMUNUSED` parameter is not used in the function and might be deleted." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlUnused", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlResolveInspection", - "shortDescription": { - "text": "Unresolved reference" - }, - "fullDescription": { - "text": "Reports unresolved SQL references. Example (MySQL): 'CREATE TABLE users(id INT, name VARCHAR(40));\nCREATE TABLE admins(id INT, col1 INT);\n\nSELECT users.id, admins.id FROM admins WHERE admins.id > 1;' The 'users.id' column is unresolved because the 'users' table is missing in the FROM clause.", - "markdown": "Reports unresolved SQL references.\n\nExample (MySQL):\n\n CREATE TABLE users(id INT, name VARCHAR(40));\n CREATE TABLE admins(id INT, col1 INT);\n\n SELECT users.id, admins.id FROM admins WHERE admins.id > 1;\n\nThe `users.id` column is unresolved because the `users` table is missing in the FROM clause." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "SqlResolve", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PgSelectFromProcedureInspection", - "shortDescription": { - "text": "Postgres: Select from procedure call" - }, - "fullDescription": { - "text": "Reports situations when you make SELECT from a function or a DBLINK without an alias with a type (for example, 'AS t1(s VARCHAR)'). This requirement does not apply to scalar functions. Example (PostgreSQL): 'CREATE FUNCTION produce_a_table() RETURNS RECORD AS $$\nSELECT 1;\n$$ LANGUAGE sql;\nSELECT * FROM produce_a_table() AS s (c1 INT);\nSELECT * FROM produce_a_table() AS s (c1);\nSELECT * FROM DBLINK('dbname=mydb', 'SELECT proname, prosrc FROM pg_proc') AS t1;' The 'AS s (c1 INT)' has a typed alias, while 'AS s (c1)' and 'AS t1' do not. In this case, the second call of 'produce_a_table()' and 'DBLINK()' will be highlighted.", - "markdown": "Reports situations when you make SELECT from a function or a DBLINK without an alias with a type (for example, `AS t1(s VARCHAR)`).\n\nThis requirement does not apply to scalar functions.\n\nExample (PostgreSQL):\n\n CREATE FUNCTION produce_a_table() RETURNS RECORD AS $$\n SELECT 1;\n $$ LANGUAGE sql;\n SELECT * FROM produce_a_table() AS s (c1 INT);\n SELECT * FROM produce_a_table() AS s (c1);\n SELECT * FROM DBLINK('dbname=mydb', 'SELECT proname, prosrc FROM pg_proc') AS t1;\n\nThe `AS s (c1 INT)` has a typed alias, while `AS s (c1)` and `AS t1` do not.\nIn this case, the second call of `produce_a_table()` and `DBLINK()` will be highlighted." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PgSelectFromProcedure", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "PostgreSQL", - "index": 59, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlCurrentSchemaInspection", - "shortDescription": { - "text": "Current console schema introspected" - }, - "fullDescription": { - "text": "Reports schemas and databases in the current session that are not introspected. For example, this warning might occur when you try to create a table in the schema that is not introspected. Introspection is a method of inspecting a data source. When you perform introspection, structural information in the data source is inspected to detect tables, columns, functions, and other elements with their attributes.", - "markdown": "Reports schemas and databases in the current session that are not introspected.\n\nFor example, this warning might occur when you try to create a table in the schema that is not introspected.\n\nIntrospection is a method of inspecting a data source. When you perform introspection, structural information in the data source is\ninspected to detect tables, columns, functions, and other elements with their attributes." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlCurrentSchemaInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlMisleadingReferenceInspection", - "shortDescription": { - "text": "Misleading references" - }, - "fullDescription": { - "text": "Reports ambiguous references in SQL code. For example, when a name refer to both a table column and a routine parameter. The execution of such code might lead to errors or unexpected results due to counter-intuitive resolution logic. Usually, names with a more local scope have higher priority. Example (PostgreSQL): 'CREATE TABLE foo\n(\n id INT,\n name VARCHAR(5)\n);\nCREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n$$\nDECLARE\n b INT;\nBEGIN\n -- `name` is ambiguous as it is used as a column name and a parameter\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\nEND;\n$$ LANGUAGE plpgsql;' In PostgreSQL, you can use the '#variable_conflict' directives to explicitly specify a correct reference. For example, use '#variable_conflict use_column' to refer to a column name, or '#variable_conflict use_variable' to refer to a parameter. 'CREATE TABLE foo\n(\n id INT,\n name VARCHAR(5)\n);\nCREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n$$\n #variable_conflict use_column\nDECLARE\n b INT;\nBEGIN\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\nEND;\n$$ LANGUAGE plpgsql;'", - "markdown": "Reports ambiguous references in SQL code.\n\nFor example, when a name refer to both a table column and a routine parameter. The execution of such code might lead to errors or unexpected\nresults due to counter-intuitive resolution logic. Usually, names with a more local scope have higher priority.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo\n (\n id INT,\n name VARCHAR(5)\n );\n CREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n $$\n DECLARE\n b INT;\n BEGIN\n -- `name` is ambiguous as it is used as a column name and a parameter\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\n END;\n $$ LANGUAGE plpgsql;\n\nIn PostgreSQL, you can use the `#variable_conflict` directives to explicitly specify a correct reference. For example,\nuse `#variable_conflict use_column` to refer to a column name, or `#variable_conflict use_variable` to refer to a\nparameter.\n\n CREATE TABLE foo\n (\n id INT,\n name VARCHAR(5)\n );\n CREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n $$\n #variable_conflict use_column\n DECLARE\n b INT;\n BEGIN\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\n END;\n $$ LANGUAGE plpgsql;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlMisleadingReference", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlInsertIntoGeneratedColumnInspection", - "shortDescription": { - "text": "Insertion into generated columns" - }, - "fullDescription": { - "text": "Reports INSERT statements that assign values to generated columns. Generated columns can be read, but their values can not be directly written. Example (PostgreSQL): 'CREATE TABLE foo\n(\n col1 INT,\n col2 INT GENERATED ALWAYS AS (col1 + 1) STORED\n);\nINSERT INTO foo(col1, col2) VALUES (1, 2);'\n You cannot insert '2' into the 'col2' column because this column is generated. For this script to work, you can change '2' to DEFAULT. 'INSERT INTO foo(col1, col2) VALUES (1, DEFAULT);'", - "markdown": "Reports INSERT statements that assign values to generated columns. Generated columns can be read, but their values can not be directly written.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo\n (\n col1 INT,\n col2 INT GENERATED ALWAYS AS (col1 + 1) STORED\n );\n INSERT INTO foo(col1, col2) VALUES (1, 2);\n\nYou cannot insert `2` into the `col2` column because this column is generated.\nFor this script to work, you can change `2` to DEFAULT.\n`INSERT INTO foo(col1, col2) VALUES (1, DEFAULT);`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlInsertIntoGeneratedColumn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlRedundantLimitInspection", - "shortDescription": { - "text": "Redundant row limiting in queries" - }, - "fullDescription": { - "text": "Reports redundant row limiting clauses like FETCH and LIMIT in queries. Example (PostgreSQL): 'CREATE TABLE foo(a INT);\n\nSELECT * FROM foo WHERE EXISTS(SELECT * FROM foo LIMIT 2);\nSELECT * FROM foo WHERE EXISTS(SELECT * FROM foo FETCH FIRST 2 ROWS ONLY);' To fix the warning, you can add OFFSET to limiting clauses. If OFFSET is missing, then LIMIT is redundant because the usage of LIMIT does not influence the operation result of EXISTS. In case with OFFSET, we skip first 'N' rows and this will influence the output. 'SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW LIMIT 2);\nSELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW FETCH FIRST 2 ROWS ONLY);'", - "markdown": "Reports redundant row limiting clauses like FETCH and LIMIT in queries.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT);\n\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo LIMIT 2);\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo FETCH FIRST 2 ROWS ONLY);\n\nTo fix the warning, you can add OFFSET to limiting clauses. If OFFSET is missing, then LIMIT is redundant because\nthe usage of LIMIT does not influence the operation result of EXISTS. In case with OFFSET, we skip first `N` rows and this will\ninfluence the output.\n\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW LIMIT 2);\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW FETCH FIRST 2 ROWS ONLY);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlRedundantLimit", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlInsertNullIntoNotNullInspection", - "shortDescription": { - "text": "Insert NULL into NOT NULL column" - }, - "fullDescription": { - "text": "Reports cases when you insert NULL values into columns that accept only NOT NULL values. Example (Microsoft SQL Server): 'CREATE TABLE br2 (\nid INT NOT NULL,\ncol1 NVARCHAR (20) NOT NULL,\ncol2 NVARCHAR (20) NOT NULL,\n);\n--\nINSERT INTO br2 (id, col1, col2)\nVALUES (1, NULL, NULL);' You cannot insert NULL values in 'col1' and 'col2' because they are defined as NOT NULL. If you run the script as is, you will receive an error. To fix this code, replace NULL in the VALUES part with some values (for example, '42' and ''bird''). INSERT INTO br2 (id, col1, col2)\nVALUES (1, 42, 'bird');", - "markdown": "Reports cases when you insert NULL values into columns that accept only NOT NULL values.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE br2 (\n id INT NOT NULL,\n col1 NVARCHAR (20) NOT NULL,\n col2 NVARCHAR (20) NOT NULL,\n );\n --\n INSERT INTO br2 (id, col1, col2)\n VALUES (1, NULL, NULL);\n\nYou cannot insert NULL values in `col1` and `col2` because they are defined as NOT NULL. If you run the script as\nis,\nyou will receive an error. To fix this code, replace NULL in the VALUES part with some values (for example, `42` and\n`'bird'`).\n\n```\nINSERT INTO br2 (id, col1, col2)\nVALUES (1, 42, 'bird');\n```" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlInsertNullIntoNotNull", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDerivedTableAliasInspection", - "shortDescription": { - "text": "Each derived table should have alias" - }, - "fullDescription": { - "text": "Reports derived tables without aliases. Example (MySQL): 'CREATE TABLE table1 (id INT, name VARCHAR(20), cats FLOAT);\nCREATE TABLE table2 (id INT, age INTEGER);\n\nSELECT id AS ID, name, cats, age\nFROM (SELECT table1.id, name, cats, age\nFROM table1\nJOIN table2 ON table1.id = table2.id);' According to Derived Tables at dev.mysql.com, an alias is mandatory. You can add the alias by using the Introduce alias quick-fix. After the quick-fix is applied: 'SELECT id AS ID, name, cats, age\nFROM (SELECT table1.id, name, cats, age\nFROM table1\nJOIN table2 ON table1.id = table2.id);'", - "markdown": "Reports derived tables without aliases.\n\nExample (MySQL):\n\n CREATE TABLE table1 (id INT, name VARCHAR(20), cats FLOAT);\n CREATE TABLE table2 (id INT, age INTEGER);\n\n SELECT id AS ID, name, cats, age\n FROM (SELECT table1.id, name, cats, age\n FROM table1\n JOIN table2 ON table1.id = table2.id);\n\nAccording to [Derived Tables at dev.mysql.com](https://dev.mysql.com/doc/refman/8.0/en/derived-tables.html), an alias is\nmandatory. You can add the alias by using the **Introduce alias** quick-fix.\n\nAfter the quick-fix is applied:\n\n SELECT id AS ID, name, cats, age\n FROM (SELECT table1.id, name, cats, age\n FROM table1\n JOIN table2 ON table1.id = table2.id);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDerivedTableAlias", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MsBuiltinInspection", - "shortDescription": { - "text": "Builtin functions" - }, - "fullDescription": { - "text": "Reports truncations of string arguments in ISNULL functions. The ISNULL syntax is 'ISNULL(check_expression, replacement_value)'. According to ISNULL at docs.microsoft.com, 'replacement_value' will be truncated if 'replacement_value' is longer than 'check_expression'. Example (Microsoft SQL Server): 'DECLARE @name1 VARCHAR(2) = NULL;\nDECLARE @name2 VARCHAR(10) = 'Example';\nDECLARE @name3 VARCHAR(2) = 'Hi';\n\n -- `@name2` is VARCHAR(10) and will be truncated\nSELECT ISNULL(@name1, @name2);\n\n -- `@name3` is VARCHAR(2) as `@name1` and will not be truncated\nSELECT ISNULL(@name1, @name3);'", - "markdown": "Reports truncations of string arguments in ISNULL functions.\n\nThe ISNULL syntax is `ISNULL(check_expression, replacement_value)`.\n\nAccording to [ISNULL at\ndocs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/functions/isnull-transact-sql), `replacement_value` will be truncated if `replacement_value` is longer than\n`check_expression`.\n\nExample (Microsoft SQL Server):\n\n DECLARE @name1 VARCHAR(2) = NULL;\n DECLARE @name2 VARCHAR(10) = 'Example';\n DECLARE @name3 VARCHAR(2) = 'Hi';\n\n -- `@name2` is VARCHAR(10) and will be truncated\n SELECT ISNULL(@name1, @name2);\n\n -- `@name3` is VARCHAR(2) as `@name1` and will not be truncated\n SELECT ISNULL(@name1, @name3);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MssqlBuiltin", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL server", - "index": 60, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlTriggerTransitionInspection", - "shortDescription": { - "text": "Suspicious code in triggers" - }, - "fullDescription": { - "text": "Reports incorrect usages of transition table variables in triggers. Example (HSQLDB): 'CREATE TABLE foo(a INT);\n\nCREATE TRIGGER trg\n AFTER DELETE ON foo\nBEGIN\n SELECT * FROM NEW;\nEND;\n\nCREATE TRIGGER trig AFTER INSERT ON foo\n REFERENCING OLD ROW AS newrow\n FOR EACH ROW WHEN (a > 1)\n INSERT INTO foo VALUES (1)' In HSQLDB, DELETE triggers may be used only with the OLD state while INSERT triggers may have only the NEW state. So, in the previous example, NEW in 'SELECT * FROM NEW;' will be highlighted as well as OLD in 'REFERENCING OLD ROW AS newrow'.", - "markdown": "Reports incorrect usages of transition table variables in triggers.\n\nExample (HSQLDB):\n\n CREATE TABLE foo(a INT);\n\n CREATE TRIGGER trg\n AFTER DELETE ON foo\n BEGIN\n SELECT * FROM NEW;\n END;\n\n CREATE TRIGGER trig AFTER INSERT ON foo\n REFERENCING OLD ROW AS newrow\n FOR EACH ROW WHEN (a > 1)\n INSERT INTO foo VALUES (1)\n\nIn HSQLDB, DELETE triggers may be used only with the OLD state while INSERT triggers may have only the NEW state. So, in the previous\nexample, NEW in `SELECT * FROM NEW;` will be highlighted as well as OLD in `REFERENCING OLD ROW AS newrow`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlTriggerTransition", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlNamedArgumentsInspection", - "shortDescription": { - "text": "Named arguments should be used" - }, - "fullDescription": { - "text": "Reports arguments that are used without names in routine calls. By default, this inspection is disabled. For more information about the difference between named and unnamed parameters, see Binding Parameters by Name (Named Parameters) at docs.microsoft.com . Example (Microsoft SQL Server): 'CREATE FUNCTION foo(n INT, m INT) RETURNS INT AS\nBEGIN\n RETURN n + m;\nEND;\n\nCREATE PROCEDURE test AS\nBEGIN\n foo n = 1, m = 2;\n\n--- The following call misses parameter names and will be highlighted\n foo 1, 2;\nEND;' Parameters '1, 2' in the 'foo 1, 2;' call are highlighted because they miss names.", - "markdown": "Reports arguments that are used without names in routine calls. By default, this inspection is disabled.\n\nFor more information about the difference between named and unnamed parameters, see [Binding Parameters by Name (Named Parameters) at docs.microsoft.com](https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/binding-parameters-by-name-named-parameters).\n\nExample (Microsoft SQL Server):\n\n CREATE FUNCTION foo(n INT, m INT) RETURNS INT AS\n BEGIN\n RETURN n + m;\n END;\n\n CREATE PROCEDURE test AS\n BEGIN\n foo n = 1, m = 2;\n\n --- The following call misses parameter names and will be highlighted\n foo 1, 2;\n END;\n\nParameters `1, 2` in the `foo 1, 2;` call are highlighted because they miss names." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlNamedArguments", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlMultipleLimitClausesInspection", - "shortDescription": { - "text": "Multiple row limiting/offset clauses in queries" - }, - "fullDescription": { - "text": "Reports usages of multiple row limiting clauses in a single query. Example (Microsoft SQL Server): 'create table foo(a int);\nselect top 1 * from foo order by a offset 10 rows fetch next 20 rows only;' The SELECT TOP clause is used to specify that only 1 record must be returned. The FETCH clause specifies the number of rows to return after the OFFSET clause has been processed. But as we already have the SELECT TOP limiting clause, the FETCH clause might be redundant.", - "markdown": "Reports usages of multiple row limiting clauses in a single query.\n\nExample (Microsoft SQL Server):\n\n create table foo(a int);\n select top 1 * from foo order by a offset 10 rows fetch next 20 rows only;\n\nThe SELECT TOP clause is used to specify that only 1 record must be\nreturned. The FETCH clause specifies the number of rows to return after the OFFSET\nclause has been processed. But as we already have the SELECT TOP limiting clause, the FETCH clause might be redundant." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlMultipleLimitClauses", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlCaseVsCoalesceInspection", - "shortDescription": { - "text": "Using CASE instead of COALESCE function and vice versa" - }, - "fullDescription": { - "text": "Reports situations when CASE and COALESCE calls are interchangeable. This inspection has the following intention actions: Replace with 'COALESCE' call and the opposite one Replace with CASE expression. Example (MySQL): 'SELECT\n -- this CASE may be replaced by COALESCE\n\tCASE\n\t\tWHEN C1 IS NOT NULL THEN C1\n\t\tELSE 0\n\t\tEND\nFROM dual;' In the example, the CASE statement can be replaced with 'SELECT COALESCE(C1, 0)' that produces the same output. If you prefer using CASE expressions, select the Prefer CASE expressions over COALESCE function option on the inspection page.", - "markdown": "Reports situations when CASE and COALESCE calls are interchangeable. This inspection has the following intention actions: **Replace\nwith 'COALESCE' call** and the opposite one **Replace with CASE expression** .\n\nExample (MySQL):\n\n SELECT\n -- this CASE may be replaced by COALESCE\n \tCASE\n \t\tWHEN C1 IS NOT NULL THEN C1\n \t\tELSE 0\n \t\tEND\n FROM dual;\n\nIn the example, the CASE statement can be replaced with `SELECT COALESCE(C1, 0)` that produces the same output.\n\nIf you prefer using CASE expressions, select the **Prefer CASE expressions over COALESCE function** option on\nthe inspection page." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlCaseVsCoalesce", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlRedundantAliasInspection", - "shortDescription": { - "text": "Redundant alias expressions" - }, - "fullDescription": { - "text": "Reports alias expressions that duplicate names of columns in tables and might be redundant. Example (PostgreSQL): 'CREATE TABLE foo(a INT, b INT);\n\nSELECT * FROM foo foo(a, b);\nSELECT * FROM foo foo(a);\nSELECT * FROM foo foo(x);\nSELECT * FROM foo foo(x, y);' The first two aliases use the same column names as in the 'foo' table. They are considered redundant because they column names are identical.", - "markdown": "Reports alias expressions that duplicate names of columns in tables and might be redundant.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT, b INT);\n\n SELECT * FROM foo foo(a, b);\n SELECT * FROM foo foo(a);\n SELECT * FROM foo foo(x);\n SELECT * FROM foo foo(x, y);\n\nThe first two aliases use the same column names as in the `foo` table. They are considered redundant because they\ncolumn names are identical." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlRedundantAlias", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlIdentifierInspection", - "shortDescription": { - "text": "Identifier should be quoted" - }, - "fullDescription": { - "text": "Reports situations when you use SQL reserved keywords as identifier names in your query. Example (Microsoft SQL Server): 'CREATE TABLE select (identity INT IDENTITY NOT NULL, order INT NOT NULL);' We use 'select', 'identity', and 'order' as table and column names. But they are also reserved keywords in Microsoft SQL Server. Therefore, in order to use them as object names in the query, you must quote these identifiers. To quote them, you can use the Quote identifier quick-fix. After the quick-fix is applied: 'CREATE TABLE [select] ([identity] INT IDENTITY NOT NULL, [order] INT NOT NULL);'", - "markdown": "Reports situations when you use SQL reserved keywords as identifier names in your query.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE select (identity INT IDENTITY NOT NULL, order INT NOT NULL);\n\nWe use `select`, `identity`, and `order` as table and column names.\nBut they are also reserved keywords in Microsoft SQL Server.\nTherefore, in order to use them as object names in the query, you must quote these identifiers. To quote them, you can use the\n**Quote identifier** quick-fix.\n\nAfter the quick-fix is applied:\n\n CREATE TABLE [select] ([identity] INT IDENTITY NOT NULL, [order] INT NOT NULL);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlIdentifier", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlTransactionStatementInTriggerInspection", - "shortDescription": { - "text": "Use of transaction management statements in triggers" - }, - "fullDescription": { - "text": "Reports usages of transaction management statements like COMMIT or ROLLBACK in trigger bodies. With COMMIT or ROLLBACK statements in a trigger body, the trigger will not compile. The fail happens because triggers start during transactions. When the trigger starts the current transaction is still not complete. As COMMIT terminates a transaction, both statements (COMMIT and ROLLBACK) would lead to an exception. Changes that are executed in a trigger should be committed (or rolled back) by the owning transaction that started the trigger. Example (Oracle): 'CREATE TABLE employee_audit\n(\n id INT NOT NULL,\n update_date DATE NOT NULL,\n old_name VARCHAR2(100),\n new_name VARCHAR2(100)\n);\n\nCREATE TABLE employees\n(\n id INT NOT NULL,\n name VARCHAR2(100) NOT NULL\n);\n\nCREATE OR REPLACE TRIGGER trig_commit\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\nBEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n COMMIT;\nEND;\n\nCREATE OR REPLACE TRIGGER trig_rollback\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\nBEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n ROLLBACK;\nEND;'", - "markdown": "Reports usages of transaction management statements like COMMIT or ROLLBACK in trigger bodies.\n\nWith COMMIT or ROLLBACK statements in a trigger body, the trigger will not compile.\nThe fail happens because triggers start during transactions. When the trigger starts the current transaction is still not complete. As\nCOMMIT\nterminates a transaction, both statements (COMMIT and ROLLBACK) would lead to an exception.\nChanges that are executed in a trigger should be committed (or rolled back) by the owning transaction that started the trigger.\n\nExample (Oracle):\n\n CREATE TABLE employee_audit\n (\n id INT NOT NULL,\n update_date DATE NOT NULL,\n old_name VARCHAR2(100),\n new_name VARCHAR2(100)\n );\n\n CREATE TABLE employees\n (\n id INT NOT NULL,\n name VARCHAR2(100) NOT NULL\n );\n\n CREATE OR REPLACE TRIGGER trig_commit\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\n BEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n COMMIT;\n END;\n\n CREATE OR REPLACE TRIGGER trig_rollback\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\n BEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n ROLLBACK;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlTransactionStatementInTrigger", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlRedundantCodeInCoalesceInspection", - "shortDescription": { - "text": "Redundant code in COALESCE call" - }, - "fullDescription": { - "text": "Reports all the arguments except for the first expression that does not evaluate to NULL in COALESCE functions. Example (MySQL): 'SELECT COALESCE(NULL, NULL, NULL, 42, NULL, 'string') as a;' The first NOT NULL argument is '42', all other arguments will be grayed out.", - "markdown": "Reports all the arguments except for the first expression that does not evaluate to NULL in COALESCE functions.\n\nExample (MySQL):\n\n SELECT COALESCE(NULL, NULL, NULL, 42, NULL, 'string') as a;\n\nThe first NOT NULL argument is `42`, all other arguments will be grayed out." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlRedundantCodeInCoalesce", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlStorageInspection", - "shortDescription": { - "text": "SQL source modification detection" - }, - "fullDescription": { - "text": "Reports situations when source code of a database object has been changed. The inspection is triggered when you perform database or object introspection. The introspection is run when you open source code of an object, run statements, and perform code refactoring. Also, you can run introspection by right-clicking an object and selecting Refresh. The inspection covers the following situations: Object source code was changed in the database but code in the editor was not updated. Works in PostgreSQL, Microsoft SQL Server, Oracle, and Sybase ASE. You changed the object source code, introspected the database, but source code has been already changed by someone else. The database introspector was updated in the IDE and you need to download new object properties that were missing in the previous introspector version.", - "markdown": "Reports situations when source code of a database object has been changed.\n\nThe inspection is triggered when you perform database or object introspection. The introspection is run when you open source code of an\nobject, run statements, and perform code refactoring.\nAlso, you can run introspection by right-clicking an object and selecting **Refresh**.\n\nThe inspection covers the following situations:\n\n* Object source code was changed in the database but code in the editor was not updated. Works in PostgreSQL, Microsoft SQL Server, Oracle, and Sybase ASE.\n* You changed the object source code, introspected the database, but source code has been already changed by someone else.\n* The database introspector was updated in the IDE and you need to download new object properties that were missing in the previous introspector version." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlStorageInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MsOrderByInspection", - "shortDescription": { - "text": "ORDER BY in queries" - }, - "fullDescription": { - "text": "Reports usages when the 'ORDER BY' clause is used without 'TOP', 'OFFSET', or 'FOR XML' in views, inline functions, derived tables, subqueries, and common table expressions. For more information about usages of 'ORDER BY', see SELECT - ORDER BY Clause (Transact-SQL) at docs.microsoft.com. Example (Microsoft SQL server): 'CREATE TABLE foo (a INT NOT NULL, b INT NOT NULL);\n\nSELECT *\nFROM (SELECT a, b\nFROM foo A\nWHERE a < 89\nORDER BY b) ALIAS;' In a subquery, ORDER BY will be highlighted as an error. You can add TOP, OFFSET, or FOR XML to a subquery. Alternatively, use the Delete element quick-fix to delete the ORDER BY section. After the quick-fix is applied: 'SELECT *\nFROM (SELECT a, b\nFROM foo A\nWHERE a < 89) ALIAS;'", - "markdown": "Reports usages when the `ORDER BY` clause is used without `TOP`, `OFFSET`, or `FOR XML` in views, inline functions, derived tables, subqueries, and common table expressions.\n\nFor more information about usages of `ORDER BY`, see [SELECT - ORDER BY Clause (Transact-SQL) at\ndocs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql).\n\nExample (Microsoft SQL server):\n\n CREATE TABLE foo (a INT NOT NULL, b INT NOT NULL);\n\n SELECT *\n FROM (SELECT a, b\n FROM foo A\n WHERE a < 89\n ORDER BY b) ALIAS;\n\nIn a subquery, ORDER BY will be highlighted as an error. You can add TOP, OFFSET, or FOR XML to a subquery.\nAlternatively, use the **Delete element** quick-fix to delete the ORDER BY section.\n\nAfter the quick-fix is applied:\n\n SELECT *\n FROM (SELECT a, b\n FROM foo A\n WHERE a < 89) ALIAS;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "MsOrderBy", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "SQL server", - "index": 60, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlSignatureInspection", - "shortDescription": { - "text": "Function signature" - }, - "fullDescription": { - "text": "Reports signature issues for built-in functions. The inspection will report a wrong number of arguments, invalid keywords, wrong data types, and other issues. Example (MySQL): 'CREATE TABLE foo (a INT, b INT, c INT)\n\nSELECT IFNULL() FROM foo; -- error\nSELECT IFNULL(a) FROM foo; -- error\nSELECT IFNULL(a, b) FROM foo; -- OK\nSELECT IFNULL(a, b, c) FROM foo; -- error' In MySQL, the 'IFNULL()' function accepts strictly two arguments. So, only the 'SELECT IFNULL(a, b) FROM foo;' query is correct.", - "markdown": "Reports signature issues for built-in functions.\n\nThe inspection will report a wrong number of arguments, invalid keywords, wrong data types, and other issues.\n\nExample (MySQL):\n\n CREATE TABLE foo (a INT, b INT, c INT)\n\n SELECT IFNULL() FROM foo; -- error\n SELECT IFNULL(a) FROM foo; -- error\n SELECT IFNULL(a, b) FROM foo; -- OK\n SELECT IFNULL(a, b, c) FROM foo; -- error\n\nIn MySQL, the `IFNULL()` function accepts strictly two arguments. So, only the `SELECT IFNULL(a, b) FROM foo;`\nquery is correct." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlSignature", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlRedundantOrderingDirectionInspection", - "shortDescription": { - "text": "Redundant ordering direction" - }, - "fullDescription": { - "text": "Reports redundant ordering directions like ASC and DESC in ORDER BY clauses. Example (MySQL): 'CREATE TABLE foo(a INT, b INT, c INT);\nSELECT * FROM foo ORDER BY a ASC, b DESC, c ASC;' The ORDER BY keyword sorts the records in the ascending order by default. So, the 'ASC' keyword for 'a' and 'c' columns is redundant.", - "markdown": "Reports redundant ordering directions like ASC and DESC in ORDER BY clauses.\n\nExample (MySQL):\n\n CREATE TABLE foo(a INT, b INT, c INT);\n SELECT * FROM foo ORDER BY a ASC, b DESC, c ASC;\n\nThe ORDER BY keyword sorts the records in the ascending order by default. So, the `ASC` keyword for `a` and\n`c` columns is redundant." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlRedundantOrderingDirection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDeprecateTypeInspection", - "shortDescription": { - "text": "Deprecated type" - }, - "fullDescription": { - "text": "Reports usages of types that are deprecated and might disappear in future versions of DBMS. Reported types: LONG in Oracle (see Deprecated and Desupported Features at docs.oracle.com). TEXT, NTEXT, and IMAGE in Microsoft SQL Server (see Deprecated Database Engine Features in SQL Server 2016 at docs.microsoft.com). Example (Oracle): 'CREATE TABLE ot.foo(\na NUMBER GENERATED BY DEFAULT AS IDENTITY,\nb LONG NOT NULL\n);'", - "markdown": "Reports usages of types that are deprecated and might disappear in future versions of DBMS.\n\nReported types:\n\n* LONG in Oracle (see [Deprecated\n and Desupported Features at docs.oracle.com](https://docs.oracle.com/cd/A91202_01/901_doc/server.901/a90120/ch4_dep.htm#6690)).\n* TEXT, NTEXT, and IMAGE in Microsoft SQL Server (see [Deprecated Database Engine Features in SQL Server 2016 at docs.microsoft.com](https://docs.microsoft.com/en-us/sql/database-engine/deprecated-database-engine-features-in-sql-server-2016?view=sql-server-ver15)).\n\nExample (Oracle):\n\n CREATE TABLE ot.foo(\n a NUMBER GENERATED BY DEFAULT AS IDENTITY,\n b LONG NOT NULL\n );\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDeprecateType", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlAggregatesInspection", - "shortDescription": { - "text": "Aggregate-related problems" - }, - "fullDescription": { - "text": "Reports invalid usages of SQL aggregate functions. The following situations are considered: Columns that are used in HAVING and ORDER BY clauses but are missed in GROUP BY clauses. 'CREATE TABLE foo(id INT PRIMARY KEY, a INT, b INT);\nSELECT a, MAX(b) FROM foo GROUP BY a HAVING b > 0;\nSELECT * FROM foo GROUP BY a ORDER BY b;' This rule does not apply when grouping is made by the primary key. 'SELECT * FROM foo GROUP BY id ORDER BY b;' Aggregate functions in a wrong context. Usually, you can use aggregate functions in the following contexts: a list of expressions in SELECT; in HAVING and ORDER BY sections; and other dialect-specific cases. The following queries will display an error. 'SELECT a FROM foo WHERE MAX(b) > 0;\nSELECT a FROM foo GROUP BY MAX(a);' Nested calls of aggregate functions. 'SELECT MAX(SUM(a)) FROM foo GROUP BY a;' This rule does not apply to analytic functions. The following query is valid and correct. 'SELECT MAX(SUM(a) OVER ()) FROM foo;' Usages of HAVING without aggregate functions. In this case, consider rewriting your code using the WHERE section. 'SELECT a, MAX(b) FROM foo GROUP BY a HAVING a > 0;'", - "markdown": "Reports invalid usages of SQL aggregate functions.\n\nThe following situations are considered:\n\n* Columns that are used in HAVING and ORDER BY clauses but are missed in GROUP BY clauses.\n\n CREATE TABLE foo(id INT PRIMARY KEY, a INT, b INT);\n SELECT a, MAX(b) FROM foo GROUP BY a HAVING b > 0;\n SELECT * FROM foo GROUP BY a ORDER BY b;\n\n This rule does not apply when grouping is made by the primary key.\n\n SELECT * FROM foo GROUP BY id ORDER BY b;\n\n* Aggregate functions in a wrong context. Usually, you can use aggregate functions in the following contexts: a list of expressions in\n SELECT; in HAVING and ORDER BY sections; and other dialect-specific cases. The following queries will display an error.\n\n SELECT a FROM foo WHERE MAX(b) > 0;\n SELECT a FROM foo GROUP BY MAX(a);\n\n* Nested calls of aggregate functions.\n\n SELECT MAX(SUM(a)) FROM foo GROUP BY a;\n\n This rule does not apply to analytic functions. The following query is valid and correct.\n\n SELECT MAX(SUM(a) OVER ()) FROM foo;\n\n* Usages of HAVING without aggregate functions. In this case, consider rewriting your code using the WHERE section.\n\n SELECT a, MAX(b) FROM foo GROUP BY a HAVING a > 0;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlAggregates", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlConstantExpressionInspection", - "shortDescription": { - "text": "Constant expression" - }, - "fullDescription": { - "text": "Reports conditions and expressions that are always true, false or null. Example (MySQL): 'CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\nSELECT a FROM t1 WHERE 'Cat' = 'Cat';\nSELECT a FROM t1 WHERE 'Cat' = null;' The ''Cat' = 'Cat'' is always true and will be reported. The ''Cat' = null' is always null and will be reported.", - "markdown": "Reports conditions and expressions that are always true, false or null.\n\nExample (MySQL):\n\n CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\n SELECT a FROM t1 WHERE 'Cat' = 'Cat';\n SELECT a FROM t1 WHERE 'Cat' = null;\n\nThe `'Cat' = 'Cat'` is always true and will be reported.\n\nThe `'Cat' = null` is always null and will be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlConstantExpression", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlMissingColumnAliasesInspection", - "shortDescription": { - "text": "Missing column aliases" - }, - "fullDescription": { - "text": "Reports queries without explicit aliases in output expressions (for example, in the SELECT statement). Example (PostgreSQL): 'CREATE TABLE foo(a INT, b INT);\n\nSELECT 1, a + 1 AS A2, MAX(b) AS M\nFROM foo;'", - "markdown": "Reports queries without explicit aliases in output expressions (for example, in the SELECT statement).\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT, b INT);\n\n SELECT 1, a + 1 AS A2, MAX(b) AS M\n FROM foo;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlMissingColumnAliases", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlAddNotNullColumnInspection", - "shortDescription": { - "text": "Adding not null column without default value" - }, - "fullDescription": { - "text": "Reports attempts to create NOT NULL columns without DEFAULT values. Example (Microsoft SQL Server): 'CREATE TABLE foo (a INT, b INT)\n\nALTER TABLE foo ADD c INT NOT NULL;' By default, a column holds NULL values. In the example, we use the NOT NULL constraint that enforces a column not to accept NULL values. If we prohibit to use NULL values, we must set the DEFAULT value that SQL can use when we create a new record. 'ALTER TABLE foo ADD c INT NOT NULL DEFAULT 42;' You can quickly add the DEFAULT value by using the Add DEFAULT value quick-fix.", - "markdown": "Reports attempts to create NOT NULL columns without DEFAULT values.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE foo (a INT, b INT)\n\n ALTER TABLE foo ADD c INT NOT NULL;\n\nBy default, a column holds NULL values. In the example, we use the NOT NULL constraint that enforces a column not to accept NULL values.\nIf we prohibit to use NULL values, we must set the DEFAULT value that SQL can use when we create a new record.\n\n ALTER TABLE foo ADD c INT NOT NULL DEFAULT 42;\n\nYou can quickly add the DEFAULT value by using the **Add DEFAULT value** quick-fix." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlAddNotNullColumn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "OraOverloadInspection", - "shortDescription": { - "text": "Overloading errors" - }, - "fullDescription": { - "text": "Reports invalid cases of subprogram overloading in Oracle. Example (Oracle): 'DECLARE\n SUBTYPE fff IS BINARY_INTEGER;\n SUBTYPE ggg IS NATURAL;\n PROCEDURE foo (a IN ggg) IS BEGIN NULL; END;\n PROCEDURE foo (a IN fff) IS BEGIN NULL; END;\nBEGIN\n NULL;\nEND;' You cannot overload subprograms which parameters differ only in subtypes. For example, you cannot overload procedures where one accepts a BINARY INTEGER parameter and the other accepts a NATURAL parameter. For more information about restrictions on procedure overloading, see Restrictions on Overloading at docs.oracle.com.", - "markdown": "Reports invalid cases of subprogram overloading in Oracle.\n\nExample (Oracle):\n\n DECLARE\n SUBTYPE fff IS BINARY_INTEGER;\n SUBTYPE ggg IS NATURAL;\n PROCEDURE foo (a IN ggg) IS BEGIN NULL; END;\n PROCEDURE foo (a IN fff) IS BEGIN NULL; END;\n BEGIN\n NULL;\n END;\n\nYou cannot overload subprograms which parameters differ only in subtypes. For example, you cannot overload procedures where one accepts a\nBINARY INTEGER parameter and the other accepts a NATURAL parameter. For more information about restrictions on procedure overloading,\nsee [Restrictions on Overloading at docs.oracle.com](https://docs.oracle.com/cd/B19306_01/appdev.102/b14261/subprograms.htm)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlOverload", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Oracle", - "index": 63, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "OraMissingBodyInspection", - "shortDescription": { - "text": "Missing body for package/object type specification" - }, - "fullDescription": { - "text": "Reports package and object type specifications that are missing body declarations. Package specifications and object types that declare routines as well as package specifications with cursors must have body declarations where those routines and cursors are implemented. Absence of a body leads to a runtime error when routines or cursors are invoked in program code. Example (Oracle): 'CREATE OR REPLACE PACKAGE ppp IS\n FUNCTION foo(a INT) RETURN INT;\nEND;'", - "markdown": "Reports package and object type specifications that are missing body declarations.\n\nPackage specifications and object types that declare routines as well as package specifications with cursors must have body\ndeclarations where those routines and cursors are implemented. Absence of a body leads to a runtime error when routines or cursors are\ninvoked in program code.\n\nExample (Oracle):\n\n CREATE OR REPLACE PACKAGE ppp IS\n FUNCTION foo(a INT) RETURN INT;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlMissingBody", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Oracle", - "index": 63, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "OraUnmatchedForwardDeclarationInspection", - "shortDescription": { - "text": "Forward declaration without definition" - }, - "fullDescription": { - "text": "Reports declarations of procedures and functions that are missing their implementation in code. In Oracle, you can declare a procedure or a function without its body, and write the implementation later. The inspection will report names of such procedures or functions that are left without implementation. Example (Oracle): 'DECLARE PROCEDURE foo(a int, b varchar2);\nBEGIN\n NULL;\nEND;' The 'foo' procedure is declared but is missing implementation. We can add the implementation to get rid of the error. 'DECLARE PROCEDURE foo(a int, b varchar2);\n PROCEDURE foo(a int, b varchar2) IS\nBEGIN\n NULL;\nEND;\nBEGIN\n NULL;\nEND;'", - "markdown": "Reports declarations of procedures and functions that are missing their implementation in code.\n\nIn Oracle, you can declare a procedure or a function without its body, and write the implementation later. The inspection will report names\nof such procedures or functions that are left without implementation.\n\nExample (Oracle):\n\n DECLARE PROCEDURE foo(a int, b varchar2);\n BEGIN\n NULL;\n END;\n\nThe `foo` procedure is declared but is missing implementation. We can add the implementation to get rid of the error.\n\n DECLARE PROCEDURE foo(a int, b varchar2);\n PROCEDURE foo(a int, b varchar2) IS\n BEGIN\n NULL;\n END;\n BEGIN\n NULL;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "SqlUnmatchedForwardDeclaration", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "Oracle", - "index": 63, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MongoJSExtResolveInspection", - "shortDescription": { - "text": "Resolution problems" - }, - "fullDescription": { - "text": "Reports unresolved references in MongoDB and JavaScript code.", - "markdown": "Reports unresolved references in MongoDB and JavaScript code." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSResolve", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlGotoInspection", - "shortDescription": { - "text": "Usages of GOTO statements" - }, - "fullDescription": { - "text": "Reports usages of backward GOTO statements and GOTO statements used to exit a loop. The extensive use of GOTO statements is generally not recommended. For details, see GOTO statement in SQL procedures at ibm.com. Instead of jumping back to a previous statement using GOTO, consider using a loop. Instead of exiting the WHILE loop with GOTO, consider using other control-of-flow statements (for example, RETURN or BREAK). Example (Oracle): 'CREATE PROCEDURE test(n INT) AS\nDECLARE\n x INT;\nBEGIN\n x := 0;\n GOTO a;\n <> x := 1;\n IF (n = 0) THEN\n GOTO a;\n END IF;\n WHILE TRUE\n LOOP\n GOTO b;\n END LOOP;\n <> x := 3;\nEND;'", - "markdown": "Reports usages of backward GOTO statements and GOTO statements used to exit a loop.\n\nThe extensive use of GOTO statements is generally\nnot recommended. For details, see [GOTO statement in\nSQL\nprocedures at ibm.com](https://www.ibm.com/docs/no/db2/11.5?topic=procedures-goto-statement-in-sql).\n\nInstead of jumping back to a previous statement using GOTO, consider using a loop.\n\nInstead of exiting the WHILE loop with GOTO, consider using other control-of-flow statements (for example, RETURN or BREAK).\n\nExample (Oracle):\n\n CREATE PROCEDURE test(n INT) AS\n DECLARE\n x INT;\n BEGIN\n x := 0;\n GOTO a;\n <> x := 1;\n IF (n = 0) THEN\n GOTO a;\n END IF;\n WHILE TRUE\n LOOP\n GOTO b;\n END LOOP;\n <> x := 3;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlGoto", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlWithoutWhereInspection", - "shortDescription": { - "text": "Delete or update statement without where clauses" - }, - "fullDescription": { - "text": "Reports usages of DELETE or UPDATE statements without WHERE clauses. Without WHERE clauses, DELETE drops all the data from the table, and UPDATE overwrites values for all the table rows. Example (MySQL): 'CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\nupdate t1 set a = 'Smith';\ndelete from t1;'", - "markdown": "Reports usages of DELETE or UPDATE statements without WHERE clauses.\n\nWithout WHERE clauses, DELETE drops all the data from the table, and UPDATE overwrites values for all the table rows.\n\nExample (MySQL):\n\n CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\n update t1 set a = 'Smith';\n delete from t1;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlWithoutWhere", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlAmbiguousColumnInspection", - "shortDescription": { - "text": "Ambiguous reference" - }, - "fullDescription": { - "text": "Reports columns that have identical names but belong to different tables. Example (MySQL): 'CREATE TABLE foo(id INT PRIMARY KEY);\nCREATE TABLE bar(id INT PRIMARY KEY);\n\nSELECT foo.id, bar.id FROM foo, bar WHERE id > 0;' The 'id' column appears in 'foo' and 'bar' tables. You need to qualify the column name to make the query correct. 'SELECT foo.id, bar.id FROM foo, bar WHERE foo.id > 0;'", - "markdown": "Reports columns that have identical names but belong to different tables.\n\nExample (MySQL):\n\n CREATE TABLE foo(id INT PRIMARY KEY);\n CREATE TABLE bar(id INT PRIMARY KEY);\n\n SELECT foo.id, bar.id FROM foo, bar WHERE id > 0;\n\nThe `id` column appears in `foo` and `bar` tables. You need to qualify the column name to\nmake the query correct.\n\n SELECT foo.id, bar.id FROM foo, bar WHERE foo.id > 0;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlAmbiguousColumn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlUnusedCteInspection", - "shortDescription": { - "text": "Unused common table expression" - }, - "fullDescription": { - "text": "Reports unused common table expressions (CTE) inside the query. Example (PostgreSQL): 'CREATE TABLE foo(a INT);\n\nWITH a AS (SELECT 1 AS x FROM foo)\nSELECT 1 + 2 FROM foo;' By using WITH, we create a temporary named result set with the name 'a', also known as a common table expression (CTE). But we do not use this CTE later in the code. The unused CTE is greyed out.", - "markdown": "Reports unused common table expressions (CTE) inside the query.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT);\n\n WITH a AS (SELECT 1 AS x FROM foo)\n SELECT 1 + 2 FROM foo;\n\nBy using WITH, we create a temporary named result set with the name `a`, also known as a common table expression (CTE). But\nwe do not use this CTE later in the code. The unused CTE is greyed out." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlUnusedCte", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MongoJSResolveInspection", - "shortDescription": { - "text": "Resolution problems" - }, - "fullDescription": { - "text": "Reports unresolved references in MongoDB and JavaScript code. Example: 'db\nuse foo\n -- a reference to a non-existing collection\ndb.non_existing_collection\ndb['non_existing_collection']\ndb['non_existing_collection'].find().hasNext()' The 'non_existing_collection' collection does not exist in the database and will be reported.", - "markdown": "Reports unresolved references in MongoDB and JavaScript code.\n\nExample:\n\n db\n use foo\n -- a reference to a non-existing collection\n db.non_existing_collection\n db['non_existing_collection']\n db['non_existing_collection'].find().hasNext()\n\nThe `non_existing_collection` collection does not exist in the database and will be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSResolve", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlNullComparisonInspection", - "shortDescription": { - "text": "Null comparison" - }, - "fullDescription": { - "text": "Reports comparisons with NULL that can be replaced with IS NULL or IS NOT NULL operators. Example (Microsoft SQL Server): 'CREATE TABLE foo ( id int );\n\nSELECT * FROM foo WHERE NULL = NULL;\nSELECT * FROM foo WHERE NULL != NULL;' The 'NULL = NULL' can be replaced with 'IS NULL', the 'NULL != NULL' comparison with 'IS NOT NULL'. To do this replacement, you can use Use IS NULL operator or Use IS NOT NULL operator quick-fixes. 'SELECT * FROM foo WHERE NULL IS NULL;\nSELECT * FROM foo WHERE NULL IS NOT NULL;'", - "markdown": "Reports comparisons with NULL that can be replaced with IS NULL or IS NOT NULL operators.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE foo ( id int );\n\n SELECT * FROM foo WHERE NULL = NULL;\n SELECT * FROM foo WHERE NULL != NULL;\n\nThe `NULL = NULL` can be replaced with `IS NULL`, the `NULL != NULL` comparison\nwith `IS NOT NULL`. To do this replacement, you can use **Use IS NULL operator** or **Use IS NOT NULL operator**\nquick-fixes.\n\n SELECT * FROM foo WHERE NULL IS NULL;\n SELECT * FROM foo WHERE NULL IS NOT NULL;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlNullComparison", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.properties", - "version": "232.9876", - "rules": [ - { - "id": "DuplicatePropertyInspection", - "shortDescription": { - "text": "Duplicate property" - }, - "fullDescription": { - "text": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values. Example: 'property1=value;\nproperty2=value;' The Options list allows selecting the area in which the inspection should search for duplicates.", - "markdown": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values.\n\nExample:\n\n\n property1=value;\n property2=value;\n\nThe **Options** list allows selecting the area in which the inspection should search for duplicates." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DuplicatePropertyInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UseEllipsisInPropertyInspection", - "shortDescription": { - "text": "Three dot characters instead of the ellipsis" - }, - "fullDescription": { - "text": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files.", - "markdown": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UseEllipsisInPropertyInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "AlphaUnsortedPropertiesFile", - "shortDescription": { - "text": "Properties file or resource bundle is alphabetically unsorted" - }, - "fullDescription": { - "text": "Reports alphabetically unsorted resource bundles or .properties files.", - "markdown": "Reports alphabetically unsorted resource bundles or .properties files." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "AlphaUnsortedPropertiesFile", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TrailingSpacesInProperty", - "shortDescription": { - "text": "Trailing spaces in property" - }, - "fullDescription": { - "text": "Reports properties whose keys or values end with a whitespace.", - "markdown": "Reports properties whose keys or values end with a whitespace." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TrailingSpacesInProperty", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnusedProperty", - "shortDescription": { - "text": "Unused property" - }, - "fullDescription": { - "text": "Reports properties that are not referenced outside of the .properties file they are contained in.", - "markdown": "Reports properties that are not referenced outside of the .properties file they are contained in." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnusedProperty", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "WrongPropertyKeyValueDelimiter", - "shortDescription": { - "text": "Property key/value delimiter doesn't match code style settings" - }, - "fullDescription": { - "text": "Reports properties in which key or value delimiters do not match code style settings.", - "markdown": "Reports properties in which key or value delimiters do not match code style settings." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "WrongPropertyKeyValueDelimiter", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "HtmlTools", - "version": "232.9876", - "rules": [ - { - "id": "HtmlRequiredAltAttribute", - "shortDescription": { - "text": "Missing required 'alt' attribute" - }, - "fullDescription": { - "text": "Reports a missing 'alt' attribute in a 'img' or 'applet' tag or in a 'area' element of an image map. Suggests adding a required attribute with a text alternative for the contents of the tag. Based on WCAG 2.0: H24, H35, H36, H37.", - "markdown": "Reports a missing `alt` attribute in a `img` or `applet` tag or in a `area` element of an image map. Suggests adding a required attribute with a text alternative for the contents of the tag. Based on WCAG 2.0: [H24](https://www.w3.org/TR/WCAG20-TECHS/H24.html), [H35](https://www.w3.org/TR/WCAG20-TECHS/H35.html), [H36](https://www.w3.org/TR/WCAG20-TECHS/H36.html), [H37](https://www.w3.org/TR/WCAG20-TECHS/H37.html)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlRequiredAltAttribute", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 25, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlFormInputWithoutLabel", - "shortDescription": { - "text": "Missing associated label" - }, - "fullDescription": { - "text": "Reports a form element ('input', 'textarea', or 'select') without an associated label. Suggests creating a new label. Based on WCAG 2.0: H44.", - "markdown": "Reports a form element (`input`, `textarea`, or `select`) without an associated label. Suggests creating a new label. Based on WCAG 2.0: [H44](https://www.w3.org/TR/WCAG20-TECHS/H44.html). " - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlFormInputWithoutLabel", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 25, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlRequiredTitleAttribute", - "shortDescription": { - "text": "Missing required 'title' attribute" - }, - "fullDescription": { - "text": "Reports a missing title attribute 'frame', 'iframe', 'dl', and 'a' tags. Suggests adding a title attribute. Based on WCAG 2.0: H33, H40, and H64.", - "markdown": "Reports a missing title attribute `frame`, `iframe`, `dl`, and `a` tags. Suggests adding a title attribute. Based on WCAG 2.0: [H33](https://www.w3.org/TR/WCAG20-TECHS/H33.html), [H40](https://www.w3.org/TR/WCAG20-TECHS/H40.html), and [H64](https://www.w3.org/TR/WCAG20-TECHS/H64.html)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HtmlRequiredTitleAttribute", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 25, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlDeprecatedTag", - "shortDescription": { - "text": "Obsolete tag" - }, - "fullDescription": { - "text": "Reports an obsolete HTML5 tag. Suggests replacing the obsolete tag with a CSS or another tag.", - "markdown": "Reports an obsolete HTML5 tag. Suggests replacing the obsolete tag with a CSS or another tag." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlDeprecatedTag", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckImageSize", - "shortDescription": { - "text": "Mismatched image size" - }, - "fullDescription": { - "text": "Reports a 'width' and 'height' attribute value of a 'img' tag that is different from the actual width and height of the referenced image.", - "markdown": "Reports a `width` and `height` attribute value of a `img` tag that is different from the actual width and height of the referenced image." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CheckImageSize", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlRequiredSummaryAttribute", - "shortDescription": { - "text": "Missing required 'summary' attribute" - }, - "fullDescription": { - "text": "Reports a missing 'summary' attribute in a 'table' tag. Suggests adding a'summary' attribute. Based on WCAG 2.0: H73.", - "markdown": "Reports a missing `summary` attribute in a `table` tag. Suggests adding a`summary` attribute. Based on WCAG 2.0: [H73](https://www.w3.org/TR/WCAG20-TECHS/H73.html)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HtmlRequiredSummaryAttribute", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 25, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlRequiredLangAttribute", - "shortDescription": { - "text": "Missing required 'lang' attribute" - }, - "fullDescription": { - "text": "Reports a missing 'lang' (or 'xml:lang') attribute in a 'html' tag. Suggests adding a required attribute to state the default language of the document. Based on WCAG 2.0: H57.", - "markdown": "Reports a missing `lang` (or `xml:lang`) attribute in a `html` tag. Suggests adding a required attribute to state the default language of the document. Based on WCAG 2.0: [H57](https://www.w3.org/TR/WCAG20-TECHS/H57.html)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlRequiredLangAttribute", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 25, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlNonExistentInternetResource", - "shortDescription": { - "text": "Unresolved web link" - }, - "fullDescription": { - "text": "Reports an unresolved web link. Works by making network requests in the background.", - "markdown": "Reports an unresolved web link. Works by making network requests in the background." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlNonExistentInternetResource", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlRequiredTitleElement", - "shortDescription": { - "text": "Missing required 'title' element" - }, - "fullDescription": { - "text": "Reports a missing 'title' element inside a 'head' section. Suggests adding a 'title' element. The title should describe the document. Based on WCAG 2.0: H25.", - "markdown": "Reports a missing `title` element inside a `head` section. Suggests adding a `title` element. The title should describe the document. Based on WCAG 2.0: [H25](https://www.w3.org/TR/WCAG20-TECHS/H25.html)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlRequiredTitleElement", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 25, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlDeprecatedAttribute", - "shortDescription": { - "text": "Obsolete attribute" - }, - "fullDescription": { - "text": "Reports an obsolete HTML5 attribute.", - "markdown": "Reports an obsolete HTML5 attribute." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlDeprecatedAttribute", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlPresentationalElement", - "shortDescription": { - "text": "Presentational tag" - }, - "fullDescription": { - "text": "Reports a presentational HTML tag. Suggests replacing the presentational tag with a CSS or another tag.", - "markdown": "Reports a presentational HTML tag. Suggests replacing the presentational tag with a CSS or another tag." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HtmlPresentationalElement", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.css", - "version": "232.9876", - "rules": [ - { - "id": "CssInvalidHtmlTagReference", - "shortDescription": { - "text": "Invalid type selector" - }, - "fullDescription": { - "text": "Reports a CSS type selector that matches an unknown HTML element.", - "markdown": "Reports a CSS [type selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Type_selectors) that matches an unknown HTML element." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssInvalidHtmlTagReference", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidFunction", - "shortDescription": { - "text": "Invalid function" - }, - "fullDescription": { - "text": "Reports an unknown CSS function or an incorrect function parameter.", - "markdown": "Reports an unknown [CSS function](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Functions) or an incorrect function parameter." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidFunction", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssMissingSemicolon", - "shortDescription": { - "text": "Missing semicolon" - }, - "fullDescription": { - "text": "Reports a missing semicolon at the end of a declaration.", - "markdown": "Reports a missing semicolon at the end of a declaration." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssMissingSemicolon", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Code style issues", - "index": 41, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssRedundantUnit", - "shortDescription": { - "text": "Redundant measure unit" - }, - "fullDescription": { - "text": "Reports a measure unit of a zero value where units are not required by the specification. Example: 'width: 0px'", - "markdown": "Reports a measure unit of a zero value where units are not required by the specification.\n\n**Example:**\n\n width: 0px\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssRedundantUnit", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Code style issues", - "index": 41, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssMissingComma", - "shortDescription": { - "text": "Missing comma in selector list" - }, - "fullDescription": { - "text": "Reports a multi-line selector. Most likely this means that several single-line selectors are actually intended but a comma is missing at the end of one or several lines. Example: 'input /* comma has probably been forgotten */\n.button {\n margin: 1px;\n}'", - "markdown": "Reports a multi-line selector. Most likely this means that several single-line selectors are actually intended but a comma is missing at the end of one or several lines.\n\n**Example:**\n\n\n input /* comma has probably been forgotten */\n .button {\n margin: 1px;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssMissingComma", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Probable bugs", - "index": 49, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidPropertyValue", - "shortDescription": { - "text": "Invalid property value" - }, - "fullDescription": { - "text": "Reports an incorrect CSS property value.", - "markdown": "Reports an incorrect CSS property value." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidPropertyValue", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssBrowserCompatibilityForProperties", - "shortDescription": { - "text": "Property is incompatible with selected browsers" - }, - "fullDescription": { - "text": "Reports a CSS property that is not supported by the specified browsers. Based on the MDN Compatibility Data.", - "markdown": "Reports a CSS property that is not supported by the specified browsers. Based on the [MDN Compatibility Data](https://github.com/mdn/browser-compat-data)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssBrowserCompatibilityForProperties", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssConvertColorToHexInspection", - "shortDescription": { - "text": "Color could be replaced with #-hex" - }, - "fullDescription": { - "text": "Reports an 'rgb()', 'hsl()', or other color function. Suggests replacing a color function with an equivalent hexadecimal notation. Example: 'rgb(12, 15, 255)' After the quick-fix is applied: '#0c0fff'.", - "markdown": "Reports an `rgb()`, `hsl()`, or other color function.\n\nSuggests replacing a color function with an equivalent hexadecimal notation.\n\n**Example:**\n\n rgb(12, 15, 255)\n\nAfter the quick-fix is applied:\n\n #0c0fff.\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssConvertColorToHexInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssReplaceWithShorthandUnsafely", - "shortDescription": { - "text": "Properties may probably be replaced with a shorthand" - }, - "fullDescription": { - "text": "Reports a set of longhand CSS properties and suggests replacing an incomplete set of longhand CSS properties with a shorthand form, which is however not 100% equivalent in this case. For example, 2 properties: 'outline-color' and 'outline-style' may be replaced with a single 'outline'. Such replacement is not 100% equivalent because shorthands reset all omitted sub-values to their initial states. In this example, switching to the 'outline' shorthand means that 'outline-width' is also set to its initial value, which is 'medium'. This inspection doesn't handle full sets of longhand properties (when switching to shorthand is 100% safe). For such cases see the 'Properties may be safely replaced with a shorthand' inspection instead.", - "markdown": "Reports a set of longhand CSS properties and suggests replacing an incomplete set of longhand CSS properties with a shorthand form, which is however not 100% equivalent in this case.\n\n\nFor example, 2 properties: `outline-color` and `outline-style` may be replaced with a single `outline`.\nSuch replacement is not 100% equivalent because shorthands reset all omitted sub-values to their initial states.\nIn this example, switching to the `outline` shorthand means that `outline-width` is also set to its initial value,\nwhich is `medium`.\n\n\nThis inspection doesn't handle full sets of longhand properties (when switching to shorthand is 100% safe).\nFor such cases see the 'Properties may be safely replaced with a shorthand' inspection instead." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "CssReplaceWithShorthandUnsafely", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnknownUnit", - "shortDescription": { - "text": "Unknown unit" - }, - "fullDescription": { - "text": "Reports an unknown unit", - "markdown": "Reports an unknown unit" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssUnknownUnit", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidMediaFeature", - "shortDescription": { - "text": "Invalid media feature" - }, - "fullDescription": { - "text": "Reports an unknown CSS media feature or an incorrect media feature value.", - "markdown": "Reports an unknown [CSS media feature](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) or an incorrect media feature value." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidMediaFeature", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssConvertColorToRgbInspection", - "shortDescription": { - "text": "Color could be replaced with rgb()" - }, - "fullDescription": { - "text": "Reports an 'hsl()' or 'hwb()' color function or a hexadecimal color notation. Suggests replacing such color value with an equivalent 'rgb()' or 'rgba()' color function. Example: '#0c0fff' After the quick-fix is applied: 'rgb(12, 15, 255)'.", - "markdown": "Reports an `hsl()` or `hwb()` color function or a hexadecimal color notation.\n\nSuggests replacing such color value with an equivalent `rgb()` or `rgba()` color function.\n\n**Example:**\n\n #0c0fff\n\nAfter the quick-fix is applied:\n\n rgb(12, 15, 255).\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssConvertColorToRgbInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnusedSymbol", - "shortDescription": { - "text": "Unused selector" - }, - "fullDescription": { - "text": "Reports a CSS class or an element IDs that appears in selectors but is not used in HTML. Note that complete inspection results are available only when running it via Code | Inspect Code or Code | Analyze Code | Run Inspection by Name. Due to performance reasons, style sheet files are not inspected on the fly.", - "markdown": "Reports a CSS class or an element IDs that appears in selectors but is not used in HTML.\n\n\nNote that complete inspection results are available only when running it via **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name**.\nDue to performance reasons, style sheet files are not inspected on the fly." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssUnusedSymbol", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssDeprecatedValue", - "shortDescription": { - "text": "Deprecated value" - }, - "fullDescription": { - "text": "Reports a deprecated CSS value. Suggests replacing the deprecated value with valid equivalent.", - "markdown": "Reports a deprecated CSS value. Suggests replacing the deprecated value with valid equivalent." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssDeprecatedValue", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssNonIntegerLengthInPixels", - "shortDescription": { - "text": "Non-integer length in pixels" - }, - "fullDescription": { - "text": "Reports a non-integer length in pixels. Example: 'width: 3.14px'", - "markdown": "Reports a non-integer length in pixels.\n\n**Example:**\n\n width: 3.14px\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "CssNonIntegerLengthInPixels", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Probable bugs", - "index": 49, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidImport", - "shortDescription": { - "text": "Misplaced @import" - }, - "fullDescription": { - "text": "Reports a misplaced '@import' statement. According to the specification, '@import' rules must precede all other types of rules, except '@charset' rules.", - "markdown": "Reports a misplaced `@import` statement.\n\n\nAccording to the [specification](https://developer.mozilla.org/en-US/docs/Web/CSS/@import),\n`@import` rules must precede all other types of rules, except `@charset` rules." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssInvalidImport", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidAtRule", - "shortDescription": { - "text": "Unknown at-rule" - }, - "fullDescription": { - "text": "Reports an unknown CSS at-rule.", - "markdown": "Reports an unknown [CSS at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidAtRule", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnresolvedCustomProperty", - "shortDescription": { - "text": "Unresolved custom property" - }, - "fullDescription": { - "text": "Reports an unresolved reference to a custom property among the arguments of the 'var()' function.", - "markdown": "Reports an unresolved reference to a [custom property](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) among the arguments of the `var()` function." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssUnresolvedCustomProperty", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssOverwrittenProperties", - "shortDescription": { - "text": "Overwritten property" - }, - "fullDescription": { - "text": "Reports a duplicated CSS property within a ruleset. Respects shorthand properties. Example: '.foo {\n margin-bottom: 1px;\n margin-bottom: 1px; /* duplicates margin-bottom */\n margin: 0; /* overrides margin-bottom */\n}'", - "markdown": "Reports a duplicated CSS property within a ruleset. Respects shorthand properties.\n\n**Example:**\n\n\n .foo {\n margin-bottom: 1px;\n margin-bottom: 1px; /* duplicates margin-bottom */\n margin: 0; /* overrides margin-bottom */\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssOverwrittenProperties", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnknownTarget", - "shortDescription": { - "text": "Unresolved file reference" - }, - "fullDescription": { - "text": "Reports an unresolved file reference, for example, an incorrect path in an '@import' statement.", - "markdown": "Reports an unresolved file reference, for example, an incorrect path in an `@import` statement." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssUnknownTarget", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssNegativeValue", - "shortDescription": { - "text": "Negative property value" - }, - "fullDescription": { - "text": "Reports a negative value of a CSS property that is not expected to be less than zero, for example, object width or height.", - "markdown": "Reports a negative value of a CSS property that is not expected to be less than zero, for example, object width or height." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssNegativeValue", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssNoGenericFontName", - "shortDescription": { - "text": "Missing generic font family name" - }, - "fullDescription": { - "text": "Verifies that the 'font-family' property contains a generic font family name as a fallback alternative. Generic font family names are: 'serif', 'sans-serif', 'cursive', 'fantasy', and 'monospace'.", - "markdown": "Verifies that the [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) property contains a generic font family name as a fallback alternative.\n\n\nGeneric font family names are: `serif`, `sans-serif`, `cursive`, `fantasy`,\nand `monospace`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssNoGenericFontName", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Probable bugs", - "index": 49, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnresolvedClassInComposesRule", - "shortDescription": { - "text": "Unresolved class in 'composes' rule" - }, - "fullDescription": { - "text": "Reports a CSS class reference in the 'composes' rule that cannot be resolved to any valid target. Example: '.className {/* ... */}\n\n .otherClassName {\n composes: className;\n }'", - "markdown": "Reports a CSS class reference in the ['composes'](https://github.com/css-modules/css-modules#composition) rule that cannot be resolved to any valid target.\n\n**Example:**\n\n\n .className {/* ... */}\n\n .otherClassName {\n composes: className;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssUnresolvedClassInComposesRule", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidCharsetRule", - "shortDescription": { - "text": "Misplaced or incorrect @charset" - }, - "fullDescription": { - "text": "Reports a misplaced '@charset' at-rule or an incorrect charset value.", - "markdown": "Reports a misplaced `@charset` at-rule or an incorrect charset value." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssInvalidCharsetRule", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssReplaceWithShorthandSafely", - "shortDescription": { - "text": "Properties may be safely replaced with a shorthand" - }, - "fullDescription": { - "text": "Reports a set of longhand properties. Suggests replacing a complete set of longhand CSS properties with an equivalent shorthand form. For example, 4 properties: 'padding-top', 'padding-right', 'padding-bottom', and 'padding-left' can be safely replaced with a single 'padding' property. Note that this inspection doesn't show up if the set of longhand properties is incomplete (e.g. only 3 'padding-xxx' properties in a ruleset) because switching to a shorthand may change the result. For such cases consider the 'Properties may probably be replaced with a shorthand' inspection.", - "markdown": "Reports a set of longhand properties. Suggests replacing a complete set of longhand CSS properties with an equivalent shorthand form.\n\n\nFor example, 4 properties: `padding-top`, `padding-right`, `padding-bottom`, and\n`padding-left`\ncan be safely replaced with a single `padding` property.\n\n\nNote that this inspection doesn't show up if the set of longhand properties is incomplete\n(e.g. only 3 `padding-xxx` properties in a ruleset)\nbecause switching to a shorthand may change the result.\nFor such cases consider the 'Properties may probably be replaced with a shorthand'\ninspection." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "CssReplaceWithShorthandSafely", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnknownProperty", - "shortDescription": { - "text": "Unknown property" - }, - "fullDescription": { - "text": "Reports an unknown CSS property or a property used in a wrong context. Add the unknown property to the 'Custom CSS properties' list to skip validation.", - "markdown": "Reports an unknown CSS property or a property used in a wrong context.\n\nAdd the unknown property to the 'Custom CSS properties' list to skip validation." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssUnknownProperty", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidPseudoSelector", - "shortDescription": { - "text": "Invalid pseudo-selector" - }, - "fullDescription": { - "text": "Reports an incorrect CSS pseudo-class pseudo-element.", - "markdown": "Reports an incorrect CSS [pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes) [pseudo-element](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidPseudoSelector", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidNestedSelector", - "shortDescription": { - "text": "Invalid nested selector" - }, - "fullDescription": { - "text": "Reports a nested selector starting with an identifier or a functional notation.", - "markdown": "Reports a nested selector starting with an identifier or a functional notation." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssInvalidNestedSelector", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.plugins.dependencyAnalysis", - "version": "232.9876", - "rules": [ - { - "id": "CheckThirdPartySoftwareList", - "shortDescription": { - "text": "Check third party software list" - }, - "fullDescription": { - "text": "Check project for possible problems: user's third party software list does not match the collected project metadata", - "markdown": "Check project for possible problems: user's third party software list does not match the collected project metadata" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CheckThirdPartySoftwareList", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Dependency analysis", - "index": 36, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckDependencyLicenses", - "shortDescription": { - "text": "Check dependency licenses" - }, - "fullDescription": { - "text": "Check dependencies licenses for possible problems: missing or prohibited licenses, or other compliance issues", - "markdown": "Check dependencies licenses for possible problems: missing or prohibited licenses, or other compliance issues" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "CheckDependencyLicenses", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Dependency analysis", - "index": 36, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckModuleLicenses", - "shortDescription": { - "text": "Check module licenses" - }, - "fullDescription": { - "text": "Check module licenses for possible problems: missing licenses or other compliance issues", - "markdown": "Check module licenses for possible problems: missing licenses or other compliance issues" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CheckModuleLicenses", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Dependency analysis", - "index": 36, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.jetbrains.plugins.yaml", - "version": "232.9876", - "rules": [ - { - "id": "YAMLSchemaValidation", - "shortDescription": { - "text": "Validation by JSON Schema" - }, - "fullDescription": { - "text": "Reports inconsistencies between a YAML file and a JSON Schema if the schema is specified. Scheme example: '{\n \"properties\": {\n \"SomeNumberProperty\": {\n \"type\": \"number\"\n }\n }\n }' The following is an example with the corresponding warning: 'SomeNumberProperty: hello world'", - "markdown": "Reports inconsistencies between a YAML file and a JSON Schema if the schema is specified.\n\n**Scheme example:**\n\n\n {\n \"properties\": {\n \"SomeNumberProperty\": {\n \"type\": \"number\"\n }\n }\n }\n\n**The following is an example with the corresponding warning:**\n\n\n SomeNumberProperty: hello world\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "YAMLSchemaValidation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 37, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLIncompatibleTypes", - "shortDescription": { - "text": "Suspicious type mismatch" - }, - "fullDescription": { - "text": "Reports a mismatch between a scalar value type in YAML file and types of the values in the similar positions. Example: 'myElements:\n - value1\n - value2\n - false # <- reported, because it is a boolean value, while other values are strings'", - "markdown": "Reports a mismatch between a scalar value type in YAML file and types of the values in the similar positions.\n\n**Example:**\n\n\n myElements:\n - value1\n - value2\n - false # <- reported, because it is a boolean value, while other values are strings\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "YAMLIncompatibleTypes", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 37, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLUnresolvedAlias", - "shortDescription": { - "text": "Unresolved alias" - }, - "fullDescription": { - "text": "Reports unresolved aliases in YAML files. Example: 'some_key: *unknown_alias'", - "markdown": "Reports unresolved aliases in YAML files.\n\n**Example:**\n\n\n some_key: *unknown_alias\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "YAMLUnresolvedAlias", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 37, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLSchemaDeprecation", - "shortDescription": { - "text": "Deprecated YAML key" - }, - "fullDescription": { - "text": "Reports deprecated keys in YAML files. Deprecation is checked only if there exists a JSON schema associated with the corresponding YAML file. Note that the deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard 'deprecationMessage' extension. Scheme deprecation example: '{\n \"properties\": {\n \"SomeDeprecatedProperty\": {\n \"deprecationMessage\": \"Baz\",\n \"description\": \"Foo bar\"\n }\n }\n }' The following is an example with the corresponding warning: 'SomeDeprecatedProperty: some value'", - "markdown": "Reports deprecated keys in YAML files.\n\nDeprecation is checked only if there exists a JSON schema associated with the corresponding YAML file.\n\nNote that the deprecation mechanism is not defined in the JSON Schema specification yet,\nand this inspection uses a non-standard `deprecationMessage` extension.\n\n**Scheme deprecation example:**\n\n\n {\n \"properties\": {\n \"SomeDeprecatedProperty\": {\n \"deprecationMessage\": \"Baz\",\n \"description\": \"Foo bar\"\n }\n }\n }\n\n**The following is an example with the corresponding warning:**\n\n\n SomeDeprecatedProperty: some value\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "YAMLSchemaDeprecation", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 37, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLRecursiveAlias", - "shortDescription": { - "text": "Recursive alias" - }, - "fullDescription": { - "text": "Reports recursion in YAML aliases. Alias can't be recursive and be used inside the data referenced by a corresponding anchor. Example: 'some_key: &some_anchor\n sub_key1: value1\n sub_key2: *some_anchor'", - "markdown": "Reports recursion in YAML aliases.\n\nAlias can't be recursive and be used inside the data referenced by a corresponding anchor.\n\n**Example:**\n\n\n some_key: &some_anchor\n sub_key1: value1\n sub_key2: *some_anchor\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "YAMLRecursiveAlias", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 37, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLDuplicatedKeys", - "shortDescription": { - "text": "Duplicated YAML keys" - }, - "fullDescription": { - "text": "Reports duplicated keys in YAML files. Example: 'same_key: some value\n same_key: another value'", - "markdown": "Reports duplicated keys in YAML files.\n\n**Example:**\n\n\n same_key: some value\n same_key: another value\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "YAMLDuplicatedKeys", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 37, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLUnusedAnchor", - "shortDescription": { - "text": "Unused anchor" - }, - "fullDescription": { - "text": "Reports unused anchors. Example: 'some_key: &some_anchor\n key1: value1'", - "markdown": "Reports unused anchors.\n\n**Example:**\n\n\n some_key: &some_anchor\n key1: value1\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "YAMLUnusedAnchor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 37, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.jetbrains.security.package-checker", - "version": "232.9876", - "rules": [ - { - "id": "VulnerableLibrariesGlobal", - "shortDescription": { - "text": "Vulnerable imported dependency" - }, - "fullDescription": { - "text": "Reports vulnerabilities in Gradle and Maven dependencies imported into your project. A full list of Gradle and Maven dependencies is shown in the Project tool window under External Libraries. Fixing the reported problems helps prevent your software from being compromised by an attacker. To solve a problem, you can update to a version where the vulnerability is fixed (if available) or switch to a dependency that doesn't have the vulnerability. The quick-fixes available may suggest updating to a safe version or visiting the Checkmarx website to learn more about a particular vulnerability. Vulnerability data provided by Checkmarx (c).", - "markdown": "Reports vulnerabilities in Gradle and Maven dependencies imported into your project.\nA full list of Gradle and Maven dependencies is shown in the Project tool window under External Libraries.\n\nFixing the reported problems helps prevent your software from being compromised by an attacker.\n\nTo solve a problem, you can update to a version where the vulnerability is fixed (if available) or switch to a dependency that doesn't have the vulnerability.\n\nThe quick-fixes available may suggest updating to a safe version or visiting the Checkmarx website to learn more about a particular vulnerability.\n\nVulnerability data provided by [Checkmarx](https://checkmarx.com/) (c)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VulnerableLibrariesGlobal", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Security", - "index": 40, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VulnerableLibrariesLocal", - "shortDescription": { - "text": "Vulnerable declared dependency" - }, - "fullDescription": { - "text": "Reports vulnerabilities in Gradle, Maven, NPM and PyPI dependencies declared in your project. A full list of Gradle and Maven dependencies is shown in the Project tool window under External Libraries. Fixing the reported problems helps prevent your software from being compromised by an attacker. To solve a problem, you can update to a version where the vulnerability is fixed (if available) or switch to a dependency that doesn't have the vulnerability. The quick-fixes available may suggest updating to a safe version or visiting the Checkmarx website to learn more about a particular vulnerability. Vulnerability data provided by Checkmarx (c).", - "markdown": "Reports vulnerabilities in Gradle, Maven, NPM and PyPI dependencies declared in your project.\nA full list of Gradle and Maven dependencies is shown in the Project tool window under External Libraries.\n\nFixing the reported problems helps prevent your software from being compromised by an attacker.\n\nTo solve a problem, you can update to a version where the vulnerability is fixed (if available) or switch to a dependency that doesn't have the vulnerability.\n\nThe quick-fixes available may suggest updating to a safe version or visiting the Checkmarx website to learn more about a particular vulnerability.\n\nVulnerability data provided by [Checkmarx](https://checkmarx.com/) (c)." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "VulnerableLibrariesLocal", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Security", - "index": 40, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.jetbrains.plugins.less", - "version": "232.9876", - "rules": [ - { - "id": "LessUnresolvedMixin", - "shortDescription": { - "text": "Unresolved mixin" - }, - "fullDescription": { - "text": "Reports a reference to a Less mixin that is not resolved. Example: '* {\n .unknown-mixin();\n}'", - "markdown": "Reports a reference to a [Less mixin](http://lesscss.org/features/#mixins-feature) that is not resolved.\n\n**Example:**\n\n\n * {\n .unknown-mixin();\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LessUnresolvedMixin", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Less", - "index": 42, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LessUnresolvedVariable", - "shortDescription": { - "text": "Unresolved variable" - }, - "fullDescription": { - "text": "Reports a reference to a Less variable that is not resolved. Example: '* {\n margin: @unknown-var;\n}'", - "markdown": "Reports a reference to a [Less variable](http://lesscss.org/features/#variables-feature) that is not resolved.\n\n**Example:**\n\n\n * {\n margin: @unknown-var;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LessUnresolvedVariable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Less", - "index": 42, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LessResolvedByNameOnly", - "shortDescription": { - "text": "Missing import" - }, - "fullDescription": { - "text": "Reports a reference to a variable or mixin that is declared in another file, which is not explicitly imported in the current file. Example: '* {\n margin: @var-in-other-file;\n}'", - "markdown": "Reports a reference to a variable or mixin that is declared in another file, which is not explicitly [imported](http://lesscss.org/features/#import-atrules-feature) in the current file.\n\n**Example:**\n\n\n * {\n margin: @var-in-other-file;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "LessResolvedByNameOnly", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Less", - "index": 42, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.intellij.intelliLang", - "version": "232.9876", - "rules": [ - { - "id": "InjectedReferences", - "shortDescription": { - "text": "Injected references" - }, - "fullDescription": { - "text": "Reports unresolved references injected by Language Injections. Example: '@Language(\"file-reference\")\n String fileName = \"/home/user/nonexistent.file\"; // highlighted if file doesn't exist'", - "markdown": "Reports unresolved references injected by [Language Injections](https://www.jetbrains.com/help/idea/using-language-injections.html).\n\nExample:\n\n\n @Language(\"file-reference\")\n String fileName = \"/home/user/nonexistent.file\"; // highlighted if file doesn't exist\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "InjectedReferences", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.jetbrains.plugins.vue", - "version": "232.9876", - "rules": [ - { - "id": "VueDataFunction", - "shortDescription": { - "text": "Data function" - }, - "fullDescription": { - "text": "Reports a Vue component data property that is not a function. Suggests wrapping an object literal with a function. When defining a component, 'data' must be declared as a function that returns the initial data object, because the same definition will be used for creating numerous instances. If a plain object is still used for 'data', that very object will be shared by reference across all instances created! With a 'data' function, every time a new instance is created we can simply call it to return a fresh copy of the initial data.", - "markdown": "Reports a Vue component [data](https://vuejs.org/v2/api/#data) property that is not a function. Suggests wrapping an object literal with a function.\n\nWhen defining a component, `data` must be declared as a function that returns the initial data object, because the same definition will be used for creating numerous instances. If a plain object is still used for `data`, that very object will be shared by reference across all instances created! With a `data` function, every time a new instance is created we can simply call it to return a fresh copy of the initial data." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VueDataFunction", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VueUnrecognizedSlot", - "shortDescription": { - "text": "Unrecognized slot" - }, - "fullDescription": { - "text": "Reports an unrecognized Vue slot.", - "markdown": "Reports an unrecognized Vue slot." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "VueUnrecognizedSlot", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VueMissingComponentImportInspection", - "shortDescription": { - "text": "Missing component import" - }, - "fullDescription": { - "text": "Reports Vue components, which require to be imported in Vue templates. It provides a quick fix to add the missing import.", - "markdown": "Reports Vue components, which require to be imported in Vue templates. It provides a quick fix to add the missing import." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VueMissingComponentImportInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VueUnrecognizedDirective", - "shortDescription": { - "text": "Unrecognized directive" - }, - "fullDescription": { - "text": "Reports an unrecognized Vue directive.", - "markdown": "Reports an unrecognized Vue directive." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VueUnrecognizedDirective", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VueDuplicateTag", - "shortDescription": { - "text": "Duplicate template/script tag" - }, - "fullDescription": { - "text": "Reports multiple usages of the 'template' or 'script' tag in a Vue file. Vue Component specification indicates that each '*.vue' file can contain at most one 'template' or 'script' block at a time.", - "markdown": "Reports multiple usages of the `template` or `script` tag in a Vue file.\n\n[Vue Component specification](https://vue-loader.vuejs.org/spec.html) indicates that each `*.vue` file can contain at most one `template` or `script` block at a time." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VueDuplicateTag", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VueDeprecatedSymbol", - "shortDescription": { - "text": "Deprecated symbol" - }, - "fullDescription": { - "text": "Reports a deprecated Vue symbol.", - "markdown": "Reports a deprecated Vue symbol." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VueDeprecatedSymbol", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.jetbrains.plugins.ini4idea", - "version": "232.9876", - "rules": [ - { - "id": "DuplicateKeyInSection", - "shortDescription": { - "text": "Duplicate directive in section" - }, - "fullDescription": { - "text": "Reports duplicate properties in the 'ini' file section.", - "markdown": "Reports duplicate properties in the `ini` file section." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DuplicateKeyInSection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Ini files", - "index": 46, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DuplicateSectionInFile", - "shortDescription": { - "text": "Duplicate section in file" - }, - "fullDescription": { - "text": "Reports duplicate sections in the 'ini' file.", - "markdown": "Reports duplicate sections in the `ini` file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DuplicateSectionInFile", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Ini files", - "index": 46, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.intellij.qodana", - "version": "232.9876", - "rules": [ - { - "id": "JsCoverageInspection", - "shortDescription": { - "text": "Check JavaScript and TypeScript source code coverage" - }, - "fullDescription": { - "text": "Reports methods, classes and files whose coverage is below a certain threshold.", - "markdown": "Reports methods, classes and files whose coverage is below a certain threshold." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsCoverageInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Code Coverage", - "index": 55, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "QodanaSanity", - "shortDescription": { - "text": "Sanity" - }, - "fullDescription": { - "text": "Reports issues essential to this file like syntax errors, unresolved methods and variables, etc...", - "markdown": "Reports issues essential to this file like syntax errors, unresolved methods and variables, etc..." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "QodanaSanity", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - "relationships": [ - { - "target": { - "id": "Qodana", - "index": 61, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "intellij.webpack", - "version": "232.9876", - "rules": [ - { - "id": "WebpackConfigHighlighting", - "shortDescription": { - "text": "Webpack config compliance with JSON Schema" - }, - "fullDescription": { - "text": "Validates options in webpack config files (which name should start with `webpack`, e.g. `webpack.config.js`) against webpack options schema. Disable this inspection to turn off validation and code completion inside the configuration object.", - "markdown": "Validates options in webpack config files (which name should start with \\`webpack\\`, e.g. \\`webpack.config.js\\`) against [webpack options schema](https://github.com/webpack/webpack/blob/master/schemas/WebpackOptions.json). \n\nDisable this inspection to turn off validation and code completion inside the configuration object." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "WebpackConfigHighlighting", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "tanvd.grazi", - "version": "232.9876", - "rules": [ - { - "id": "LanguageDetectionInspection", - "shortDescription": { - "text": "Natural language detection" - }, - "fullDescription": { - "text": "Detects natural languages and suggests enabling corresponding grammar and spelling checks.", - "markdown": "Detects natural languages and suggests enabling corresponding grammar and spelling checks." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LanguageDetectionInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - "relationships": [ - { - "target": { - "id": "Proofreading", - "index": 56, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "GrazieInspection", - "shortDescription": { - "text": "Grammar" - }, - "fullDescription": { - "text": "Reports grammar mistakes in your text. You can configure the inspection in Settings | Editor | Natural Languages | Grammar.", - "markdown": "Reports grammar mistakes in your text. You can configure the inspection in [Settings \\| Editor \\| Natural Languages \\| Grammar](settings://reference.settingsdialog.project.grazie)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "GrazieInspection", - "ideaSeverity": "GRAMMAR_ERROR", - "qodanaSeverity": "Info" - } - }, - "relationships": [ - { - "target": { - "id": "Proofreading", - "index": 56, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - } - ] - }, - "invocations": [ - { - "exitCode": 0, - "toolExecutionNotifications": [ - { - "message": { - "text": "Reporting from [\"An invalid interpreter\", \"Sanity\", \"Unresolved references\"] 'sanity' inspections was suspended due to high problems count." - }, - "level": "error" - } - ], - "executionSuccessful": true - } - ], - "language": "en-US", - "versionControlProvenance": [ - { - "repositoryUri": "https://github.com/Pale-Blue-Dot-97/Minerva.git", - "revisionId": "f82489002d81ad4e66fbe6a679decdd7689b3b44", - "branch": "v0.26-dev", - "properties": { - "repoUrl": "https://github.com/Pale-Blue-Dot-97/Minerva.git", - "lastAuthorName": "Harry", - "vcsType": "Git", - "lastAuthorEmail": "hjbaker97@gmail.com" - } - } - ], - "results": [ - { - "ruleId": "PyBroadExceptionInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Too broad exception clause", - "markdown": "Too broad exception clause" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 525, - "startColumn": 5, - "charOffset": 17381, - "charLength": 6, - "snippet": { - "text": "except" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 523, - "startColumn": 1, - "charOffset": 17293, - "charLength": 160, - "snippet": { - "text": " if \"VSCODE_PID\" in os.environ: # pragma: no cover\n return False\n except: # noqa: E722\n return False\n else: # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "7b6beeaf8484f6c73aeb2478641e552a454a5875f80dca47bdda4cc85b0151cb" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Down' object is not callable", - "markdown": "'Down' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 304, - "startColumn": 14, - "charOffset": 11040, - "charLength": 14, - "snippet": { - "text": "self.down1(x1)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 302, - "startColumn": 1, - "charOffset": 11001, - "charLength": 109, - "snippet": { - "text": "\n x1 = self.inc(x)\n x2 = self.down1(x1)\n x3 = self.down2(x2)\n x4 = self.down3(x3)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "0cfbe9d7ccf76fb41f5af230bc6347765d98d670b8c13c420a289669188ac30e" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'MinervaModel' object is not callable", - "markdown": "'MinervaModel' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/siamese.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 344, - "startColumn": 50, - "charOffset": 13820, - "charLength": 16, - "snippet": { - "text": "self.backbone(x)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 342, - "startColumn": 1, - "charOffset": 13677, - "charLength": 246, - "snippet": { - "text": " and the detached embedding vector from the :attr:`~SimSiam.backbone`.\n \"\"\"\n z: Tensor = self.proj_head(torch.flatten(self.backbone(x)[0], start_dim=1)) # type: ignore[attr-defined]\n\n p: Tensor = self.predictor(z)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "1124cb52fa27182bfe0d832719e866db8aba5dea12d071eabced0693717c3b4e" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Up' object is not callable", - "markdown": "'Up' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 311, - "startColumn": 13, - "charOffset": 11209, - "charLength": 15, - "snippet": { - "text": "self.up3(x, x2)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 309, - "startColumn": 1, - "charOffset": 11140, - "charLength": 113, - "snippet": { - "text": " x = self.up1(x5, x4)\n x = self.up2(x, x3)\n x = self.up3(x, x2)\n x = self.up4(x, x1)\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "19e9359ca0b65319572b3fc72959eab94319896d99d1d252aa159854c5b2f8b5" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Down' object is not callable", - "markdown": "'Down' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 305, - "startColumn": 14, - "charOffset": 11068, - "charLength": 14, - "snippet": { - "text": "self.down2(x2)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 303, - "startColumn": 1, - "charOffset": 11002, - "charLength": 136, - "snippet": { - "text": " x1 = self.inc(x)\n x2 = self.down1(x1)\n x3 = self.down2(x2)\n x4 = self.down3(x3)\n x5 = self.down4(x4)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "27886b4f7b6655da490b80a2e4525266277f52f45e0049fdc9d30bfaf390f78d" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Up' object is not callable", - "markdown": "'Up' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 312, - "startColumn": 13, - "charOffset": 11237, - "charLength": 15, - "snippet": { - "text": "self.up4(x, x1)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 310, - "startColumn": 1, - "charOffset": 11169, - "charLength": 122, - "snippet": { - "text": " x = self.up2(x, x3)\n x = self.up3(x, x2)\n x = self.up4(x, x1)\n\n logits: Tensor = self.outc(x)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "29217e81ab4172cbd4de13417bd9876b3d19336b469daa3e72617f9931959dca" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'OutConv' object is not callable", - "markdown": "'OutConv' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 314, - "startColumn": 26, - "charOffset": 11279, - "charLength": 12, - "snippet": { - "text": "self.outc(x)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 312, - "startColumn": 1, - "charOffset": 11225, - "charLength": 109, - "snippet": { - "text": " x = self.up4(x, x1)\n\n logits: Tensor = self.outc(x)\n\n assert isinstance(logits, Tensor)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "2973e889f0f0c4b04929a4ce406e83a3b0ab23dbf0ded97e9c092e698f3cfdc7" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'DoubleConv' object is not callable", - "markdown": "'DoubleConv' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 202, - "startColumn": 13, - "charOffset": 7415, - "charLength": 12, - "snippet": { - "text": "self.conv(x)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 200, - "startColumn": 1, - "charOffset": 7333, - "charLength": 132, - "snippet": { - "text": " x = torch.cat([x2, x1], dim=1) # type: ignore[attr-defined]\n\n x = self.conv(x)\n\n assert isinstance(x, Tensor)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "2a6ba49ce0574fbe4fda6fe3da1cdb172a6a09c4461a48b9330affc60bec875c" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Up' object is not callable", - "markdown": "'Up' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 310, - "startColumn": 13, - "charOffset": 11181, - "charLength": 15, - "snippet": { - "text": "self.up2(x, x3)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 308, - "startColumn": 1, - "charOffset": 11139, - "charLength": 113, - "snippet": { - "text": "\n x = self.up1(x5, x4)\n x = self.up2(x, x3)\n x = self.up3(x, x2)\n x = self.up4(x, x1)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "2f52edd21b1b317aa3302a88c4cb770c199dc102639203709019207fc569a96d" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Down' object is not callable", - "markdown": "'Down' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 307, - "startColumn": 14, - "charOffset": 11124, - "charLength": 14, - "snippet": { - "text": "self.down4(x4)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 305, - "startColumn": 1, - "charOffset": 11055, - "charLength": 113, - "snippet": { - "text": " x3 = self.down2(x2)\n x4 = self.down3(x3)\n x5 = self.down4(x4)\n\n x = self.up1(x5, x4)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "4156f68b4071f98d60b2328a569f63ba89af1044feaf2a78bfde60bf7dad82c2" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'ResNet' object is not callable", - "markdown": "'ResNet' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/resnet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 448, - "startColumn": 75, - "charOffset": 20639, - "charLength": 37, - "snippet": { - "text": "self.network(\n x\n )" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 446, - "startColumn": 1, - "charOffset": 20440, - "charLength": 291, - "snippet": { - "text": " :class:`~torch.Tensor` of the likelihoods the network places on the input ``x`` being of each class.\n \"\"\"\n z: Union[Tensor, Tuple[Tensor, Tensor, Tensor, Tensor, Tensor]] = self.network(\n x\n )\n if isinstance(z, Tensor):\n return z" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "4a8283fabacca2bd59d508e1a5bc0ff67c9c106d3a45865f3183262470786be8" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'DCN' object is not callable", - "markdown": "'DCN' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/fcn.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 152, - "startColumn": 13, - "charOffset": 6798, - "charLength": 15, - "snippet": { - "text": "self.decoder(z)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 150, - "startColumn": 1, - "charOffset": 6745, - "charLength": 106, - "snippet": { - "text": " \"\"\"\n z = self.backbone(x)\n z = self.decoder(z)\n\n assert isinstance(z, Tensor)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "5378765acbfd976ef1ad530652c010dd7c2d59d87b199c4b0c6554b0f5b04c37" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'MinervaModel' object is not callable", - "markdown": "'MinervaModel' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/siamese.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 205, - "startColumn": 35, - "charOffset": 8400, - "charLength": 16, - "snippet": { - "text": "self.backbone(x)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 203, - "startColumn": 1, - "charOffset": 8247, - "charLength": 225, - "snippet": { - "text": " :attr:`~SimCLR.proj_head` and the detached embedding vector from the :attr:`~SimCLR.backbone`.\n \"\"\"\n f: Tensor = torch.flatten(self.backbone(x)[0], start_dim=1)\n g: Tensor = self.proj_head(f)\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "58f4dd0802f21949ca466a580bca8b85d0a8a0161d3f92e7889c275a2256c515" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'MinervaModel' object is not callable", - "markdown": "'MinervaModel' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 424, - "startColumn": 30, - "charOffset": 16362, - "charLength": 16, - "snippet": { - "text": "self.backbone(x)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 422, - "startColumn": 1, - "charOffset": 16256, - "charLength": 182, - "snippet": { - "text": " \"\"\"\n # Output tensors from the residual blocks of the resnet.\n x4, x3, x2, x1, x0 = self.backbone(x)\n\n # Concats and upsamples the outputs of the resnet." - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "709fffd3eb539717db9da87f2252888a58796d8a570f4426017061193319f525" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Up' object is not callable", - "markdown": "'Up' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 429, - "startColumn": 13, - "charOffset": 16508, - "charLength": 15, - "snippet": { - "text": "self.up3(x, x1)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 427, - "startColumn": 1, - "charOffset": 16439, - "charLength": 193, - "snippet": { - "text": " x = self.up1(x4, x3)\n x = self.up2(x, x2)\n x = self.up3(x, x1)\n\n # Add the upsampled and deconv tensor to the output of the input convolutional layer of the resnet." - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "c39bcc4eac07fa5be31a5a11c2e704a28f811eb2b1b764498e1ea09321c4a29f" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Up' object is not callable", - "markdown": "'Up' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 309, - "startColumn": 13, - "charOffset": 11152, - "charLength": 16, - "snippet": { - "text": "self.up1(x5, x4)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 307, - "startColumn": 1, - "charOffset": 11111, - "charLength": 113, - "snippet": { - "text": " x5 = self.down4(x4)\n\n x = self.up1(x5, x4)\n x = self.up2(x, x3)\n x = self.up3(x, x2)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "d29e93ca2da1f0c64e309da75d884c11af7817ff50ffdee484067d575b7f8bde" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'OutConv' object is not callable", - "markdown": "'OutConv' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 440, - "startColumn": 26, - "charOffset": 16919, - "charLength": 12, - "snippet": { - "text": "self.outc(x)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 438, - "startColumn": 1, - "charOffset": 16808, - "charLength": 166, - "snippet": { - "text": "\n # Reduces the latent channels to the number of classes for the ouput tensor.\n logits: Tensor = self.outc(x)\n\n assert isinstance(logits, Tensor)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "d6edff456930d9ea6b9bc84ab152366e42ceb540838dedd5d583275cc9ef3d33" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'MinervaModel' object is not callable", - "markdown": "'MinervaModel' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/fcn.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 151, - "startColumn": 13, - "charOffset": 6769, - "charLength": 16, - "snippet": { - "text": "self.backbone(x)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 149, - "startColumn": 1, - "charOffset": 6689, - "charLength": 125, - "snippet": { - "text": " each pixel input ``x`` being of that class.\n \"\"\"\n z = self.backbone(x)\n z = self.decoder(z)\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "db121cb249d30be27814564a42308ed2077ad10460c975599510489c634aee58" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Down' object is not callable", - "markdown": "'Down' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 306, - "startColumn": 14, - "charOffset": 11096, - "charLength": 14, - "snippet": { - "text": "self.down3(x3)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 304, - "startColumn": 1, - "charOffset": 11027, - "charLength": 112, - "snippet": { - "text": " x2 = self.down1(x1)\n x3 = self.down2(x2)\n x4 = self.down3(x3)\n x5 = self.down4(x4)\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "df19ec32894eb48db2bf351124ea3f28443a9df187cb1f57b31d8f07dc64f956" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Up' object is not callable", - "markdown": "'Up' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 428, - "startColumn": 13, - "charOffset": 16480, - "charLength": 15, - "snippet": { - "text": "self.up2(x, x2)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 426, - "startColumn": 1, - "charOffset": 16380, - "charLength": 144, - "snippet": { - "text": " # Concats and upsamples the outputs of the resnet.\n x = self.up1(x4, x3)\n x = self.up2(x, x2)\n x = self.up3(x, x1)\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "edd8949249b4ff954ccacb43d845a8811386abd74838851febf3160a381cab40" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Up' object is not callable", - "markdown": "'Up' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 427, - "startColumn": 13, - "charOffset": 16451, - "charLength": 16, - "snippet": { - "text": "self.up1(x4, x3)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 425, - "startColumn": 1, - "charOffset": 16379, - "charLength": 144, - "snippet": { - "text": "\n # Concats and upsamples the outputs of the resnet.\n x = self.up1(x4, x3)\n x = self.up2(x, x2)\n x = self.up3(x, x1)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "eeb2adda823e89a8c681570e1e5d6566d3a72a5990da2c441e924af12994b11a" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCallingNonCallableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'DoubleConv' object is not callable", - "markdown": "'DoubleConv' object is not callable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 303, - "startColumn": 14, - "charOffset": 11015, - "charLength": 11, - "snippet": { - "text": "self.inc(x)" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 301, - "startColumn": 1, - "charOffset": 10989, - "charLength": 93, - "snippet": { - "text": " \"\"\"\n\n x1 = self.inc(x)\n x2 = self.down1(x1)\n x3 = self.down2(x2)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "fbd1c342346ff42318114b84df313d0fedf950c924a671057522c14aa4d58876" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyIncorrectDocstringInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Missing parameter cls in docstring", - "markdown": "Missing parameter cls in docstring" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 301, - "startColumn": 17, - "charOffset": 10701, - "charLength": 3, - "snippet": { - "text": "cls" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 299, - "startColumn": 1, - "charOffset": 10683, - "charLength": 182, - "snippet": { - "text": "\n\ndef tg_to_torch(cls, keys: Optional[Sequence[str]] = None):\n \"\"\"Ensures wrapped transform can handle both :class:`~torch.Tensor` and :mod:`torchgeo` style :class:`dict` inputs.\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "3d314f58842c9c99fcfda2b8be565ef6266060f7302721ab56f64be4cbeeaf03" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyIncorrectDocstringInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Missing parameter _testing in docstring", - "markdown": "Missing parameter _testing in docstring" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1646, - "startColumn": 5, - "charOffset": 57017, - "charLength": 22, - "snippet": { - "text": "_testing: bool = False" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1644, - "startColumn": 1, - "charOffset": 56948, - "charLength": 182, - "snippet": { - "text": " env_name: str = \"env\",\n host_num: Union[str, int] = 6006,\n _testing: bool = False,\n) -> Optional[int]:\n \"\"\"Runs the :mod:`TensorBoard` logs and hosts on a local webpage." - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "9394196b9aaacc9f8371e8f45a6a4ba35b55a070b98693265fb8a43d16986c7c" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyPep8NamingInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "CamelCase variable imported as constant", - "markdown": "CamelCase variable imported as constant" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/trainer.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 66, - "startColumn": 58, - "charOffset": 2705, - "charLength": 3, - "snippet": { - "text": "DDP" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 64, - "startColumn": 1, - "charOffset": 2587, - "charLength": 162, - "snippet": { - "text": "from torch import Tensor\nfrom torch.nn.modules import Module\nfrom torch.nn.parallel import DistributedDataParallel as DDP\nfrom torch.utils.data import DataLoader\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "18fadfd07813c24d18234568648f6b8710e56b5434399a407c380febd2b7c943" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyPep8NamingInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Lowercase variable imported as non-lowercase", - "markdown": "Lowercase variable imported as non-lowercase" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 166, - "startColumn": 36, - "charOffset": 5914, - "charLength": 1, - "snippet": { - "text": "F" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 164, - "startColumn": 1, - "charOffset": 5812, - "charLength": 171, - "snippet": { - "text": "from tabulate import tabulate\nfrom torch import LongTensor, Tensor\nfrom torch.nn import functional as F\nfrom torch.nn.modules import Module\nfrom torch.types import _device" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "1ad04cc5c56a238fe61cd39cf4599baecff1d4f0239e96b92183768f65ff5d9b" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyPep8NamingInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Lowercase variable imported as non-lowercase", - "markdown": "Lowercase variable imported as non-lowercase" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/unet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 57, - "startColumn": 31, - "charOffset": 2346, - "charLength": 1, - "snippet": { - "text": "F" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 55, - "startColumn": 1, - "charOffset": 2302, - "charLength": 100, - "snippet": { - "text": "\nimport torch\nimport torch.nn.functional as F\nimport torch.nn.modules as nn\nfrom torch import Tensor" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "8fd630246011f5a0c017663c439dbc7f6e1a7453b09421c90330187aa0484199" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyProtectedMemberInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Access to a protected member _api of a class", - "markdown": "Access to a protected member _api of a class" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/resnet.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 55, - "startColumn": 6, - "charOffset": 2352, - "charLength": 23, - "snippet": { - "text": "torchvision.models._api" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 53, - "startColumn": 1, - "charOffset": 2286, - "charLength": 179, - "snippet": { - "text": "from torch import Tensor\nfrom torch.nn.modules import Module\nfrom torchvision.models._api import WeightsEnum\nfrom torchvision.models.resnet import BasicBlock, Bottleneck, conv1x1\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "0472c2c74b7833a451026d4b481a6631f9280b669e00a4f94029b634e200a889" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyProtectedMemberInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Access to a protected member _device of a class", - "markdown": "Access to a protected member _device of a class" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 168, - "startColumn": 25, - "charOffset": 5976, - "charLength": 7, - "snippet": { - "text": "_device" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 166, - "startColumn": 1, - "charOffset": 5879, - "charLength": 202, - "snippet": { - "text": "from torch.nn import functional as F\nfrom torch.nn.modules import Module\nfrom torch.types import _device\nfrom torchgeo.datasets.utils import BoundingBox\nfrom urllib3.exceptions import NewConnectionError" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "0f2456a8fdbed764c165244423c9057c5e152f35b1668ebf50d5b09897b6b4e9" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyProtectedMemberInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Access to a protected member _optional_import of a module", - "markdown": "Access to a protected member _optional_import of a module" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/trainer.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 514, - "startColumn": 21, - "charOffset": 25297, - "charLength": 22, - "snippet": { - "text": "utils._optional_import" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 512, - "startColumn": 1, - "charOffset": 25211, - "charLength": 154, - "snippet": { - "text": " MinervaModel: Loaded model ready for use.\n \"\"\"\n onnx_load = utils._optional_import(\n \"onnx\",\n name=\"load\"," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "4e9207c276c14d079dbc202c219df96d956816700971f3331aaf754bee81bff1" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyProtectedMemberInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Access to a protected member _print_banner of a module", - "markdown": "Access to a protected member _print_banner of a module" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/MinervaExp.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 84, - "startColumn": 5, - "charOffset": 3249, - "charLength": 19, - "snippet": { - "text": "utils._print_banner" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 82, - "startColumn": 1, - "charOffset": 3216, - "charLength": 97, - "snippet": { - "text": "\n # Print Minerva banner.\n utils._print_banner()\n\n with runner.WandbConnectionManager():" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6164e8df1c5babd87fb4edb7e111aede2178ed7ff0f793fa8712c350d3b268e4" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyProtectedMemberInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Access to a protected member _optional_import of a module", - "markdown": "Access to a protected member _optional_import of a module" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/logger.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 80, - "startColumn": 26, - "charOffset": 3117, - "charLength": 22, - "snippet": { - "text": "utils._optional_import" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 78, - "startColumn": 1, - "charOffset": 3038, - "charLength": 174, - "snippet": { - "text": "TENSORBOARD_WRITER: Optional[Callable[..., Any]]\ntry:\n TENSORBOARD_WRITER = utils._optional_import(\n \"torch.utils.tensorboard.writer\",\n name=\"SummaryWriter\"," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "8a70c13dacc609d8b7bcf49b10acaa087d51ab2a4fcb0346cd54916c1e10e800" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyProtectedMemberInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Access to a protected member _api of a class", - "markdown": "Access to a protected member _api of a class" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/core.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 74, - "startColumn": 6, - "charOffset": 2705, - "charLength": 23, - "snippet": { - "text": "torchvision.models._api" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 72, - "startColumn": 1, - "charOffset": 2598, - "charLength": 194, - "snippet": { - "text": "from torch.nn.parallel import DataParallel, DistributedDataParallel\nfrom torch.optim import Optimizer\nfrom torchvision.models._api import WeightsEnum\n\nfrom minerva.utils.utils import func_by_str" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "8b51e20bf8f917d419736322b28dabc097341417ece59c6496a2e5c02233c33f" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyProtectedMemberInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Access to a protected member _to_tuple of a class", - "markdown": "Access to a protected member _to_tuple of a class" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/samplers.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 51, - "startColumn": 37, - "charOffset": 2452, - "charLength": 9, - "snippet": { - "text": "_to_tuple" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 49, - "startColumn": 1, - "charOffset": 2297, - "charLength": 222, - "snippet": { - "text": "from torchgeo.datasets.utils import BoundingBox\nfrom torchgeo.samplers import BatchGeoSampler, RandomGeoSampler, Units\nfrom torchgeo.samplers.utils import _to_tuple, get_random_bounding_box\n\nfrom minerva.utils import utils" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "b2c2959ec4e8ff08e68ad8c76689f48f42da52cfabcc7c68f67f75d05cd40b9f" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyProtectedMemberInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Access to a protected member _api of a class", - "markdown": "Access to a protected member _api of a class" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/TorchWeightDownloader.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 41, - "startColumn": 6, - "charOffset": 1766, - "charLength": 23, - "snippet": { - "text": "torchvision.models._api" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 39, - "startColumn": 1, - "charOffset": 1732, - "charLength": 122, - "snippet": { - "text": "from typing import Optional\n\nfrom torchvision.models._api import WeightsEnum\n\nfrom minerva.models import get_torch_weights" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "e1858e4087549f5d60c37a7259b7e8301a75bb755f8fc63ba58a31bb4d092d6b" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyProtectedMemberInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Access to a protected member _optional_import of a module", - "markdown": "Access to a protected member _optional_import of a module" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/trainer.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 98, - "startColumn": 26, - "charOffset": 3896, - "charLength": 22, - "snippet": { - "text": "utils._optional_import" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 96, - "startColumn": 1, - "charOffset": 3817, - "charLength": 174, - "snippet": { - "text": "TENSORBOARD_WRITER: Optional[Callable[..., Any]]\ntry:\n TENSORBOARD_WRITER = utils._optional_import(\n \"torch.utils.tensorboard.writer\",\n name=\"SummaryWriter\"," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "e5bba2fcf2c896511e7a99d9599db24436317e8717dfcc09b9ccda001c85ed71" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyProtectedMemberInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Access to a protected member _optional_import of a module", - "markdown": "Access to a protected member _optional_import of a module" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/trainer.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 519, - "startColumn": 19, - "charOffset": 25422, - "charLength": 22, - "snippet": { - "text": "utils._optional_import" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 517, - "startColumn": 1, - "charOffset": 25366, - "charLength": 133, - "snippet": { - "text": " package=\"onnx\",\n )\n convert = utils._optional_import(\n \"onnx2torch\",\n name=\"convert\"," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "fd498f8cd4045fab9f4f79903b9c4754be28b8afdfe713c1d8ddaf58cf2f6bdd" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyRedeclarationInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Redeclared 'step' defined above without usage", - "markdown": "Redeclared 'step' defined above without usage" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/core.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 159, - "startColumn": 9, - "charOffset": 6293, - "charLength": 4, - "snippet": { - "text": "step" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 157, - "startColumn": 1, - "charOffset": 6252, - "charLength": 79, - "snippet": { - "text": " ... # pragma: no cover\n\n def step(\n self,\n x: Tensor," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "100440895dcf044186110430da49ceb01c344a6633474c17a06526549c0153fe" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyRedeclarationInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Redeclared 'transform_coordinates' defined above without usage", - "markdown": "Redeclared 'transform_coordinates' defined above without usage" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 707, - "startColumn": 5, - "charOffset": 22626, - "charLength": 21, - "snippet": { - "text": "transform_coordinates" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 705, - "startColumn": 1, - "charOffset": 22620, - "charLength": 104, - "snippet": { - "text": "\n\ndef transform_coordinates(\n x: Union[Sequence[float], float],\n y: Union[Sequence[float], float]," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "108602141d0e61edadcb774e088b4f405e728fd1a35e5082dcb7051c5ff70e0a" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyRedeclarationInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Redeclared 'mask_transform' defined above without usage", - "markdown": "Redeclared 'mask_transform' defined above without usage" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1141, - "startColumn": 5, - "charOffset": 38475, - "charLength": 14, - "snippet": { - "text": "mask_transform" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1139, - "startColumn": 1, - "charOffset": 38469, - "charLength": 98, - "snippet": { - "text": "\n\ndef mask_transform(\n array: Union[NDArray[Any, Int], LongTensor],\n matrix: Dict[int, int]," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "3bceedfbd687fab050dd89027a5c1e27baf1d77a7243f7572e6dc404f8182b94" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyRedeclarationInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Redeclared '_optional_import' defined above without usage", - "markdown": "Redeclared '_optional_import' defined above without usage" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 466, - "startColumn": 5, - "charOffset": 15514, - "charLength": 16, - "snippet": { - "text": "_optional_import" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 464, - "startColumn": 1, - "charOffset": 15508, - "charLength": 145, - "snippet": { - "text": "\n\ndef _optional_import(\n module: str, *, name: Optional[str] = None, package: Optional[str] = None\n) -> Union[ModuleType, Callable[..., Any]]:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6925f78d42489c88685dd71f19f25f1a69600fa98d382233a3f4a5387f382067" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyRedeclarationInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Redeclared '__call__' defined above without usage", - "markdown": "Redeclared '__call__' defined above without usage" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 335, - "startColumn": 13, - "charOffset": 11943, - "charLength": 8, - "snippet": { - "text": "__call__" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 333, - "startColumn": 1, - "charOffset": 11894, - "charLength": 202, - "snippet": { - "text": " ... # pragma: no cover\n\n def __call__(self, batch: Union[Dict[str, Any], Tensor]) -> Dict[str, Any]:\n if isinstance(batch, Tensor):\n return self.wrap(batch)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6efbc109fb340bbfa1d7c1d5e6a8ebb43dd13c9c61ab75e8f4e5f653745eab11" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyRedeclarationInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Redeclared '__init__' defined above without usage", - "markdown": "Redeclared '__init__' defined above without usage" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/paired.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 95, - "startColumn": 9, - "charOffset": 3968, - "charLength": 8, - "snippet": { - "text": "__init__" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 93, - "startColumn": 1, - "charOffset": 3927, - "charLength": 127, - "snippet": { - "text": " ... # pragma: no cover\n\n def __init__(\n self,\n dataset: Union[Callable[..., GeoDataset], GeoDataset]," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "a00682d1db8abcf9858e9e8ff6058bc3c35d337bdcb30e738edfe1cff9c1091f" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyRedeclarationInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Redeclared '__call__' defined above without usage", - "markdown": "Redeclared '__call__' defined above without usage" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/transforms.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 491, - "startColumn": 9, - "charOffset": 17125, - "charLength": 8, - "snippet": { - "text": "__call__" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 489, - "startColumn": 1, - "charOffset": 17084, - "charLength": 142, - "snippet": { - "text": " ... # pragma: no cover\n\n def __call__(\n self, sample: Union[Tensor, Dict[str, Any]]\n ) -> Union[Tensor, Dict[str, Any]]:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "d593716f8b2680b54c5d806f5ab4c7351c2a7b480dc3b449711dc4d5dba05408" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyShadowingNamesInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Shadows name 'transform_params' from outer scope", - "markdown": "Shadows name 'transform_params' from outer scope" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/transforms.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 716, - "startColumn": 13, - "charOffset": 25555, - "charLength": 16, - "snippet": { - "text": "transform_params" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 714, - "startColumn": 1, - "charOffset": 25529, - "charLength": 213, - "snippet": { - "text": "\n Example:\n >>> transform_params = {\n >>> \"CenterCrop\": {\"module\": \"torchvision.transforms\", \"size\": 128},\n >>> \"RandomHorizontalFlip\": {\"module\": \"torchvision.transforms\", \"p\": 0.7}" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "5d191e4788335efc4f0b23e3edc3ef7e567f0837bdb4be55c7f5f598bbf38e2a" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyShadowingNamesInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Shadows name 'err' from outer scope", - "markdown": "Shadows name 'err' from outer scope" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/trainer.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1198, - "startColumn": 46, - "charOffset": 54453, - "charLength": 3, - "snippet": { - "text": "err" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1196, - "startColumn": 1, - "charOffset": 54343, - "charLength": 233, - "snippet": { - "text": " metrics_df.to_csv(f\"{self.exp_fn}_metrics.csv\")\n\n except (ValueError, KeyError) as err: # pragma: no cover\n self.print(err)\n self.print(\"\\n*ERROR* in saving metrics to file.\")" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "5f4cf129751d5f94b639376e05dd165f2ba8fdf5701a440aed1b012587c21d16" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyShadowingNamesInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Shadows name 'name' from outer scope", - "markdown": "Shadows name 'name' from outer scope" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/transforms.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 683, - "startColumn": 13, - "charOffset": 24218, - "charLength": 4, - "snippet": { - "text": "name" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 681, - "startColumn": 1, - "charOffset": 24192, - "charLength": 175, - "snippet": { - "text": "\n Example:\n >>> name = \"RandomResizedCrop\"\n >>> params = {\"module\": \"torchvision.transforms\", \"size\": 128}\n >>> transform = get_transform(name, params)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "7f4f024ca4fd5e9fdcd319c015fe15bed5a26395c1cc94eff00b59e4632e74ab" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyShadowingNamesInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Shadows name 'err' from outer scope", - "markdown": "Shadows name 'err' from outer scope" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/trainer.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 402, - "startColumn": 44, - "charOffset": 20868, - "charLength": 3, - "snippet": { - "text": "err" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 400, - "startColumn": 1, - "charOffset": 20711, - "charLength": 278, - "snippet": { - "text": " input_to_model=torch.rand(*input_size, device=self.device),\n )\n except RuntimeError as err: # pragma: no cover\n print(err)\n print(\"ABORT adding graph to writer\")" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "c8807cec042e2d996c893a37f30098b81bb859e694af7e3bdb6f603688b2d399" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyShadowingNamesInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Shadows name 'transform' from outer scope", - "markdown": "Shadows name 'transform' from outer scope" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/transforms.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 685, - "startColumn": 13, - "charOffset": 24328, - "charLength": 9, - "snippet": { - "text": "transform" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 683, - "startColumn": 1, - "charOffset": 24206, - "charLength": 174, - "snippet": { - "text": " >>> name = \"RandomResizedCrop\"\n >>> params = {\"module\": \"torchvision.transforms\", \"size\": 128}\n >>> transform = get_transform(name, params)\n\n Raises:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "d9f46f829599ac3e9053a875980a65bd188091c26d51bcc2d14eba71bfe81480" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyShadowingNamesInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Shadows name 'params' from outer scope", - "markdown": "Shadows name 'params' from outer scope" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/transforms.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 684, - "startColumn": 13, - "charOffset": 24257, - "charLength": 6, - "snippet": { - "text": "params" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 682, - "startColumn": 1, - "charOffset": 24193, - "charLength": 175, - "snippet": { - "text": " Example:\n >>> name = \"RandomResizedCrop\"\n >>> params = {\"module\": \"torchvision.transforms\", \"size\": 128}\n >>> transform = get_transform(name, params)\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "fee3860681fcdc20774c711da4a5c00a144128b6fbd1d3f3cc96af41216afb4a" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyTypeHintsInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types", - "markdown": "'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/fcn.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 97, - "startColumn": 30, - "charOffset": 4620, - "charLength": 15, - "snippet": { - "text": "\"32\", \"16\", \"8\"" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 95, - "startColumn": 1, - "charOffset": 4554, - "charLength": 108, - "snippet": { - "text": "\n backbone_name: str = \"ResNet18\"\n decoder_variant: Literal[\"32\", \"16\", \"8\"] = \"32\"\n\n def __init__(" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "2ed1d866d5dc3cc75fe869d8c8ea49dff49475d2a419726cad763c145bf34970" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyTypeHintsInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types", - "markdown": "'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/fcn.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 205, - "startColumn": 31, - "charOffset": 9905, - "charLength": 15, - "snippet": { - "text": "\"32\", \"16\", \"8\"" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 203, - "startColumn": 1, - "charOffset": 9805, - "charLength": 170, - "snippet": { - "text": " ) -> None:\n super(DCN, self).__init__(n_classes=n_classes)\n self.variant: Literal[\"32\", \"16\", \"8\"] = variant\n\n assert type(self.n_classes) is int" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "52dbedae57240155661b7fedbef3b3e41329c899cf5cc6acdc8f005e9b6ba49e" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyTypeHintsInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types", - "markdown": "'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/fcn.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 202, - "startColumn": 26, - "charOffset": 9780, - "charLength": 15, - "snippet": { - "text": "\"32\", \"16\", \"8\"" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 200, - "startColumn": 1, - "charOffset": 9695, - "charLength": 179, - "snippet": { - "text": " in_channel: int = 512,\n n_classes: int = 21,\n variant: Literal[\"32\", \"16\", \"8\"] = \"32\",\n ) -> None:\n super(DCN, self).__init__(n_classes=n_classes)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "5b5e41b16a5159a0fe9b280d34b360c02051b9d096ba831c6b6f961a4e2a0b17" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyTypeHintsInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types", - "markdown": "'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/transforms.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 704, - "startColumn": 53, - "charOffset": 24978, - "charLength": 5, - "snippet": { - "text": "False" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 702, - "startColumn": 1, - "charOffset": 24899, - "charLength": 217, - "snippet": { - "text": "\ndef make_transformations(\n transform_params: Union[Dict[str, Any], Literal[False]], key: Optional[str] = None\n) -> Optional[Any]:\n \"\"\"Constructs a transform or series of transforms based on parameters provided." - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "5c14208f93acb01973367275b33371a643e9a93d4e4c6df1f18a4cd57d9443fb" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyTypeHintsInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types", - "markdown": "'Literal' may be parameterized with literal ints, byte and unicode strings, bools, Enum values, None, other literal types, or type aliases to other literal types" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/factory.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 134, - "startColumn": 41, - "charOffset": 5769, - "charLength": 8, - "snippet": { - "text": "\"params\"" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 132, - "startColumn": 1, - "charOffset": 5660, - "charLength": 198, - "snippet": { - "text": " dataset_class: Callable[..., GeoDataset],\n root: str,\n subdataset_params: Dict[Literal[\"params\"], Dict[str, Any]],\n _transformations: Optional[Any],\n ) -> GeoDataset:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "cafe7885930cf65d6ac51d77d9620295c32ccaf8f87c71f5f32667d6989a2fa4" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnboundLocalVariableInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Local variable 'exit_code' might be referenced before assignment", - "markdown": "Local variable 'exit_code' might be referenced before assignment" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "scripts/MinervaPipe.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 70, - "startColumn": 22, - "charOffset": 2859, - "charLength": 9, - "snippet": { - "text": "exit_code" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 68, - "startColumn": 1, - "charOffset": 2758, - "charLength": 143, - "snippet": { - "text": " print(err)\n print(f\"Error in {key} experiment -> ABORT\")\n sys.exit(exit_code) # type: ignore\n\n print(" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "59d72ba075e94cd3afb2368d96297a36606c76a4537d2a5da1e1385e0efeb9fa" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'package' value is not used", - "markdown": "Parameter 'package' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 423, - "startColumn": 5, - "charOffset": 14911, - "charLength": 12, - "snippet": { - "text": "package: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 421, - "startColumn": 1, - "charOffset": 14885, - "charLength": 92, - "snippet": { - "text": " *,\n name: str,\n package: str,\n) -> Callable[..., Any]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "08897f3b549a7430b604b04ef801a48adb9d505f2603dc4ae35e11dcfecc19e1" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'new_crs' value is not used", - "markdown": "Parameter 'new_crs' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 675, - "startColumn": 5, - "charOffset": 21982, - "charLength": 20, - "snippet": { - "text": "new_crs: CRS = WGS84" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 673, - "startColumn": 1, - "charOffset": 21936, - "charLength": 141, - "snippet": { - "text": " y: Sequence[float],\n src_crs: CRS,\n new_crs: CRS = WGS84,\n) -> Tuple[Sequence[float], Sequence[float]]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "12345e5bb40db54040ccc0fafcbdea7a40113ad62ad85c8b8bc4e0d6ae03cdf9" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'package' value is not used", - "markdown": "Parameter 'package' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 461, - "startColumn": 5, - "charOffset": 15449, - "charLength": 12, - "snippet": { - "text": "package: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 459, - "startColumn": 1, - "charOffset": 15421, - "charLength": 86, - "snippet": { - "text": " module: str,\n *,\n package: str,\n) -> ModuleType:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "169db06317df3b142d6db176f741bd955038b1fc284434a53840974cbc7d9bdf" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'src_crs' value is not used", - "markdown": "Parameter 'src_crs' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 694, - "startColumn": 5, - "charOffset": 22354, - "charLength": 12, - "snippet": { - "text": "src_crs: CRS" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 692, - "startColumn": 1, - "charOffset": 22312, - "charLength": 127, - "snippet": { - "text": " x: float,\n y: Sequence[float],\n src_crs: CRS,\n new_crs: CRS = WGS84,\n) -> Tuple[Sequence[float], Sequence[float]]:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "177ace0b4eeb8bc971a3f3b7db20d7ad7ad4aa5c02a0863738d8add19601ab69" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'y' value is not used", - "markdown": "Parameter 'y' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 702, - "startColumn": 15, - "charOffset": 22521, - "charLength": 8, - "snippet": { - "text": "y: float" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 700, - "startColumn": 1, - "charOffset": 22470, - "charLength": 149, - "snippet": { - "text": "@overload\ndef transform_coordinates(\n x: float, y: float, src_crs: CRS, new_crs: CRS = WGS84\n) -> Tuple[float, float]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "1964fbcc1e92a75f85e6b8edac24198b02594bf8d14f36c0def06c8d5700725a" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'name' value is not used", - "markdown": "Parameter 'name' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 442, - "startColumn": 5, - "charOffset": 15178, - "charLength": 9, - "snippet": { - "text": "name: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 440, - "startColumn": 1, - "charOffset": 15150, - "charLength": 82, - "snippet": { - "text": " module: str,\n *,\n name: str,\n package: None,\n) -> Callable[..., Any]:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "1a1eb72170f4297e67fb4e2aeaece20bbd50c6a056c3cd21572dc50d2bd83b50" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'module' value is not used", - "markdown": "Parameter 'module' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 410, - "startColumn": 5, - "charOffset": 14735, - "charLength": 11, - "snippet": { - "text": "module: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 408, - "startColumn": 1, - "charOffset": 14699, - "charLength": 71, - "snippet": { - "text": "@overload\ndef _optional_import(\n module: str,\n *,\n name: None," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "28f2ef7f3044326550316ffc24ed35478947235a63c0f248b1f28d2b1e222aae" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'new_crs' value is not used", - "markdown": "Parameter 'new_crs' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 702, - "startColumn": 39, - "charOffset": 22545, - "charLength": 20, - "snippet": { - "text": "new_crs: CRS = WGS84" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 700, - "startColumn": 1, - "charOffset": 22470, - "charLength": 149, - "snippet": { - "text": "@overload\ndef transform_coordinates(\n x: float, y: float, src_crs: CRS, new_crs: CRS = WGS84\n) -> Tuple[float, float]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "29137c77de8686f0e61553686c3dcae3cfe8dd01aaaaa96c3c839e4b9f0655dd" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'params' value is not used", - "markdown": "Parameter 'params' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/metrics.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 191, - "startColumn": 9, - "charOffset": 7384, - "charLength": 8, - "snippet": { - "text": "**params" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 189, - "startColumn": 1, - "charOffset": 7293, - "charLength": 156, - "snippet": { - "text": " data_size: Tuple[int, int, int],\n model_type: str = \"segmentation\",\n **params,\n ) -> None:\n super(SPMetrics, self).__init__(" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "2a1e59ff49e63d2d131fc81d22bb52f6fe686f1ce63f874539ece41d93f9e30e" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'module' value is not used", - "markdown": "Parameter 'module' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 430, - "startColumn": 5, - "charOffset": 15016, - "charLength": 11, - "snippet": { - "text": "module: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 428, - "startColumn": 1, - "charOffset": 14980, - "charLength": 71, - "snippet": { - "text": "@overload\ndef _optional_import(\n module: str,\n *,\n name: None," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "2a540184ef5f0fca66fe0bf388e2962335826445040d8b8cfddea5bcfc900019" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'module' value is not used", - "markdown": "Parameter 'module' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 440, - "startColumn": 5, - "charOffset": 15154, - "charLength": 11, - "snippet": { - "text": "module: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 438, - "startColumn": 1, - "charOffset": 15118, - "charLength": 70, - "snippet": { - "text": "@overload\ndef _optional_import(\n module: str,\n *,\n name: str," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "2f7675b2b4a00bfa2d385511e0d4bb74b9ee13d8954407ac20485c9e94f58c2f" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'signum' value is not used", - "markdown": "Parameter 'signum' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/runner.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 335, - "startColumn": 21, - "charOffset": 10550, - "charLength": 6, - "snippet": { - "text": "signum" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 333, - "startColumn": 1, - "charOffset": 10528, - "charLength": 75, - "snippet": { - "text": "\n\ndef _handle_sigterm(signum, frame) -> None: # pragma: no cover\n pass\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "32baad8869101a640b5894c953f3344efbcd7fa51518461329717f9aa28d02bb" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'x' value is not used", - "markdown": "Parameter 'x' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 672, - "startColumn": 5, - "charOffset": 21916, - "charLength": 18, - "snippet": { - "text": "x: Sequence[float]" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 670, - "startColumn": 1, - "charOffset": 21875, - "charLength": 102, - "snippet": { - "text": "@overload\ndef transform_coordinates(\n x: Sequence[float],\n y: Sequence[float],\n src_crs: CRS," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "41807cef224cfcd757c04dbd2e6d63515b92c877c3662c50a96d10d4e69836cb" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'dataset' value is not used", - "markdown": "Parameter 'dataset' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/paired.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 88, - "startColumn": 24, - "charOffset": 3748, - "charLength": 34, - "snippet": { - "text": "dataset: Callable[..., GeoDataset]" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 86, - "startColumn": 1, - "charOffset": 3710, - "charLength": 132, - "snippet": { - "text": "\n @overload\n def __init__(self, dataset: Callable[..., GeoDataset], *args, **kwargs) -> None:\n ... # pragma: no cover\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "47bc364dfb4accd24c034021659be26811e1262ebfd7c2a6b1956455712c66f5" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'y' value is not used", - "markdown": "Parameter 'y' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 683, - "startColumn": 5, - "charOffset": 22145, - "charLength": 8, - "snippet": { - "text": "y: float" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 681, - "startColumn": 1, - "charOffset": 22090, - "charLength": 108, - "snippet": { - "text": "def transform_coordinates(\n x: Sequence[float],\n y: float,\n src_crs: CRS,\n new_crs: CRS = WGS84," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "49e750d84f2299f1739f37bc5508054d7b0b13c583dbf14ed992b9121dd400b7" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'x' value is not used", - "markdown": "Parameter 'x' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 682, - "startColumn": 5, - "charOffset": 22121, - "charLength": 18, - "snippet": { - "text": "x: Sequence[float]" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 680, - "startColumn": 1, - "charOffset": 22080, - "charLength": 92, - "snippet": { - "text": "@overload\ndef transform_coordinates(\n x: Sequence[float],\n y: float,\n src_crs: CRS," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "4d2c411319f3bca43e3bff5b39bd038b1fc845b88757cd973755cfaaf546e4a4" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'dataset' value is not used", - "markdown": "Parameter 'dataset' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/paired.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 92, - "startColumn": 24, - "charOffset": 3880, - "charLength": 19, - "snippet": { - "text": "dataset: GeoDataset" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 90, - "startColumn": 1, - "charOffset": 3842, - "charLength": 117, - "snippet": { - "text": "\n @overload\n def __init__(self, dataset: GeoDataset, *args, **kwargs) -> None:\n ... # pragma: no cover\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "4dbb7b4295b76445852c21652ba823b131eef4603a391deda0c1ce06b14efc54" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'y' value is not used", - "markdown": "Parameter 'y' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 673, - "startColumn": 5, - "charOffset": 21940, - "charLength": 18, - "snippet": { - "text": "y: Sequence[float]" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 671, - "startColumn": 1, - "charOffset": 21885, - "charLength": 118, - "snippet": { - "text": "def transform_coordinates(\n x: Sequence[float],\n y: Sequence[float],\n src_crs: CRS,\n new_crs: CRS = WGS84," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "50f0e3cecc42f0fa8f5146f91f28009cde9004647be7c99a51d13992c7029e9c" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'out_shape' value is not used", - "markdown": "Parameter 'out_shape' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/logger.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 578, - "startColumn": 9, - "charOffset": 21577, - "charLength": 43, - "snippet": { - "text": "out_shape: Optional[Tuple[int, ...]] = None" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 576, - "startColumn": 1, - "charOffset": 21520, - "charLength": 175, - "snippet": { - "text": " batch_size: int,\n n_samples: int,\n out_shape: Optional[Tuple[int, ...]] = None,\n n_classes: Optional[int] = None,\n record_int: bool = True," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "579bbe583cc35b5ecfc7b527ec95c982d949694c89b58a20f738d1bce084f199" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'frame' value is not used", - "markdown": "Parameter 'frame' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/runner.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 327, - "startColumn": 29, - "charOffset": 10349, - "charLength": 5, - "snippet": { - "text": "frame" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 325, - "startColumn": 1, - "charOffset": 10139, - "charLength": 351, - "snippet": { - "text": "# METHODS\n# =====================================================================================================================\ndef _handle_sigusr1(signum, frame) -> None: # pragma: no cover\n subprocess.Popen( # nosec B602\n shlex.split(f'scontrol requeue {os.getenv(\"SLURM_JOB_ID\")}')," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "5c7339871121f24a4922b8c5b4e3ff15d2357395d48ccd376e5b072b5a637912" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'matrix' value is not used", - "markdown": "Parameter 'matrix' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1137, - "startColumn": 39, - "charOffset": 38402, - "charLength": 22, - "snippet": { - "text": "matrix: Dict[int, int]" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1135, - "startColumn": 1, - "charOffset": 38353, - "charLength": 116, - "snippet": { - "text": "\n@overload\ndef mask_transform(array: LongTensor, matrix: Dict[int, int]) -> LongTensor:\n ... # pragma: no cover\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "60393490cf6d01fc23bc1fa780104309fcdcc0cd5e2158d7aa1d4da31e7fb9ac" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'n_classes' value is not used", - "markdown": "Parameter 'n_classes' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/logger.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 579, - "startColumn": 9, - "charOffset": 21630, - "charLength": 31, - "snippet": { - "text": "n_classes: Optional[int] = None" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 577, - "startColumn": 1, - "charOffset": 21545, - "charLength": 186, - "snippet": { - "text": " n_samples: int,\n out_shape: Optional[Tuple[int, ...]] = None,\n n_classes: Optional[int] = None,\n record_int: bool = True,\n record_float: bool = False," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "609a2e6e067a490100796650665caccb040abb9544bdbdf613d6d312d08d6b40" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'y' value is not used", - "markdown": "Parameter 'y' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 693, - "startColumn": 5, - "charOffset": 22330, - "charLength": 18, - "snippet": { - "text": "y: Sequence[float]" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 691, - "startColumn": 1, - "charOffset": 22285, - "charLength": 108, - "snippet": { - "text": "def transform_coordinates(\n x: float,\n y: Sequence[float],\n src_crs: CRS,\n new_crs: CRS = WGS84," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "662cfcf7d8fc299207fb143d40552d472ff8fbbdd2c07b868118fbbd6310332a" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'new_crs' value is not used", - "markdown": "Parameter 'new_crs' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 695, - "startColumn": 5, - "charOffset": 22372, - "charLength": 20, - "snippet": { - "text": "new_crs: CRS = WGS84" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 693, - "startColumn": 1, - "charOffset": 22326, - "charLength": 141, - "snippet": { - "text": " y: Sequence[float],\n src_crs: CRS,\n new_crs: CRS = WGS84,\n) -> Tuple[Sequence[float], Sequence[float]]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "694a68ccc02b6e12182a111406bc67dfa95067c13caddf289d9a228ee13cc72f" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'package' value is not used", - "markdown": "Parameter 'package' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 413, - "startColumn": 5, - "charOffset": 14775, - "charLength": 12, - "snippet": { - "text": "package: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 411, - "startColumn": 1, - "charOffset": 14748, - "charLength": 85, - "snippet": { - "text": " *,\n name: None,\n package: str,\n) -> ModuleType:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6bf602e814f4cf9db879530d46f003212e139f4f1193cf2d76d986b4930504d6" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'src_crs' value is not used", - "markdown": "Parameter 'src_crs' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 674, - "startColumn": 5, - "charOffset": 21964, - "charLength": 12, - "snippet": { - "text": "src_crs: CRS" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 672, - "startColumn": 1, - "charOffset": 21912, - "charLength": 137, - "snippet": { - "text": " x: Sequence[float],\n y: Sequence[float],\n src_crs: CRS,\n new_crs: CRS = WGS84,\n) -> Tuple[Sequence[float], Sequence[float]]:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6d53523e58e964dad3ef7eda320861a9255602bda287c485016e487361b4d89d" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'module' value is not used", - "markdown": "Parameter 'module' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 420, - "startColumn": 5, - "charOffset": 14872, - "charLength": 11, - "snippet": { - "text": "module: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 418, - "startColumn": 1, - "charOffset": 14836, - "charLength": 70, - "snippet": { - "text": "@overload\ndef _optional_import(\n module: str,\n *,\n name: str," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6d788da92648a1d3a532700c27260a52c4cc22781a588e70ae51e24cf1444849" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'kwargs' value is not used", - "markdown": "Parameter 'kwargs' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/modelio.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 201, - "startColumn": 5, - "charOffset": 7865, - "charLength": 8, - "snippet": { - "text": "**kwargs" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 199, - "startColumn": 1, - "charOffset": 7790, - "charLength": 269, - "snippet": { - "text": " device: torch.device, # type: ignore[name-defined]\n mode: str,\n **kwargs,\n) -> Tuple[Tensor, Union[Tensor, Tuple[Tensor, ...]], None, Sequence[BoundingBox]]:\n \"\"\"Provides IO functionality for a self-supervised Siamese model using :mod:`torchgeo` datasets." - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6f64be3164ef33853170ef48c3dc2920a182113862d9184a41b47070107614af" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Local variable 'weights' value is not used", - "markdown": "Local variable 'weights' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/core.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 401, - "startColumn": 5, - "charOffset": 15168, - "charLength": 7, - "snippet": { - "text": "weights" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 399, - "startColumn": 1, - "charOffset": 15037, - "charLength": 261, - "snippet": { - "text": " :meth:`~torchvision.models._api.WeightsEnum.get_state_dict` to download the weights (if not already in cache).\n \"\"\"\n weights: Optional[WeightsEnum] = None\n try:\n weights = torch.hub.load(\"pytorch/vision\", \"get_weight\", name=weights_name)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6ffe476c63ecd80ead735039841b639a2b95ab65eec89b59d2f3589e7e375f9c" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'name' value is not used", - "markdown": "Parameter 'name' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 452, - "startColumn": 5, - "charOffset": 15323, - "charLength": 9, - "snippet": { - "text": "name: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 450, - "startColumn": 1, - "charOffset": 15295, - "charLength": 91, - "snippet": { - "text": " module: str,\n *,\n name: str,\n) -> Callable[..., Any]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "73007e3d0e1ccd730c81edc048ccc048e7ebf710eaaac2c187582160cc46d52a" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'new_crs' value is not used", - "markdown": "Parameter 'new_crs' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 685, - "startColumn": 5, - "charOffset": 22177, - "charLength": 20, - "snippet": { - "text": "new_crs: CRS = WGS84" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 683, - "startColumn": 1, - "charOffset": 22141, - "charLength": 131, - "snippet": { - "text": " y: float,\n src_crs: CRS,\n new_crs: CRS = WGS84,\n) -> Tuple[Sequence[float], Sequence[float]]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "79b89d0ac18d10275a875af00922265d5c0c969757a828de7ca5e3981c82e265" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'src_crs' value is not used", - "markdown": "Parameter 'src_crs' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 702, - "startColumn": 25, - "charOffset": 22531, - "charLength": 12, - "snippet": { - "text": "src_crs: CRS" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 700, - "startColumn": 1, - "charOffset": 22470, - "charLength": 149, - "snippet": { - "text": "@overload\ndef transform_coordinates(\n x: float, y: float, src_crs: CRS, new_crs: CRS = WGS84\n) -> Tuple[float, float]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "7e77d4199c85a1cdc08a93e247fb3b593b33f73d3e6b6b90e129e87a166c43d8" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'x' value is not used", - "markdown": "Parameter 'x' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 702, - "startColumn": 5, - "charOffset": 22511, - "charLength": 8, - "snippet": { - "text": "x: float" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 700, - "startColumn": 1, - "charOffset": 22470, - "charLength": 149, - "snippet": { - "text": "@overload\ndef transform_coordinates(\n x: float, y: float, src_crs: CRS, new_crs: CRS = WGS84\n) -> Tuple[float, float]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "80cef2bce48d56630ad58749c7e129b28a77d0adc747f5801c90dc91a5515d42" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'signum' value is not used", - "markdown": "Parameter 'signum' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/runner.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 327, - "startColumn": 21, - "charOffset": 10341, - "charLength": 6, - "snippet": { - "text": "signum" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 325, - "startColumn": 1, - "charOffset": 10139, - "charLength": 351, - "snippet": { - "text": "# METHODS\n# =====================================================================================================================\ndef _handle_sigusr1(signum, frame) -> None: # pragma: no cover\n subprocess.Popen( # nosec B602\n shlex.split(f'scontrol requeue {os.getenv(\"SLURM_JOB_ID\")}')," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "8add16ba65f135bd2af3a910af293b125373b67d97709a4db09b45bb17a9efce" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'params' value is not used", - "markdown": "Parameter 'params' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/metrics.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 287, - "startColumn": 9, - "charOffset": 10877, - "charLength": 8, - "snippet": { - "text": "**params" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 285, - "startColumn": 1, - "charOffset": 10791, - "charLength": 152, - "snippet": { - "text": " model_type: str = \"segmentation\",\n sample_pairs: bool = False,\n **params,\n ) -> None:\n super(SSLMetrics, self).__init__(" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "9a146f37a59a5277080fdad354108fc52056a950c87e69e7fd06625acacf6e91" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'module' value is not used", - "markdown": "Parameter 'module' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 450, - "startColumn": 5, - "charOffset": 15299, - "charLength": 11, - "snippet": { - "text": "module: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 448, - "startColumn": 1, - "charOffset": 15263, - "charLength": 70, - "snippet": { - "text": "@overload\ndef _optional_import(\n module: str,\n *,\n name: str," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "9a649544c05610b6e5e8d69473154d4f209472049f1f19f4aff8307a4e22b3cc" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'name' value is not used", - "markdown": "Parameter 'name' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 422, - "startColumn": 5, - "charOffset": 14896, - "charLength": 9, - "snippet": { - "text": "name: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 420, - "startColumn": 1, - "charOffset": 14868, - "charLength": 81, - "snippet": { - "text": " module: str,\n *,\n name: str,\n package: str,\n) -> Callable[..., Any]:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "a659d8c2b94e47465b57135e636980024cdca4153faf387defa4359de0bd4626" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'frame' value is not used", - "markdown": "Parameter 'frame' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/runner.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 335, - "startColumn": 29, - "charOffset": 10558, - "charLength": 5, - "snippet": { - "text": "frame" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 333, - "startColumn": 1, - "charOffset": 10528, - "charLength": 75, - "snippet": { - "text": "\n\ndef _handle_sigterm(signum, frame) -> None: # pragma: no cover\n pass\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "aac2d2995f82d30eceaaf4fdc987bcf42180f54116528d862084b4b6e065026c" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'x' value is not used", - "markdown": "Parameter 'x' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 692, - "startColumn": 5, - "charOffset": 22316, - "charLength": 8, - "snippet": { - "text": "x: float" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 690, - "startColumn": 1, - "charOffset": 22275, - "charLength": 92, - "snippet": { - "text": "@overload\ndef transform_coordinates(\n x: float,\n y: Sequence[float],\n src_crs: CRS," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "ab35331e62db5cda26d2a43c10efcd94b5097118b39db292ae6e963a9e259d8c" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'src_crs' value is not used", - "markdown": "Parameter 'src_crs' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 684, - "startColumn": 5, - "charOffset": 22159, - "charLength": 12, - "snippet": { - "text": "src_crs: CRS" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 682, - "startColumn": 1, - "charOffset": 22117, - "charLength": 127, - "snippet": { - "text": " x: Sequence[float],\n y: float,\n src_crs: CRS,\n new_crs: CRS = WGS84,\n) -> Tuple[Sequence[float], Sequence[float]]:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "b3bddd4f6fd48c2af5a39d0afcf0e6ce30717d2ed97ba3e552d65135703bce1e" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Local variable 'auto_norm' value is not used", - "markdown": "Local variable 'auto_norm' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/factory.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 245, - "startColumn": 21, - "charOffset": 10484, - "charLength": 9, - "snippet": { - "text": "auto_norm" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 243, - "startColumn": 1, - "charOffset": 10421, - "charLength": 158, - "snippet": { - "text": "\n # Reset back to None.\n auto_norm = None\n else:\n raise TypeError( # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "b52fdcf3026983bc5183d48fc6dedd39a73c0af9ea7dd83a1d4a8e0525b64cec" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'package' value is not used", - "markdown": "Parameter 'package' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 433, - "startColumn": 5, - "charOffset": 15056, - "charLength": 13, - "snippet": { - "text": "package: None" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 431, - "startColumn": 1, - "charOffset": 15029, - "charLength": 86, - "snippet": { - "text": " *,\n name: None,\n package: None,\n) -> ModuleType:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "cbd6b524381e14f028d4f9da50e232cf048cdfdf35fa1e90d1ddfca4884b1808" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'matrix' value is not used", - "markdown": "Parameter 'matrix' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1131, - "startColumn": 31, - "charOffset": 38277, - "charLength": 22, - "snippet": { - "text": "matrix: Dict[int, int]" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1129, - "startColumn": 1, - "charOffset": 38217, - "charLength": 134, - "snippet": { - "text": "@overload\ndef mask_transform(\n array: NDArray[Any, Int], matrix: Dict[int, int]\n) -> NDArray[Any, Int]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "ce505d52473aa630478758857431f435946e3cf57cf8f278ff17fa3524e380f9" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'array' value is not used", - "markdown": "Parameter 'array' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1131, - "startColumn": 5, - "charOffset": 38251, - "charLength": 24, - "snippet": { - "text": "array: NDArray[Any, Int]" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1129, - "startColumn": 1, - "charOffset": 38217, - "charLength": 134, - "snippet": { - "text": "@overload\ndef mask_transform(\n array: NDArray[Any, Int], matrix: Dict[int, int]\n) -> NDArray[Any, Int]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "cf35c4f0a60b78cca8b6434c9b3b4e73a6c625bc275c572237da143b1188b9a6" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'name' value is not used", - "markdown": "Parameter 'name' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 412, - "startColumn": 5, - "charOffset": 14759, - "charLength": 10, - "snippet": { - "text": "name: None" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 410, - "startColumn": 1, - "charOffset": 14731, - "charLength": 74, - "snippet": { - "text": " module: str,\n *,\n name: None,\n package: str,\n) -> ModuleType:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "d62608e64a953a5a8ce65c40b9c506666eda359d7a18ae916dc8aef56d6832c8" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'kwargs' value is not used", - "markdown": "Parameter 'kwargs' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/modelio.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 61, - "startColumn": 5, - "charOffset": 2782, - "charLength": 8, - "snippet": { - "text": "**kwargs" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 59, - "startColumn": 1, - "charOffset": 2707, - "charLength": 258, - "snippet": { - "text": " device: torch.device, # type: ignore[name-defined]\n mode: str,\n **kwargs,\n) -> Tuple[Tensor, Union[Tensor, Tuple[Tensor, ...]], Tensor, Sequence[BoundingBox]]:\n \"\"\"Provides IO functionality for a supervised model using :mod:`torchgeo` datasets." - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "df52fbc1d0954e470ffec6689e3cf29b24767bd1b4212aa40a4734005d539cae" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'package' value is not used", - "markdown": "Parameter 'package' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 443, - "startColumn": 5, - "charOffset": 15193, - "charLength": 13, - "snippet": { - "text": "package: None" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 441, - "startColumn": 1, - "charOffset": 15167, - "charLength": 93, - "snippet": { - "text": " *,\n name: str,\n package: None,\n) -> Callable[..., Any]:\n ... # pragma: no cover" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "e1e0cd4c4ddd2c06f506f0436e1d19d1b01342995ae0f5d597fcabcb059e4a03" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'name' value is not used", - "markdown": "Parameter 'name' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 432, - "startColumn": 5, - "charOffset": 15040, - "charLength": 10, - "snippet": { - "text": "name: None" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 430, - "startColumn": 1, - "charOffset": 15012, - "charLength": 75, - "snippet": { - "text": " module: str,\n *,\n name: None,\n package: None,\n) -> ModuleType:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "ec912aec7e48142ae5dee57f34eb546b857eb1e54e52a4bd2412e9e12c339eaf" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'module' value is not used", - "markdown": "Parameter 'module' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 459, - "startColumn": 5, - "charOffset": 15425, - "charLength": 11, - "snippet": { - "text": "module: str" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 457, - "startColumn": 1, - "charOffset": 15389, - "charLength": 73, - "snippet": { - "text": "@overload\ndef _optional_import(\n module: str,\n *,\n package: str," - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "fefbb316ee2a47b8507c4ea452e8b44c33d275692a4987ec9c16e2b4fbe85c7d" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Parameter 'array' value is not used", - "markdown": "Parameter 'array' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1137, - "startColumn": 20, - "charOffset": 38383, - "charLength": 17, - "snippet": { - "text": "array: LongTensor" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1135, - "startColumn": 1, - "charOffset": 38353, - "charLength": 116, - "snippet": { - "text": "\n@overload\ndef mask_transform(array: LongTensor, matrix: Dict[int, int]) -> LongTensor:\n ... # pragma: no cover\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "ff40646ba7f92fa771bd73cf020a02f83fd8062daecadec23c35fc5cdb5b28f4" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "tags": [ - "Python" - ] - } - } - ], - "automationDetails": { - "id": "project/qodana/2023-09-07", - "guid": "13a1380d-4823-4b73-9ace-ff74068ba5aa", - "properties": { - "jobUrl": "" - } - }, - "newlineSequences": [ - "\r\n", - "\n" - ], - "properties": { - "qodana.sanity.results": [ - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/samplers.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "21a8dfca3a662b90fc821d542fdfa1717fd334d9857bf32942b5e8bddf58ef0a" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/__depreciated.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "2c14dddaa90c405bb8f79b5496b28864da5661f78649df81d2fb105baada4e21" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "docs/conf.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 84, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# Configuration file for the Sphinx documentation builder.\n#" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 191, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options. For a full\n# list see the documentation:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "4c9a5c329324331f237c44237a2a87856dcefc34a00a7ad7152d3c2995c37219" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "setup.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 53, - "snippet": { - "text": "# -*- coding: utf-8 -*-\nfrom setuptools import setup\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 92, - "snippet": { - "text": "# -*- coding: utf-8 -*-\nfrom setuptools import setup\n\nif __name__ == \"__main__\":\n setup()" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "532128b27875bd9e13d222179b2cc5ba0d2e7c00d65e3993dbff3dd845d66acd" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/runner.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 61, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# PYTHON_ARGCOMPLETE_OK\n# MIT License" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 95, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# PYTHON_ARGCOMPLETE_OK\n# MIT License\n\n# Copyright (c) 2023 Harry Baker" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6653938c0fef6b11aa6eec10598d918a31e9e37a3ddf9d7ab07717aa7b7a4605" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/loss.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "7c99b46c2793349e3f91bfdc4e2c6e3b0c5abf0b4261245fd142c3cf54ac0cac" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/__testing.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "8205367766df33c2c9ae21b8bd36128a72582f0ca1e930b8ec0bd437481266ce" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/ssl4eos12.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "88f6ad5763bda0b0b70862a483b49abf864ca86f906b5ddc67e87362da38a43e" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/pytorchtools.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 39, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n#" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 81, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n#\n# Copyright (c) 2018 Bjarte Mehus Sunde\n#" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "93c6dddb1802b35907705fd939a3882bfbd0df1d59574f856753c7fabd95adc8" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/factory.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "95509029289675caa1dc8c93178b9c69e0d1e7d1cbe4ff7ca8bf0780daa847a3" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/__init__.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 58, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# Copyright (C) 2023 Harry Baker\n#" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 207, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# Copyright (C) 2023 Harry Baker\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License as published by" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "a86c36d3707e420ba84dfb38ea35c8895859297d4539216a10698d11b48c82fc" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/modelio.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "b55c874b3a0c1de1318842d131dfe67f77ae4edd4113c9e56f4831f58e9cb214" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/__init__.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "b63a7f23434063cf31df35f36e1a5f936e2ecc9a7e40f1501c9d333e85ad00d6" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/__init__.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "ba6b058b5f2efdab64de212ecf163255f812d4e70344a49b19d81d1f04c899d3" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/naip.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "bcf537e802048819675f876b2873c91c01a50358a619720d70d9a7475656e963" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/__init__.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 58, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# flake8: noqa: F401\n# MIT License" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 92, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# flake8: noqa: F401\n# MIT License\n\n# Copyright (c) 2023 Harry Baker" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "c3450498e9c4c0c21cdaf8b368061f090414e65a54abd9cb664548176ab80ed5" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/optimisers.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 39, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n#" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 75, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n#\n# Copyright (c) 2018 Noah Golmant\n#" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "cff37df1d81e0a73435a82c6845b999632c73655c7562b047c4e2d9155b5568c" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/config_load.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "d2f7f4464dd6b8a593e436f83a243acb73b83d9f0f9487445b2132c9d2033257" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/collators.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "d6853b942787181db7e74c95139dc4f9f7710979e7d7e6dc06f7761d5149e28c" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/metrics.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "f48495ce36b2ddf551aa4536cefd96fcf7ed420279e00575869068fb712d9c2f" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/models/psp.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 38, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 72, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# MIT License\n\n# Copyright (c) 2023 Harry Baker\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "f5a136402840350a6212e9c4464c2f3b110d555e96ec9f4414a7c853796973bc" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/datasets/dfc.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 59, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# Copyright (C) 2023 Harry Baker\n#" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 201, - "snippet": { - "text": "# -*- coding: utf-8 -*-\n# Copyright (C) 2023 Harry Baker\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "fd7ab2e5d0e2a3c1ee07fa827b6d4ea624023ff983fedf77dd0921a8bc677ccf" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference 'pathlib'", - "markdown": "Unresolved reference 'pathlib'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/__init__.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 56, - "startColumn": 6, - "charOffset": 2613, - "charLength": 7, - "snippet": { - "text": "pathlib" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 54, - "startColumn": 1, - "charOffset": 2582, - "charLength": 79, - "snippet": { - "text": "import argparse\nimport os\nfrom pathlib import Path\nfrom typing import Optional\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "0c3ba3acc17f1bd0fef293e02127a47735186c261938019919a975b47debc4fd" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference 'setuptools'", - "markdown": "Unresolved reference 'setuptools'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "setup.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 2, - "startColumn": 6, - "charOffset": 29, - "charLength": 10, - "snippet": { - "text": "setuptools" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 80, - "snippet": { - "text": "# -*- coding: utf-8 -*-\nfrom setuptools import setup\n\nif __name__ == \"__main__\":" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "13db64ad496b0f8f0fa00906eea7fe27e7b8aa2117fdc57f8a2c2151c202b79d" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "No module named 'sys'", - "markdown": "No module named 'sys'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "docs/conf.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 15, - "startColumn": 8, - "charOffset": 594, - "charLength": 3, - "snippet": { - "text": "sys" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 13, - "startColumn": 1, - "charOffset": 575, - "charLength": 74, - "snippet": { - "text": "#\nimport os\nimport sys\n\nsys.path.insert(0, os.path.abspath(\"../minerva/\"))" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "2318834aee2442ba2a937b70f66501e8f54aee41fb446c30a04024574f29e6c8" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference 'Path'", - "markdown": "Unresolved reference 'Path'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/__init__.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 56, - "startColumn": 21, - "charOffset": 2628, - "charLength": 4, - "snippet": { - "text": "Path" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 54, - "startColumn": 1, - "charOffset": 2582, - "charLength": 79, - "snippet": { - "text": "import argparse\nimport os\nfrom pathlib import Path\nfrom typing import Optional\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "276e302cc6c07a342581778042716faca5dd6e50b5f8cfaaf17f2d5933a6b8ba" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference 'Tensor'", - "markdown": "Unresolved reference 'Tensor'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/loss.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 41, - "startColumn": 19, - "charOffset": 2101, - "charLength": 6, - "snippet": { - "text": "Tensor" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 39, - "startColumn": 1, - "charOffset": 2065, - "charLength": 108, - "snippet": { - "text": "import importlib\n\nfrom torch import Tensor\nfrom urllib3.exceptions import MaxRetryError, NewConnectionError\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "36ccc0a709b5b2dc277c0e0a5d64640b5e5d0fc95ebfc975e0945a92b3441b2a" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "No module named 'os'", - "markdown": "No module named 'os'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/__init__.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 55, - "startColumn": 8, - "charOffset": 2605, - "charLength": 2, - "snippet": { - "text": "os" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 53, - "startColumn": 1, - "charOffset": 2462, - "charLength": 198, - "snippet": { - "text": "# =====================================================================================================================\nimport argparse\nimport os\nfrom pathlib import Path\nfrom typing import Optional" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "47ad835d567e7f1ec14ac969414d1d6b8e76e6bc5b74ea1b39f8d78838ae1bbc" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "No module named 'argparse'", - "markdown": "No module named 'argparse'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/__init__.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 54, - "startColumn": 8, - "charOffset": 2589, - "charLength": 8, - "snippet": { - "text": "argparse" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 52, - "startColumn": 1, - "charOffset": 2400, - "charLength": 232, - "snippet": { - "text": "# IMPORTS\n# =====================================================================================================================\nimport argparse\nimport os\nfrom pathlib import Path" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "5710478f4fd44f4be60689a886125d43b325c6547176579c463a7739fd131baf" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "No module named 'importlib'", - "markdown": "No module named 'importlib'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/loss.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 39, - "startColumn": 8, - "charOffset": 2072, - "charLength": 9, - "snippet": { - "text": "importlib" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 37, - "startColumn": 1, - "charOffset": 1883, - "charLength": 224, - "snippet": { - "text": "# IMPORTS\n# =====================================================================================================================\nimport importlib\n\nfrom torch import Tensor" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6a7e7d00b6d700b56cdba1ce62890fc1c27837690330acf32819b6bb0810acd8" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "No module named 'os'", - "markdown": "No module named 'os'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "docs/conf.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 14, - "startColumn": 8, - "charOffset": 584, - "charLength": 2, - "snippet": { - "text": "os" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 12, - "startColumn": 1, - "charOffset": 495, - "charLength": 103, - "snippet": { - "text": "# documentation root, use os.path.abspath to make it absolute, like shown here.\n#\nimport os\nimport sys\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "725fc43ba77fd9afa7ec76fa4303d2423bc0c824fb866e218fbaeeddfba45251" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference 'urllib3'", - "markdown": "Unresolved reference 'urllib3'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/loss.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 42, - "startColumn": 6, - "charOffset": 2113, - "charLength": 7, - "snippet": { - "text": "urllib3" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 40, - "startColumn": 1, - "charOffset": 2082, - "charLength": 150, - "snippet": { - "text": "\nfrom torch import Tensor\nfrom urllib3.exceptions import MaxRetryError, NewConnectionError\n\n# Needed to avoid connection error when importing lightly." - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "9460e80b855a4940f932d6c41bd5547b07a3739649aa8fa75c1cb6a260113062" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference 'setup'", - "markdown": "Unresolved reference 'setup'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "setup.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 2, - "startColumn": 24, - "charOffset": 47, - "charLength": 5, - "snippet": { - "text": "setup" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 80, - "snippet": { - "text": "# -*- coding: utf-8 -*-\nfrom setuptools import setup\n\nif __name__ == \"__main__\":" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "bb7ee3469ad1ce9f28647da9c23358464c7b8f44229d593cf69da7281d421018" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference 'torch'", - "markdown": "Unresolved reference 'torch'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/loss.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 41, - "startColumn": 6, - "charOffset": 2088, - "charLength": 5, - "snippet": { - "text": "torch" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 39, - "startColumn": 1, - "charOffset": 2065, - "charLength": 108, - "snippet": { - "text": "import importlib\n\nfrom torch import Tensor\nfrom urllib3.exceptions import MaxRetryError, NewConnectionError\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "cd8d70a7ff4d51adfd3b74a01335ce7efa61f720fb1b0fb3e7375336a4255cad" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "QodanaSanity", - "kind": "fail", - "level": "error", - "message": { - "text": "Expression expected", - "markdown": "Expression expected" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 812, - "startColumn": 52, - "charOffset": 26507, - "charLength": 1, - "snippet": { - "text": "\"" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 810, - "startColumn": 1, - "charOffset": 26442, - "charLength": 130, - "snippet": { - "text": "\ndef dec2deg(\n dec_co: Union[Sequence[float], NDArray[Shape[\"*\"], Float]], # noqa: F722\n axis: str = \"lat\",\n) -> List[str]:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "34eb8e26831add120298b7a42e12a22cdd6dcab7092186c015d81bd416e9e08c" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "QodanaSanity", - "kind": "fail", - "level": "error", - "message": { - "text": "Statement expected, found Py:MULT", - "markdown": "Statement expected, found Py:MULT" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1515, - "startColumn": 22, - "charOffset": 52002, - "charLength": 1, - "snippet": { - "text": "\"" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1513, - "startColumn": 1, - "charOffset": 51919, - "charLength": 162, - "snippet": { - "text": "def batch_flatten(\n x: Union[NDArray[Any, Any], ArrayLike]\n) -> NDArray[Shape[\"*\"], Any]: # noqa: F722\n \"\"\"Flattens the supplied array with :func:`numpy`.\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "ad46d634b17bf64d78a263fd9e3671e651028a75496ded23c989a869dbee02cb" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "QodanaSanity", - "kind": "fail", - "level": "error", - "message": { - "text": "Statement expected, found Py:MULT", - "markdown": "Statement expected, found Py:MULT" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 812, - "startColumn": 52, - "charOffset": 26507, - "charLength": 1, - "snippet": { - "text": "\"" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 810, - "startColumn": 1, - "charOffset": 26442, - "charLength": 130, - "snippet": { - "text": "\ndef dec2deg(\n dec_co: Union[Sequence[float], NDArray[Shape[\"*\"], Float]], # noqa: F722\n axis: str = \"lat\",\n) -> List[str]:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "c140f73149ebb4797a9b9a5acb5995a944fe7257ab14678e5837599791822df2" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - }, - { - "ruleId": "QodanaSanity", - "kind": "fail", - "level": "error", - "message": { - "text": "Expression expected", - "markdown": "Expression expected" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "minerva/utils/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1515, - "startColumn": 22, - "charOffset": 52002, - "charLength": 1, - "snippet": { - "text": "\"" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1513, - "startColumn": 1, - "charOffset": 51919, - "charLength": 162, - "snippet": { - "text": "def batch_flatten(\n x: Union[NDArray[Any, Any], ArrayLike]\n) -> NDArray[Shape[\"*\"], Any]: # noqa: F722\n \"\"\"Flattens the supplied array with :func:`numpy`.\n" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "c5234dcb27adddbdabcf138551dd9ac049859f4d63d9319007d49d1ac5540e65" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" - } - } - ], - "configProfile": "absent", - "deviceId": "200820300000000-aeb8-7dfb-2319-e05a933d2f21" - } - } - ] -} diff --git a/qodana.yaml b/qodana.yaml deleted file mode 100644 index f88e174ac..000000000 --- a/qodana.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -version: '1.0' -linter: jetbrains/qodana-python:2023.2-eap -failThreshold: 10 -include: - - name: CheckDependencyLicenses diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 0f002a2dd..98c8a5144 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,42 +1,42 @@ alive_progress==3.1.4 -argcomplete==3.1.1 +argcomplete==3.1.2 catalyst==22.4 fastapi>=0.101.0 fiona>=1.9.1 geopy==2.4.0 GitPython>=3.1.35 -imageio==2.31.3 +imageio==2.31.6 inputimeout==1.0.4 -ipykernel==6.25.2 +ipykernel==6.26.0 lightly==1.4.21 matplotlib==3.7.2 -mlflow==2.6.0 +mlflow==2.8.0 nptyping==2.5.0 numba>=0.57.0 # not directly required but pinned to ensure Python 3.11 compatibility. -numpy==1.24.3 +numpy==1.26.1 onnx==1.14.1 -onnx2torch==1.5.11 +onnx2torch==1.5.13 overload==1.1 -pandas==2.1.1 +pandas==2.1.2 protobuf>=3.19.5 # not directly required, pinned by Snyk to avoid a vulnerability. -psutil==5.9.5 +psutil==5.9.6 pyyaml==6.0.1 rasterio>=1.3.6 requests==2.31.0 -scikit-learn==1.3.1 +scikit-learn==1.3.2 segmentation-models-pytorch==0.3.3 setuptools==68.2.2 starlette==0.31.1 # not directly required, pinned by Dependabot to avoid a vulnerability. tabulate==0.9.0 tensorflow==2.14.0 timm==0.9.2 -torchgeo==0.5.0 +torchgeo==0.5.1 torchinfo==1.8.0 tornado>=6.3.3 tqdm==4.66.1 -types-PyYAML==6.0.12.11 -types-requests==2.31.0.8 +types-PyYAML==6.0.12.12 +types-requests==2.31.0.10 types-tabulate==0.9.0.3 -wandb==0.15.10 +wandb==0.15.12 Werkzeug>=2.2.3 # Patches a potential security vulnerability. wheel>=0.38.0 # not directly required, pinned by Snyk to avoid a vulnerability. diff --git a/requirements/requirements_dev.txt b/requirements/requirements_dev.txt index 3cbc6630b..5b887bb55 100644 --- a/requirements/requirements_dev.txt +++ b/requirements/requirements_dev.txt @@ -1,5 +1,5 @@ alive_progress==3.1.4 -argcomplete==3.1.1 +argcomplete==3.1.2 catalyst==22.4 certifi>=2022.12.7 # not directly required, pinned by Snyk to avoid a vulnerability. fastapi>=0.101.0 @@ -7,33 +7,33 @@ fiona>=1.9.1 flake8==6.1.0 geopy==2.4.0 GitPython>=3.1.35 -imageio==2.31.3 +imageio==2.31.6 inputimeout==1.0.4 internet-sabotage3==0.1.6 -ipykernel==6.25.2 +ipykernel==6.26.0 lightly==1.4.21 matplotlib==3.7.2 -mlflow==2.6.0 -mypy==1.5.1 +mlflow==2.8.0 +mypy==1.6.1 myst_parser==2.0.0 nptyping==2.5.0 numba>=0.57.0 # not directly required but pinned to ensure Python 3.11 compatibility. -numpy==1.24.3 +numpy==1.26.1 onnx==1.14.1 -onnx2torch==1.5.11 +onnx2torch==1.5.13 overload==1.1 -pandas==2.1.1 -pre-commit==3.4.0 +pandas==2.1.2 +pre-commit==3.5.0 protobuf>=3.19.5 # not directly required, pinned by Snyk to avoid a vulnerability. -psutil==5.9.5 +psutil==5.9.6 pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability. -pytest==7.4.2 +pytest==7.4.3 pytest-cov==4.1.0 pytest-lazy-fixture==0.6.3 pyyaml==6.0.1 rasterio>=1.3.6 requests==2.31.0 -scikit-learn==1.3.1 +scikit-learn==1.3.2 segmentation-models-pytorch==0.3.3 setuptools==68.2.2 sphinx==7.2.6 @@ -42,14 +42,14 @@ starlette>=0.25.0 # not directly required, pinned by Dependabot to avoid a vulne tabulate==0.9.0 tensorflow==2.14.0 timm==0.9.2 -torchgeo==0.5.0 +torchgeo==0.5.1 torchinfo==1.8.0 tornado>=6.3.3 tox==4.11.3 tqdm==4.66.1 -types-PyYAML==6.0.12.11 -types-requests==2.31.0.8 +types-PyYAML==6.0.12.12 +types-requests==2.31.0.10 types-tabulate==0.9.0.3 -wandb==0.15.10 +wandb==0.15.12 Werkzeug>=2.2.3 # Patches a potential security vulnerability. wheel>=0.38.0 # not directly required, pinned by Snyk to avoid a vulnerability. diff --git a/tests/conftest.py b/tests/conftest.py index 0a7ae532e..31619ac7f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -54,7 +54,7 @@ from torchgeo.datasets.utils import BoundingBox from minerva.datasets import SSL4EOS12Sentinel2, make_dataset -from minerva.models import CNN, MLP, MinervaModel +from minerva.models import CNN, MLP, FCN32ResNet18 from minerva.utils import CONFIG, utils @@ -160,7 +160,7 @@ def std_n_batches() -> int: @pytest.fixture -def x_entropy_loss(): +def x_entropy_loss() -> nn.CrossEntropyLoss: return nn.CrossEntropyLoss() @@ -171,33 +171,50 @@ def small_patch_size() -> Tuple[int, int]: @pytest.fixture def rgbi_input_size() -> Tuple[int, int, int]: - return (4, 64, 64) + return (4, 32, 32) @pytest.fixture -def exp_mlp(x_entropy_loss) -> MinervaModel: +def exp_mlp(x_entropy_loss: nn.CrossEntropyLoss) -> MLP: return MLP(x_entropy_loss, 64) @pytest.fixture -def exp_cnn(x_entropy_loss, rgbi_input_size) -> MinervaModel: +def exp_cnn( + x_entropy_loss: nn.CrossEntropyLoss, rgbi_input_size: Tuple[int, int, int] +) -> CNN: return CNN(x_entropy_loss, rgbi_input_size) @pytest.fixture -def random_mask(small_patch_size, std_n_classes) -> NDArray[Shape["32, 32"], Int]: +def exp_fcn( + x_entropy_loss: nn.CrossEntropyLoss, + rgbi_input_size: Tuple[int, int, int], + std_n_classes: int, +) -> FCN32ResNet18: + return FCN32ResNet18(x_entropy_loss, rgbi_input_size, std_n_classes) + + +@pytest.fixture +def random_mask( + small_patch_size: Tuple[int, int], std_n_classes: int +) -> NDArray[Shape["32, 32"], Int]: mask = np.random.randint(0, std_n_classes - 1, size=small_patch_size) assert isinstance(mask, np.ndarray) return mask @pytest.fixture -def random_image(small_patch_size) -> NDArray[Shape["32, 32, 3"], Float]: +def random_image( + small_patch_size: Tuple[int, int] +) -> NDArray[Shape["32, 32, 3"], Float]: return np.random.rand(*small_patch_size, 3) @pytest.fixture -def random_rgbi_image(small_patch_size) -> NDArray[Shape["32, 32, 4"], Float]: +def random_rgbi_image( + small_patch_size: Tuple[int, int] +) -> NDArray[Shape["32, 32, 4"], Float]: return np.random.rand(*small_patch_size, 4) @@ -216,7 +233,7 @@ def simple_rgb_img() -> Tensor: @pytest.fixture -def norm_simple_rgb_img(simple_rgb_img) -> Tensor: +def norm_simple_rgb_img(simple_rgb_img: Tensor) -> Tensor: norm_img = simple_rgb_img / 255 assert isinstance(norm_img, Tensor) return norm_img @@ -232,12 +249,14 @@ def flipped_rgb_img() -> Tensor: @pytest.fixture -def simple_sample(simple_rgb_img, simple_mask) -> Dict[str, Tensor]: +def simple_sample(simple_rgb_img: Tensor, simple_mask: LongTensor) -> Dict[str, Tensor]: return {"image": simple_rgb_img, "mask": simple_mask} @pytest.fixture -def flipped_simple_sample(flipped_rgb_img, flipped_simple_mask) -> Dict[str, Tensor]: +def flipped_simple_sample( + flipped_rgb_img: Tensor, flipped_simple_mask: LongTensor +) -> Dict[str, Tensor]: return {"image": flipped_rgb_img, "mask": flipped_simple_mask} @@ -249,7 +268,9 @@ def random_rgbi_batch( @pytest.fixture -def random_tensor_mask(std_n_classes: int, small_patch_size) -> LongTensor: +def random_tensor_mask( + std_n_classes: int, small_patch_size: Tuple[int, int] +) -> LongTensor: mask = torch.randint(0, std_n_classes - 1, size=small_patch_size, dtype=torch.long) assert isinstance(mask, LongTensor) return mask @@ -270,7 +291,9 @@ def random_mask_batch( @pytest.fixture -def random_scene_classification_batch(std_batch_size, std_n_classes) -> LongTensor: +def random_scene_classification_batch( + std_batch_size: int, std_n_classes: int +) -> LongTensor: batch = torch.randint(0, std_n_classes - 1, size=(std_batch_size,)) assert isinstance(batch, LongTensor) return batch @@ -333,7 +356,9 @@ def exp_dataset_params() -> Dict[str, Any]: @pytest.fixture def default_dataset() -> IntersectionDataset: - dataset, _ = make_dataset(CONFIG["dir"]["data"], CONFIG["dataset_params"]["test"]) + dataset, _ = make_dataset( + CONFIG["dir"]["data"], CONFIG["tasks"]["test-test"]["dataset_params"] + ) assert isinstance(dataset, IntersectionDataset) return dataset diff --git a/tests/test_datasets/test_factory.py b/tests/test_datasets/test_factory.py index 98638a19c..84167f2da 100644 --- a/tests/test_datasets/test_factory.py +++ b/tests/test_datasets/test_factory.py @@ -173,31 +173,32 @@ def test_construct_dataloader( def test_make_loaders() -> None: old_params = CONFIG.copy() - mask_transforms = {"RandomHorizontalFlip": {"module": "torchvision.transforms"}} - transform_params = { - "train": { - "image": False, - "mask": mask_transforms, - }, - "val": { - "image": False, - "mask": mask_transforms, - }, - "test": { - "image": False, - "mask": False, - }, - } - - old_params["transform_params"] = transform_params - - loaders, n_batches, class_dist, params = mdt.make_loaders(**old_params) + # mask_transforms = {"RandomHorizontalFlip": {"module": "torchvision.transforms"}} + # transform_params = { + # "train": { + # "image": False, + # "mask": mask_transforms, + # }, + # "val": { + # "image": False, + # "mask": mask_transforms, + # }, + # "test": { + # "image": False, + # "mask": False, + # }, + # } + + # old_params["transform_params"] = transform_params + + loader, n_batches, class_dist, params = mdt.make_loaders( + **old_params, task_name="fit-val" + ) - for mode in ("train", "val", "test"): - assert isinstance(loaders[mode], DataLoader) - assert type(n_batches[mode]) is int - assert type(class_dist) is list - assert isinstance(params, dict) + assert isinstance(loader, DataLoader) + assert type(n_batches) is int + assert type(class_dist) is list + assert isinstance(params, dict) def test_get_manifest_path() -> None: @@ -212,18 +213,21 @@ def test_get_manifest() -> None: if manifest_path.exists(): manifest_path.unlink() - assert isinstance(mdt.get_manifest(manifest_path), pd.DataFrame) - assert isinstance(mdt.get_manifest(manifest_path), pd.DataFrame) + assert isinstance( + mdt.get_manifest(manifest_path, task_name="fit-train"), pd.DataFrame + ) + assert isinstance( + mdt.get_manifest(manifest_path, task_name="fit-train"), pd.DataFrame + ) new_path = Path("tests", "tmp", "empty", "Chesapeake7_Manifest.csv") if new_path.exists(): - print("exists") new_path.unlink() if new_path.parent.exists(): new_path.parent.rmdir() - assert isinstance(mdt.get_manifest(new_path), pd.DataFrame) + assert isinstance(mdt.get_manifest(new_path, task_name="fit-train"), pd.DataFrame) if new_path.exists(): new_path.unlink() diff --git a/tests/test_datasets/test_ssl4eo_s12.py b/tests/test_datasets/test_ssl4eo_s12.py new file mode 100644 index 000000000..c2bf98b8a --- /dev/null +++ b/tests/test_datasets/test_ssl4eo_s12.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +r"""Tests for :mod:`minerva.datasets.ssl4eo_s12`. +""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" + +# ===================================================================================================================== +# IMPORTS +# ===================================================================================================================== +from pathlib import Path + +from rasterio.crs import CRS + +from minerva.datasets import PairedDataset, SSL4EOS12Sentinel2 +from minerva.utils import CONFIG + + +# ===================================================================================================================== +# TESTS +# ===================================================================================================================== +def test_ssl4eos12sentinel2() -> None: + path = str(Path(CONFIG["dir"]["data"]) / "SSL4EO-S12") + bands = ["B1", "B2", "B3", "B8A"] + crs = CRS.from_epsg(25832) + res = 10.0 + + all_bands_dataset = SSL4EOS12Sentinel2(paths=path, res=res, crs=crs) + + assert isinstance(all_bands_dataset, SSL4EOS12Sentinel2) + + rgbi_dataset = SSL4EOS12Sentinel2(paths=path, bands=bands, res=res, crs=crs) + assert isinstance(rgbi_dataset, SSL4EOS12Sentinel2) + + paired_dataset = PairedDataset(rgbi_dataset) + + assert isinstance(paired_dataset, PairedDataset) + + init_as_paired = PairedDataset( + SSL4EOS12Sentinel2, paths=path, bands=bands, res=res, crs=crs + ) + + assert isinstance(init_as_paired, PairedDataset) diff --git a/tests/test_logger.py b/tests/test_logger.py deleted file mode 100644 index 5d8d647fa..000000000 --- a/tests/test_logger.py +++ /dev/null @@ -1,257 +0,0 @@ -# -*- coding: utf-8 -*- -# MIT License - -# Copyright (c) 2023 Harry Baker - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# @org: University of Southampton -# Created under a project funded by the Ordnance Survey Ltd. -r"""Tests for :mod:`minerva.logger`. -""" -# ===================================================================================================================== -# METADATA -# ===================================================================================================================== -__author__ = "Harry Baker" -__contact__ = "hjb1d20@soton.ac.uk" -__license__ = "MIT License" -__copyright__ = "Copyright (C) 2023 Harry Baker" - -import importlib -import shutil -import tempfile -from pathlib import Path - -# ===================================================================================================================== -# IMPORTS -# ===================================================================================================================== -from typing import Any, Dict, List, Tuple, Union - -import numpy as np -import torch -from urllib3.exceptions import MaxRetryError, NewConnectionError - -# Needed to avoid connection error when importing lightly. -try: - from lightly.loss import NTXentLoss -except (OSError, NewConnectionError, MaxRetryError): - NTXentLoss = getattr(importlib.import_module("lightly.loss"), "NTXentLoss") -import pytest -from nptyping import NDArray, Shape -from numpy.testing import assert_array_equal -from torch import Tensor -from torch.nn.modules import Module -from torchgeo.datasets.utils import BoundingBox - -from minerva.logger import SSLLogger, STGLogger -from minerva.loss import SegBarlowTwinsLoss -from minerva.modelio import ssl_pair_tg, sup_tg -from minerva.models import FCN16ResNet18, MinervaSiamese, SimCLR18, SimConv -from minerva.utils import utils - - -# ===================================================================================================================== -# TESTS -# ===================================================================================================================== -@pytest.mark.parametrize("mode", ("train", "val", "test")) -@pytest.mark.parametrize("model_type", ("scene_classifier", "segmentation")) -def test_STGLogger( - simple_bbox: BoundingBox, - x_entropy_loss, - std_n_batches: int, - std_n_classes: int, - std_batch_size: int, - small_patch_size: Tuple[int, int], - default_device: torch.device, - mode: str, - model_type: str, -) -> None: - path = Path(tempfile.gettempdir(), "exp1") - - if not path.exists(): - path.mkdir() - - try: - tensorboard_writer = utils._optional_import( - "torch.utils.tensorboard.writer", name="SummaryWriter", package="tensorflow" - ) - except ImportError as err: - print(err) - writer = None - else: - writer = tensorboard_writer(log_dir=path) - - model = FCN16ResNet18(x_entropy_loss, input_size=(4, *small_patch_size)).to( - default_device - ) - optimiser = torch.optim.SGD(model.parameters(), lr=1.0e-3) - model.set_optimiser(optimiser) - model.determine_output_dim() - - output_shape = model.output_shape - assert isinstance(output_shape, tuple) - - logger = STGLogger( - n_batches=std_n_batches, - batch_size=std_batch_size, - n_samples=std_n_batches - * std_batch_size - * small_patch_size[0] - * small_patch_size[1], - out_shape=output_shape, - n_classes=std_n_classes, - record_int=True, - record_float=True, - model_type=model_type, - writer=writer, - ) - data: List[Dict[str, Union[Tensor, List[Any]]]] = [] - for i in range(std_n_batches): - images = torch.rand(size=(std_batch_size, 4, *small_patch_size)) - masks = torch.randint( # type: ignore[attr-defined] - 0, std_n_classes, (std_batch_size, *small_patch_size) - ) - bboxes = [simple_bbox] * std_batch_size - batch: Dict[str, Union[Tensor, List[Any]]] = { - "image": images, - "mask": masks, - "bbox": bboxes, - } - data.append(batch) - - logger(mode, i, *sup_tg(batch, model, device=default_device, mode=mode)) - - logs = logger.get_logs - assert logs["batch_num"] == std_n_batches - assert type(logs["total_loss"]) is float - assert type(logs["total_correct"]) is float - - if model_type == "segmentation": - assert type(logs["total_miou"]) is float - - results = logger.get_results - assert results["z"].shape == ( - std_n_batches, - std_batch_size, - *small_patch_size, - ) - assert results["y"].shape == ( - std_n_batches, - std_batch_size, - *small_patch_size, - ) - assert np.array(results["ids"]).shape == (std_n_batches, std_batch_size) - - shape = f"{std_n_batches}, {std_batch_size}, {small_patch_size[0]}, {small_patch_size[1]}" - y: NDArray[Shape[shape], Any] = np.empty( - (std_n_batches, std_batch_size, *output_shape), dtype=np.uint8 - ) - for i in range(std_n_batches): - mask: Union[Tensor, List[Any]] = data[i]["mask"] - assert isinstance(mask, Tensor) - y[i] = mask.cpu().numpy() - - assert_array_equal(results["y"], y) - - shutil.rmtree(path, ignore_errors=True) - - -@pytest.mark.parametrize( - ("model_cls", "model_type", "criterion"), - ( - (SimCLR18, "siamese", NTXentLoss()), - (SimConv, "siamese-segmentation", SegBarlowTwinsLoss()), - ), -) -@pytest.mark.parametrize("mode", ("train", "val", "test")) -@pytest.mark.parametrize("extra_metrics", (True, False)) -def test_SSLLogger( - simple_bbox: BoundingBox, - std_n_batches: int, - std_batch_size: int, - small_patch_size: Tuple[int, int], - default_device: torch.device, - model_cls: MinervaSiamese, - model_type: str, - criterion: Module, - mode: str, - extra_metrics: bool, -) -> None: - path = Path(tempfile.gettempdir(), "exp2") - - if not path.exists(): - path.mkdir() - - try: - tensorboard_writer = utils._optional_import( - "torch.utils.tensorboard.writer", name="SummaryWriter", package="tensorflow" - ) - except ImportError as err: - print(err) - writer = None - else: - writer = tensorboard_writer(log_dir=path) - - model: MinervaSiamese = model_cls(criterion, input_size=(4, *small_patch_size)).to( - default_device - ) - optimiser = torch.optim.SGD(model.parameters(), lr=1.0e-3) - model.set_optimiser(optimiser) - - logger = SSLLogger( - n_batches=std_n_batches, - batch_size=std_batch_size, - n_samples=std_n_batches * std_batch_size, - record_int=True, - record_float=True, - collapse_level=extra_metrics, - euclidean=extra_metrics, - writer=writer, - model_type=model_type, - ) - data = [] - for i in range(std_n_batches): - images = torch.rand(size=(std_batch_size, 4, *small_patch_size)) - bboxes = [simple_bbox] * std_batch_size - batch = { - "image": images, - "bbox": bboxes, - } - data.append((batch, batch)) - - logger( - mode, - i, - *ssl_pair_tg((batch, batch), model, device=default_device, mode=mode), - ) - - logs = logger.get_logs - assert logs["batch_num"] == std_n_batches - assert type(logs["total_loss"]) is float - assert type(logs["total_correct"]) is float - assert type(logs["total_top5"]) is float - - if extra_metrics: - assert type(logs["collapse_level"]) is float - assert type(logs["euc_dist"]) is float - - results = logger.get_results - assert results == {} - - shutil.rmtree(path, ignore_errors=True) diff --git a/tests/test_logging.py b/tests/test_logging.py new file mode 100644 index 000000000..af4f3ad6c --- /dev/null +++ b/tests/test_logging.py @@ -0,0 +1,349 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +r"""Tests for :mod:`minerva.logging`. +""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" + +import importlib +import shutil +import tempfile +from pathlib import Path + +# ===================================================================================================================== +# IMPORTS +# ===================================================================================================================== +from typing import Any, Dict, List, Tuple, Union + +import numpy as np +import torch +from urllib3.exceptions import MaxRetryError, NewConnectionError + +# Needed to avoid connection error when importing lightly. +try: + from lightly.loss import NTXentLoss +except (OSError, NewConnectionError, MaxRetryError): + NTXentLoss = getattr(importlib.import_module("lightly.loss"), "NTXentLoss") +import pytest +from nptyping import NDArray, Shape +from numpy.testing import assert_array_equal +from torch import Tensor +from torch.nn.modules import Module +from torchgeo.datasets.utils import BoundingBox + +from minerva.logger.tasklog import SSLTaskLogger, SupervisedTaskLogger +from minerva.loss import SegBarlowTwinsLoss +from minerva.modelio import ssl_pair_tg, sup_tg +from minerva.models import FCN16ResNet18, MinervaSiamese, SimCLR18, SimConv +from minerva.utils import utils + +n_epochs = 2 + + +# ===================================================================================================================== +# TESTS +# ===================================================================================================================== +@pytest.mark.parametrize("train", (True, False)) +@pytest.mark.parametrize("model_type", ("scene_classifier", "segmentation")) +def test_SupervisedGeoStepLogger( + simple_bbox: BoundingBox, + x_entropy_loss, + std_n_batches: int, + std_n_classes: int, + std_batch_size: int, + small_patch_size: Tuple[int, int], + default_device: torch.device, + train: bool, + model_type: str, +) -> None: + path = Path(tempfile.gettempdir(), "exp1") + + if not path.exists(): + path.mkdir() + + try: + tensorboard_writer = utils._optional_import( + "torch.utils.tensorboard.writer", name="SummaryWriter", package="tensorflow" + ) + except ImportError as err: + print(err) + writer = None + else: + writer = tensorboard_writer(log_dir=path) + + model = FCN16ResNet18(x_entropy_loss, input_size=(4, *small_patch_size)).to( + default_device + ) + optimiser = torch.optim.SGD(model.parameters(), lr=1.0e-3) + model.set_optimiser(optimiser) + model.determine_output_dim() + + output_shape = model.output_shape + assert isinstance(output_shape, tuple) + + logger = SupervisedTaskLogger( + task_name="pytest", + n_batches=std_n_batches, + batch_size=std_batch_size, + output_size=output_shape, + n_classes=std_n_classes, + record_int=True, + record_float=True, + writer=writer, + model_type=model_type, + step_logger_params={"params": {"n_classes": std_n_classes}}, + ) + + correct_loss: Dict[str, List[float]] = {"x": [], "y": []} + correct_acc: Dict[str, List[float]] = {"x": [], "y": []} + correct_miou: Dict[str, List[float]] = {"x": [], "y": []} + + for epoch_no in range(n_epochs): + data: List[Dict[str, Union[Tensor, List[Any]]]] = [] + for i in range(std_n_batches): + images = torch.rand(size=(std_batch_size, 4, *small_patch_size)) + masks = torch.randint( # type: ignore[attr-defined] + 0, std_n_classes, (std_batch_size, *small_patch_size) + ) + bboxes = [simple_bbox] * std_batch_size + batch: Dict[str, Union[Tensor, List[Any]]] = { + "image": images, + "mask": masks, + "bbox": bboxes, + } + data.append(batch) + + logger.step(i, *sup_tg(batch, model, device=default_device, train=train)) # type: ignore[arg-type] + + logs = logger.get_logs + assert logs["batch_num"] == std_n_batches + assert type(logs["total_loss"]) is float + assert type(logs["total_correct"]) is float + + if model_type == "segmentation": + assert type(logs["total_miou"]) is float + + results = logger.get_results + assert results["z"].shape == ( + std_n_batches, + std_batch_size, + *small_patch_size, + ) + assert results["y"].shape == ( + std_n_batches, + std_batch_size, + *small_patch_size, + ) + assert np.array(results["ids"]).shape == (std_n_batches, std_batch_size) + + shape = f"{std_n_batches}, {std_batch_size}, {small_patch_size[0]}, {small_patch_size[1]}" + y: NDArray[Shape[shape], Any] = np.empty( + (std_n_batches, std_batch_size, *output_shape), dtype=np.uint8 + ) + for i in range(std_n_batches): + mask: Union[Tensor, List[Any]] = data[i]["mask"] + assert isinstance(mask, Tensor) + y[i] = mask.cpu().numpy() + + assert_array_equal(results["y"], y) + + correct_loss["x"].append(epoch_no) + correct_loss["y"].append(logs["total_loss"] / std_n_batches) + + correct_acc["x"].append(epoch_no) + if utils.check_substrings_in_string(model_type, "segmentation"): + correct_acc["y"].append( + logs["total_correct"] + / float(std_n_batches * std_batch_size * np.prod(small_patch_size)) + ) + else: + correct_acc["y"].append( + logs["total_correct"] / (std_n_batches * std_batch_size) + ) + + if utils.check_substrings_in_string(model_type, "segmentation"): + correct_miou["x"].append(epoch_no) + correct_miou["y"].append( + logs["total_miou"] / (std_n_batches * std_batch_size) + ) + + logger.calc_metrics(epoch_no) + logger.print_epoch_results(epoch_no) + + metrics = logger.get_metrics + + assert metrics["pytest_loss"] == pytest.approx(correct_loss) + assert metrics["pytest_acc"] == pytest.approx(correct_acc) + + if model_type == "segmentation": + assert metrics["pytest_miou"] == pytest.approx(correct_miou) + + logger._make_logger() + + shutil.rmtree(path, ignore_errors=True) + + +@pytest.mark.parametrize( + ("model_cls", "model_type", "criterion"), + ( + (SimCLR18, "siamese", NTXentLoss()), + (SimConv, "siamese-segmentation", SegBarlowTwinsLoss()), + ), +) +@pytest.mark.parametrize("train", (True, False)) +@pytest.mark.parametrize("extra_metrics", (True, False)) +def test_SSLStepLogger( + simple_bbox: BoundingBox, + std_n_batches: int, + std_batch_size: int, + small_patch_size: Tuple[int, int], + default_device: torch.device, + model_cls: MinervaSiamese, + model_type: str, + criterion: Module, + train: bool, + extra_metrics: bool, +) -> None: + path = Path(tempfile.gettempdir(), "exp2") + + if not path.exists(): + path.mkdir() + + try: + tensorboard_writer = utils._optional_import( + "torch.utils.tensorboard.writer", name="SummaryWriter", package="tensorflow" + ) + except ImportError as err: + print(err) + writer = None + else: + writer = tensorboard_writer(log_dir=path) + + model: MinervaSiamese = model_cls(criterion, input_size=(4, *small_patch_size)).to( + default_device + ) + optimiser = torch.optim.SGD(model.parameters(), lr=1.0e-3) + model.set_optimiser(optimiser) + + model.determine_output_dim(sample_pairs=True) + output_shape = model.output_shape + assert isinstance(output_shape, tuple) + + logger = SSLTaskLogger( + task_name="pytest", + n_batches=std_n_batches, + batch_size=std_batch_size, + output_size=small_patch_size, + record_int=True, + record_float=True, + writer=writer, + model_type=model_type, + sample_pairs=True, + ) + + correct_loss: Dict[str, List[float]] = {"x": [], "y": []} + correct_acc: Dict[str, List[float]] = {"x": [], "y": []} + correct_top5: Dict[str, List[float]] = {"x": [], "y": []} + correct_collapse_level: Dict[str, List[float]] = {"x": [], "y": []} + correct_euc_dist: Dict[str, List[float]] = {"x": [], "y": []} + + for epoch_no in range(n_epochs): + for i in range(std_n_batches): + images = torch.rand(size=(std_batch_size, 4, *small_patch_size)) + bboxes = [simple_bbox] * std_batch_size + batch = {"image": images, "bbox": bboxes} + + logger.step( + i, + *ssl_pair_tg((batch, batch), model, device=default_device, train=train), # type: ignore[arg-type] + ) + + logs = logger.get_logs + assert logs["batch_num"] == std_n_batches + assert type(logs["total_loss"]) is float + assert type(logs["total_correct"]) is float + assert type(logs["total_top5"]) is float + + if extra_metrics: + assert type(logs["collapse_level"]) is float + assert type(logs["euc_dist"]) is float + + results = logger.get_results + assert results == {} + + correct_loss["x"].append(epoch_no) + correct_acc["x"].append(epoch_no) + correct_top5["x"].append(epoch_no) + + correct_loss["y"].append(logs["total_loss"] / std_n_batches) + + if utils.check_substrings_in_string(model_type, "segmentation"): + correct_acc["y"].append( + logs["total_correct"] + / float(std_n_batches * std_batch_size * np.prod(small_patch_size)) + ) + correct_top5["y"].append( + logs["total_top5"] + / float(std_n_batches * std_batch_size * np.prod(small_patch_size)) + ) + + else: + correct_acc["y"].append( + logs["total_correct"] / (std_n_batches * std_batch_size) + ) + correct_top5["y"].append( + logs["total_top5"] / (std_n_batches * std_batch_size) + ) + + if extra_metrics: + correct_collapse_level["x"].append(epoch_no) + correct_euc_dist["x"].append(epoch_no) + correct_collapse_level["y"].append(logs["collapse_level"]) + correct_euc_dist["y"].append(logs["euc_dist"] / std_n_batches) + + logger.calc_metrics(epoch_no) + logger.print_epoch_results(epoch_no) + + metrics = logger.get_metrics + + assert metrics["pytest_loss"] == pytest.approx(correct_loss) + assert metrics["pytest_acc"] == pytest.approx(correct_acc) + assert metrics["pytest_top5_acc"] == pytest.approx(correct_top5) + + if extra_metrics: + assert metrics["pytest_collapse_level"] == pytest.approx( + correct_collapse_level + ) + assert metrics["pytest_euc_dist"] == pytest.approx(correct_euc_dist) + + logger._make_logger() + + shutil.rmtree(path, ignore_errors=True) diff --git a/tests/test_metrics.py b/tests/test_metrics.py deleted file mode 100644 index c682182bf..000000000 --- a/tests/test_metrics.py +++ /dev/null @@ -1,254 +0,0 @@ -# -*- coding: utf-8 -*- -# MIT License - -# Copyright (c) 2023 Harry Baker - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# @org: University of Southampton -# Created under a project funded by the Ordnance Survey Ltd. -r"""Tests for :mod:`minerva.metrics`. -""" -# ===================================================================================================================== -# METADATA -# ===================================================================================================================== -__author__ = "Harry Baker" -__contact__ = "hjb1d20@soton.ac.uk" -__license__ = "MIT License" -__copyright__ = "Copyright (C) 2023 Harry Baker" - -# ===================================================================================================================== -# IMPORTS -# ===================================================================================================================== -import random -from typing import Dict, List - -import pytest - -from minerva.metrics import MinervaMetrics, SPMetrics, SSLMetrics - - -# ===================================================================================================================== -# TESTS -# ===================================================================================================================== -def test_minervametrics() -> None: - assert issubclass(SPMetrics, MinervaMetrics) - - -def test_sp_metrics() -> None: - def get_random_logs() -> Dict[str, float]: - logs = { - "total_loss": random.random(), - "total_correct": random.random(), - "total_miou": random.random(), - } - - return logs - - n_epochs = 2 - - n_batches: Dict[str, int] = { - "train": 12, - "val": 4, - "test": 2, - } - - metric_loggers: List[MinervaMetrics] = [] - - metric_loggers.append( - SPMetrics(n_batches, 16, (4, 224, 224), model_type="segmentation") - ) - metric_loggers.append( - SPMetrics(n_batches, 16, (4, 224, 224), model_type="scene_classifier") - ) - - epochs = [k + 1 for k in range(n_epochs)] - - for mode in n_batches.keys(): - logs = [get_random_logs() for i in range(n_epochs)] - - correct_loss_1 = { - "x": epochs, - "y": [log["total_loss"] / n_batches[mode] for log in logs], - } - - correct_loss = [correct_loss_1, correct_loss_1] - - correct_acc = [ - { - "x": epochs, - "y": [ - log["total_correct"] / (n_batches[mode] * 16 * 224 * 224) - for log in logs - ], - }, - { - "x": epochs, - "y": [log["total_correct"] / (n_batches[mode] * 16) for log in logs], - }, - ] - - correct_miou = { - "x": epochs, - "y": [log["total_miou"] / (n_batches[mode] * 16) for log in logs], - } - - for i, metric_logger in enumerate(metric_loggers): - for j in range(len(logs)): - metric_logger(mode, logs[j]) - metric_logger.log_epoch_number(mode, j) - metric_logger.print_epoch_results(mode, j) - - metrics = metric_loggers[i].get_metrics - - assert metrics[f"{mode}_loss"] == pytest.approx(correct_loss[i]) - assert metrics[f"{mode}_acc"] == pytest.approx(correct_acc[i]) - - if i == 0: - assert metrics[f"{mode}_miou"] == pytest.approx(correct_miou) - - if mode in ("train", "val"): - sub_metrics = metric_logger.get_sub_metrics() - - assert sub_metrics[f"{mode}_loss"] == pytest.approx(correct_loss[i]) - assert sub_metrics[f"{mode}_acc"] == pytest.approx(correct_acc[i]) - - if i == 0: - assert sub_metrics[f"{mode}_miou"] == pytest.approx(correct_miou) - - -def test_ssl_metrics() -> None: - def get_random_logs() -> Dict[str, float]: - logs = { - "total_loss": random.random(), - "total_correct": random.random(), - "total_top5": random.random(), - "collapse_level": random.random(), - "euc_dist": random.random(), - } - - return logs - - n_epochs = 2 - - epochs = [k + 1 for k in range(n_epochs)] - - n_batches: Dict[str, int] = {"train": 12, "val": 4} - - metric_loggers: List[MinervaMetrics] = [] - metric_loggers.append( - SSLMetrics( - n_batches, 16, (4, 224, 224), model_type="segmentation", sample_pairs=True - ) - ) - metric_loggers.append( - SSLMetrics( - n_batches, - 16, - (4, 224, 224), - model_type="scene_classifier", - sample_pairs=True, - ) - ) - - for mode in n_batches.keys(): - logs = [get_random_logs(), get_random_logs()] - - correct_loss = { - "x": epochs, - "y": [log["total_loss"] / n_batches[mode] for log in logs], - } - - correct_acc = [] - correct_acc.append( - { - "x": epochs, - "y": [ - log["total_correct"] / (n_batches[mode] * 16 * 224 * 224) - for log in logs - ], - } - ) - - correct_acc.append( - { - "x": epochs, - "y": [log["total_correct"] / (n_batches[mode] * 16) for log in logs], - } - ) - - correct_top5 = [] - correct_top5.append( - { - "x": epochs, - "y": [ - log["total_top5"] / (n_batches[mode] * 16 * 224 * 224) - for log in logs - ], - } - ) - - correct_top5.append( - { - "x": epochs, - "y": [log["total_top5"] / (n_batches[mode] * 16) for log in logs], - } - ) - - correct_collapse_level = { - "x": epochs, - "y": [log["collapse_level"] for log in logs], - } - - correct_euc_dist = { - "x": epochs, - "y": [log["euc_dist"] / n_batches[mode] for log in logs], - } - - for i, metric_logger in enumerate(metric_loggers): - for j in range(len(logs)): - metric_logger(mode, logs[j]) - metric_logger.log_epoch_number(mode, j) - metric_logger.print_epoch_results(mode, j) - - metrics = metric_logger.get_metrics - - assert metrics[f"{mode}_loss"] == pytest.approx(correct_loss) - assert metrics[f"{mode}_acc"] == pytest.approx(correct_acc[i]) - assert metrics[f"{mode}_top5_acc"] == pytest.approx(correct_top5[i]) - - if mode == "train": - assert metrics[f"{mode}_collapse_level"] == pytest.approx( - correct_collapse_level - ) - assert metrics[f"{mode}_euc_dist"] == pytest.approx(correct_euc_dist) - - sub_metrics = metric_logger.get_sub_metrics() - - assert sub_metrics[f"{mode}_loss"] == pytest.approx(correct_loss) - assert sub_metrics[f"{mode}_acc"] == pytest.approx(correct_acc[i]) - assert sub_metrics[f"{mode}_top5_acc"] == pytest.approx(correct_top5[i]) - - if mode == "train": - assert sub_metrics[f"{mode}_collapse_level"] == pytest.approx( - correct_collapse_level - ) - assert sub_metrics[f"{mode}_euc_dist"] == pytest.approx( - correct_euc_dist - ) diff --git a/tests/test_modelio.py b/tests/test_modelio.py index c7e82019a..648e4edd1 100644 --- a/tests/test_modelio.py +++ b/tests/test_modelio.py @@ -74,7 +74,7 @@ def test_sup_tg( optimiser = torch.optim.SGD(model.parameters(), lr=1.0e-3) model.set_optimiser(optimiser) - for mode in ("train", "val", "test"): + for train in (True, False): bboxes = [simple_bbox] * std_batch_size batch: Dict[str, Union[Tensor, List[Any]]] = { "image": random_rgbi_batch, @@ -82,7 +82,7 @@ def test_sup_tg( "bbox": bboxes, } - results = sup_tg(batch, model, default_device, mode) + results = sup_tg(batch, model, default_device, train) assert isinstance(results[0], Tensor) assert isinstance(results[1], Tensor) @@ -106,7 +106,7 @@ def test_ssl_pair_tg( optimiser = torch.optim.SGD(model.parameters(), lr=1.0e-3) model.set_optimiser(optimiser) - for mode in ("train", "val"): + for train in (True, False): images_1 = torch.rand(size=(std_batch_size, *rgbi_input_size)) bboxes_1 = [simple_bbox] * std_batch_size @@ -123,7 +123,7 @@ def test_ssl_pair_tg( "bbox": bboxes_2, } - results = ssl_pair_tg((batch_1, batch_2), model, default_device, mode) + results = ssl_pair_tg((batch_1, batch_2), model, default_device, train) assert isinstance(results[0], Tensor) assert isinstance(results[1], Tensor) @@ -148,7 +148,7 @@ def test_mask_autoencoder_io( optimiser = torch.optim.SGD(model.parameters(), lr=1.0e-3) model.set_optimiser(optimiser) - for mode in ("train", "val", "test"): + for train in (True, False): images = torch.rand(size=(std_batch_size, *rgbi_input_size)) masks = torch.randint(0, 8, (std_batch_size, *rgbi_input_size[1:])) # type: ignore[attr-defined] bboxes = [simple_bbox] * std_batch_size @@ -163,11 +163,11 @@ def test_mask_autoencoder_io( match="The value of key='wrong' is not understood. Must be either 'mask' or 'image'", ): autoencoder_io( - batch, model, default_device, mode, autoencoder_data_key="wrong" + batch, model, default_device, train, autoencoder_data_key="wrong" ) results = autoencoder_io( - batch, model, default_device, mode, autoencoder_data_key="mask" + batch, model, default_device, train, autoencoder_data_key="mask" ) assert isinstance(results[0], Tensor) @@ -196,7 +196,7 @@ def test_image_autoencoder_io( optimiser = torch.optim.SGD(model.parameters(), lr=1.0e-3) model.set_optimiser(optimiser) - for mode in ("train", "val", "test"): + for train in (True, False): bboxes = [simple_bbox] * std_batch_size batch: Dict[str, Union[Tensor, List[Any]]] = { "image": random_rgbi_batch, @@ -205,7 +205,7 @@ def test_image_autoencoder_io( } results = autoencoder_io( - batch, model, default_device, mode, autoencoder_data_key="image" + batch, model, default_device, train, autoencoder_data_key="image" ) assert isinstance(results[0], Tensor) diff --git a/tests/test_models/test_core.py b/tests/test_models/test_core.py index d7600ba54..9568d440a 100644 --- a/tests/test_models/test_core.py +++ b/tests/test_models/test_core.py @@ -37,6 +37,7 @@ # IMPORTS # ===================================================================================================================== import importlib +from typing import Tuple import internet_sabotage import numpy as np @@ -70,9 +71,9 @@ # ===================================================================================================================== # TESTS # ===================================================================================================================== -def test_minerva_model(x_entropy_loss) -> None: - x = torch.rand(16, (288)) - y = torch.LongTensor(np.random.randint(0, 8, size=16)) +def test_minerva_model(x_entropy_loss, std_n_classes: int, std_n_batches: int) -> None: + x = torch.rand(std_n_batches, (288)) + y = torch.LongTensor(np.random.randint(0, std_n_classes, size=std_n_batches)) with pytest.raises(NotImplementedError, match="Criterion has not been set!"): model_fail = MLP() @@ -91,37 +92,38 @@ def test_minerva_model(x_entropy_loss) -> None: model.set_optimiser(optimiser) model.determine_output_dim() - assert model.output_shape is model.n_classes + assert isinstance(model.output_shape, tuple) + assert model.output_shape[0] is model.n_classes - for mode in ("train", "val", "test"): - if mode == "train": - loss, z = model.step(x, y, train=True) - else: - loss, z = model.step(x, y, train=False) + for train in (True, False): + loss, z = model.step(x, y, train=train) assert type(loss.item()) is float assert isinstance(z, Tensor) - assert z.size() == (16, 8) + assert z.size() == (std_n_batches, std_n_classes) -def test_minerva_backbone() -> None: +def test_minerva_backbone(rgbi_input_size: Tuple[int, int, int]) -> None: loss_func = NTXentLoss(0.3) - input_size = (4, 64, 64) - model = SimCLR18(loss_func, input_size=input_size) + model = SimCLR18(loss_func, input_size=rgbi_input_size) assert isinstance(model.get_backbone(), Module) -def test_minerva_wrapper(x_entropy_loss) -> None: - input_size = (3, 32, 32) - n_classes = 8 +def test_minerva_wrapper( + x_entropy_loss, + small_patch_size: Tuple[int, int], + std_n_classes: int, + std_n_batches: int, +) -> None: + input_size = (3, *small_patch_size) model = MinervaWrapper( ResNetGenerator, x_entropy_loss, input_size=input_size, - n_classes=n_classes, - num_classes=n_classes, + n_classes=std_n_classes, + num_classes=std_n_classes, name="resnet-9", ) @@ -132,20 +134,18 @@ def test_minerva_wrapper(x_entropy_loss) -> None: model.set_optimiser(optimiser) model.determine_output_dim() - assert model.output_shape is model.n_classes + assert isinstance(model.output_shape, tuple) + assert model.output_shape[0] is model.n_classes - x = torch.rand(6, *input_size) - y = LongTensor(np.random.randint(0, 8, size=6)) + x = torch.rand(std_n_batches, *input_size) + y = LongTensor(np.random.randint(0, std_n_classes, size=std_n_batches)) - for mode in ("train", "val", "test"): - if mode == "train": - loss, z = model.step(x, y, train=True) - else: - loss, z = model.step(x, y, train=False) + for train in (True, False): + loss, z = model.step(x, y, train=train) assert type(loss.item()) is float assert isinstance(z, Tensor) - assert z.size() == (6, 8) + assert z.size() == (std_n_batches, std_n_classes) def test_get_torch_weights() -> None: @@ -170,10 +170,10 @@ def test_get_torch_weights() -> None: print(err) -def test_get_output_shape(exp_mlp) -> None: +def test_get_output_shape(exp_mlp, std_n_classes: int) -> None: output_shape = get_output_shape(exp_mlp, 64) - assert output_shape == 8 + assert output_shape == (std_n_classes,) def test_bilinear_init() -> None: diff --git a/tests/test_models/test_depreciated.py b/tests/test_models/test_depreciated.py index cc5b76950..33abe6b06 100644 --- a/tests/test_models/test_depreciated.py +++ b/tests/test_models/test_depreciated.py @@ -54,7 +54,8 @@ def test_mlp(x_entropy_loss) -> None: model.set_optimiser(optimiser) model.determine_output_dim() - assert model.output_shape is model.n_classes + assert isinstance(model.output_shape, tuple) + assert model.output_shape[0] is model.n_classes x = torch.rand(16, (288)) @@ -73,7 +74,8 @@ def test_cnn(x_entropy_loss) -> None: model.set_optimiser(optimiser) model.determine_output_dim() - assert model.output_shape is model.n_classes + assert isinstance(model.output_shape, tuple) + assert model.output_shape[0] is model.n_classes x = torch.rand(6, *input_size) y = torch.LongTensor(np.random.randint(0, 8, size=6)) diff --git a/tests/test_models/test_resnets.py b/tests/test_models/test_resnets.py index ff9325068..1e790d143 100644 --- a/tests/test_models/test_resnets.py +++ b/tests/test_models/test_resnets.py @@ -65,7 +65,8 @@ def resnet_test( model.set_optimiser(optimiser) model.determine_output_dim() - assert model.output_shape is model.n_classes + assert isinstance(model.output_shape, tuple) + assert model.output_shape[0] is model.n_classes loss, z = model.step(x, y, True) @@ -151,14 +152,13 @@ def test_resnet_encoder( encoder.set_optimiser(optimiser) encoder.determine_output_dim() - print(encoder.output_shape) - assert encoder.output_shape == (512, 2, 2) + assert encoder.output_shape == (512, 1, 1) assert len(encoder(random_rgbi_batch)) == 5 -def test_preload_weights() -> None: +def test_preload_weights(rgbi_input_size: Tuple[int, int, int]) -> None: resnet = ResNet(BasicBlock, [2, 2, 2, 2]) - new_resnet = _preload_weights(resnet, None, (4, 32, 32), encoder_on=False) + new_resnet = _preload_weights(resnet, None, rgbi_input_size, encoder_on=False) assert resnet == new_resnet diff --git a/tests/test_tasks/test_epoch.py b/tests/test_tasks/test_epoch.py new file mode 100644 index 000000000..cd3952685 --- /dev/null +++ b/tests/test_tasks/test_epoch.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +r"""Tests for :mod:`minerva.tasks.epoch`.""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" + +# ===================================================================================================================== +# IMPORTS +# ===================================================================================================================== +from torch.optim import SGD + +from minerva.models import MinervaModel +from minerva.tasks import MinervaTask, StandardEpoch +from minerva.utils import CONFIG, universal_path, utils + + +# ===================================================================================================================== +# TESTS +# ===================================================================================================================== +def test_standard_epoch(default_device, exp_fcn: MinervaModel): + exp_fcn.determine_output_dim() + optimiser = SGD(exp_fcn.parameters(), lr=1.0e-3) + exp_fcn.set_optimiser(optimiser) + exp_fcn.to(default_device) + + exp_name = "{}_{}".format( + CONFIG["model_name"], utils.timestamp_now(fmt="%d-%m-%Y_%H%M") + ) + exp_fn = universal_path(CONFIG["dir"]["results"]) / exp_name / exp_name + + params = CONFIG.copy() + + task = StandardEpoch( + name="fit-train", + model=exp_fcn, + device=default_device, + exp_fn=exp_fn, + **params, + ) + + assert isinstance(task, MinervaTask) + + task.step() + + assert isinstance(task.get_logs, dict) + + assert repr(task) == "StandardEpoch-fit-train" diff --git a/tests/test_tasks/test_knn.py b/tests/test_tasks/test_knn.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/test_tasks/test_tasks_core.py b/tests/test_tasks/test_tasks_core.py new file mode 100644 index 000000000..19906e057 --- /dev/null +++ b/tests/test_tasks/test_tasks_core.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# MIT License + +# Copyright (c) 2023 Harry Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# @org: University of Southampton +# Created under a project funded by the Ordnance Survey Ltd. +r"""Tests for :mod:`minerva.tasks.core`.""" +# ===================================================================================================================== +# METADATA +# ===================================================================================================================== +__author__ = "Harry Baker" +__contact__ = "hjb1d20@soton.ac.uk" +__license__ = "MIT License" +__copyright__ = "Copyright (C) 2023 Harry Baker" + +# ===================================================================================================================== +# IMPORTS +# ===================================================================================================================== +import pytest + +from minerva.tasks import get_task + + +# ===================================================================================================================== +# TESTS +# ===================================================================================================================== +def test_get_task(): + with pytest.raises(TypeError): + _ = get_task("MinervaTask") diff --git a/tests/test_trainer.py b/tests/test_trainer.py index 43525dfd4..934c7c633 100644 --- a/tests/test_trainer.py +++ b/tests/test_trainer.py @@ -23,8 +23,7 @@ # # @org: University of Southampton # Created under a project funded by the Ordnance Survey Ltd. -r"""Tests for :mod:`minerva.trainer`. -""" +r"""Tests for :mod:`minerva.trainer`.""" # ===================================================================================================================== # METADATA # ===================================================================================================================== @@ -182,9 +181,7 @@ def test_trainer_4( trainer.fit() if kwargs.get("tsne_cluster"): - trainer.model = trainer.model.get_backbone() # type: ignore[assignment, operator] - - trainer.tsne_cluster() + trainer.tsne_cluster("test-test") if kwargs.get("test"): trainer.test() diff --git a/tests/test_utils/test_visutils.py b/tests/test_utils/test_visutils.py index 49426779e..e9a36b793 100644 --- a/tests/test_utils/test_visutils.py +++ b/tests/test_utils/test_visutils.py @@ -243,7 +243,7 @@ def test_seg_plot(results_root, default_dataset: GeoDataset, monkeypatch) -> Non y=z, ids=ids, # type: ignore[arg-type] bounds=bboxes, - mode="test", + task_name="test-test", classes=utils.CLASSES, colours=utils.CMAP_DICT, fn_prefix=fn_prefix, @@ -369,7 +369,7 @@ def test_plot_results(default_dataset: GeoDataset) -> None: probs=probs, bounds=bounds, embeddings=embeddings, - mode="test", + task_name="test-test", class_names=utils.CLASSES, colours=utils.CMAP_DICT, save=False, @@ -385,7 +385,7 @@ def test_plot_embeddings(results_root: Path, default_dataset: GeoDataset) -> Non visutils.plot_embedding( embeddings, bounds, - "test", + "test-test", show=True, filename=results_root / "tsne_cluster_vis.png", title="test_plot",