npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

data-clumps-type-context

v0.1.102

Published

This is a package to identify data-clumps-type-context

Downloads

37

Readme

About

A reporting format for Data-Clumps as used in data-clumps.

// src/api/src/ignoreCoverage/DataClumpsTypeContext.ts

/**
 * This type encapsulates the context of multiple data clumps. It includes the report's version,
 * the options used during the data clump analysis, and a dictionary mapping keys to data clump contexts.
 */
import {DataClumpsDetectorContext} from "./DataClumpsDetectorContext";
import {DataClumpTypeContext, Dictionary} from "../index";

export type DataClumpsTypeContext = {
    // The version of the context format or the tooling.
    report_version: string,

    // The options used during the data clump analysis.
    detector: DataClumpsDetectorContext,

    // A dictionary mapping keys to data clump contexts.
    data_clumps: Dictionary<DataClumpTypeContext>,

    // The timestamp when the report was generated
    report_timestamp: string,

    // The language or framework the detector is designed for
    target_language: string

    // An overall summary of the report, it could contain a general overview, high risk files or any other relevant summary data
    report_summary: {
        amount_data_clumps: number | null,
        amount_files_with_data_clumps: number | null,
        amount_classes_or_interfaces_with_data_clumps: number | null,
        amount_methods_with_data_clumps: number | null,
        fields_to_fields_data_clump: number | null,
        parameters_to_fields_data_clump: number | null,
        parameters_to_parameters_data_clump: number | null,
        additional: any,
    }

    // Information about the project or codebase where the data clumps are detected
    project_info: {
        project_url: string | null,
        project_name: string | null,
        project_version: string | null,
        project_commit_hash: string | null,
        project_tag: string | null,
        project_commit_date: string | null,
        number_of_files: number | null,
        number_of_classes_or_interfaces: number | null,
        number_of_methods: number | null,
        number_of_data_fields: number | null,
        number_of_method_parameters: number | null,
        additional: any,
    }
}
// src/api/src/ignoreCoverage/DataClumpsDetectorContext.ts

/**
 * This type holds the configuration options for a specific detector during data clump analysis.
 */
export type DataClumpsDetectorContext = {
    // The name of the detector used in the analysis
    name: string,
    url: string | null,

    // The version of the detector used in the analysis
    version: string,

    // The threshold value or metric that defines a data clump for the detector
    options: any,
}
// src/api/src/ignoreCoverage/DataClumpTypeContext.ts

/**
 * This type represents the context in which a data clump exists.
 */
import {DataClumpsVariableFromContext, Dictionary} from "../index";

export type DataClumpTypeContext = {
    // The type of the context, in this case always 'data_clump'.
    type: string;

    // A unique identifier typically composed of the file path, class name, method name, and parameter names.
    key: string;

    probability: number | null;

    // The file path from where the data clump originates.
    from_file_path: string;

    // The name of the class or interface where the data clump originates.
    from_class_or_interface_name: string;

    // A unique key of the class or interface where the data clump originates.
    from_class_or_interface_key: string;

    // The name of the method where the data clump originates, if applicable.
    from_method_name: string | null;

    // A unique key of the method where the data clump originates, if applicable.
    from_method_key: string | null;

    // The file path to where the data clump points.
    to_file_path: string;

    // The name of the class or interface to where the data clump points.
    to_class_or_interface_name: string;

    // A unique key of the class or interface to where the data clump points.
    to_class_or_interface_key: string;

    // The name of the method to where the data clump points, if applicable.
    to_method_name: string | null;

    // A unique key of the method to where the data clump points, if applicable.
    to_method_key: string | null;

    // The specific type of data clump: 'parameter_data_clump' or 'field_data_clump'.
    data_clump_type: string;

    // Information about specific information like propability, risk, etc.
    data_clump_type_additional?: any;

    // A dictionary mapping keys to data clumps parameter from context.
    data_clump_data: Dictionary<DataClumpsVariableFromContext>
}
// src/api/src/ignoreCoverage/DataClumpsVariableFromContext.ts

/**
 * This type represents a parameter from the context in which a data clump exists.
 */
import {Position, DataClumpsVariableToContext} from "../index";

export type DataClumpsVariableFromContext = {
    // A unique identifier for this parameter.
    key: string;

    // The name of the parameter in the source code.
    name: string;

    // The data type of the parameter.
    type: string;

    // Modifiers applied to the parameter, e.g., 'public', 'private', 'readonly', etc.
    modifiers: string[] | undefined;

    position: Position;

    probability: number | null;

    // Representation of the matching parameter in the destination context.
    to_variable: DataClumpsVariableToContext;
}
// src/api/src/ignoreCoverage/DataClumpsVariableToContext.ts

import {Position} from "../index";

/**
 * This type represents a parameter in the destination context matching a data clump.
 */
export type DataClumpsVariableToContext = {
    // A unique identifier for this parameter.
    key: string;

    // The name of the parameter in the source code.
    name: string;

    // The data type of the parameter.
    type: string;

    position: Position;

    // Modifiers applied to the parameter, e.g., 'public', 'private', 'readonly', etc.
    modifiers: string[] | undefined;
}
// src/api/src/ignoreCoverage/Position.ts

/**
 * This type represents a position in a source code
 */

export type Position = {
    startLine: number;
    startColumn: number;
    endLine: number;
    endColumn: number;
}
// src/api/src/ignoreCoverage/Dictionary.ts

export interface Dictionary<T> {
    [Key: string]: T;
}

License

MIT

Contributors

The FireboltCasters