Fork me on GitHub

Résultats CPD

Le document suivant contient les résultats de l'inspection CPD CPD 6.13.0.

Duplicatas

Fichier Ligne
fr/paris/lutece/plugins/pluginwizard/service/generator/BusinessClassGenerator.java 92
fr/paris/lutece/plugins/pluginwizard/service/generator/BusinessKotlinClassGenerator.java 91
                String strSourceCode = getSourceCode( strPluginName, businessClass, file.getTemplate( ), strRadicalPackage, pm.getPluginName( ) );
                strSourceCode = strSourceCode.replace( "&lt;", "<" );
                strSourceCode = strSourceCode.replace( "&gt;", ">" );
                strSourceCode = strSourceCode.replace( "@i18n", "#i18n" );

                String strPath = PATH.replace( "SOURCE", file.getSourcePath( ) ) + strRadicalPath + PATH_SUFFIX;

                map.put( getFilePath( pm, strPath, strFilename ), strSourceCode );
            }
        }

        return map;
    }

    /**
     * Returns the source code of a business object
     * 
     * @param strPluginName
     *            The plugin name
     * @param businessClass
     *            The business class
     * @param strTemplate
     *            The type of generation(DAO,Home,etc)
     * @return The java source code of the business object
     */
    private String getSourceCode( String strPluginName, BusinessClass businessClass, String strTemplate, String strRadicalPackage, String strBeanName )
    {
        Map<String, Object> model = new HashMap<>( );
        model.put( Markers.MARK_BUSINESS_CLASS, businessClass );
        model.put( Markers.MARK_PLUGIN_NAME, strPluginName );
        model.put( Markers.MARK_RADICAL_PACKAGE, strRadicalPackage );
        model.put( Markers.MARK_BEAN_NAME, strBeanName );

        return build( strTemplate, model );
    }
}
Fichier Ligne
fr/paris/lutece/plugins/pluginwizard/business/model/PluginModelDAO.java 100
fr/paris/lutece/plugins/pluginwizard/business/model/PluginModelDAO.java 197
            daoUtil.setInt( 1, pluginModel.getIdPlugin( ) );
            daoUtil.setString( 2, pluginModel.getPluginName( ) );
            daoUtil.setString( 3, pluginModel.getPluginClass( ) );
            daoUtil.setString( 4, pluginModel.getPluginDescription( ) );
            daoUtil.setString( 5, pluginModel.getPluginDocumentation( ) );
            daoUtil.setString( 6, pluginModel.getPluginInstallation( ) );
            daoUtil.setString( 7, pluginModel.getPluginChanges( ) );
            daoUtil.setString( 8, pluginModel.getPluginUserGuide( ) );
            daoUtil.setString( 9, pluginModel.getPluginVersion( ) );
            daoUtil.setString( 10, pluginModel.getPluginCopyright( ) );
            daoUtil.setString( 11, pluginModel.getPluginIconUrl( ) );
            daoUtil.setString( 12, pluginModel.getPluginProvider( ) );
            daoUtil.setString( 13, pluginModel.getPluginProviderUrl( ) );
            daoUtil.setString( 14, pluginModel.getPluginDbPoolRequired( ) );

            daoUtil.executeUpdate( );
Fichier Ligne
fr/paris/lutece/plugins/pluginwizard/service/generator/BusinessClassGenerator.java 52
fr/paris/lutece/plugins/pluginwizard/service/generator/BusinessKotlinClassGenerator.java 51
    private static final String PATH_SUFFIX = "/business/";
    private List<BusinessFileConfig> _listFiles;

    /**
     * Set the list of files config
     * 
     * @param listFiles
     *            The list of files
     */
    public void setFiles( List<BusinessFileConfig> listFiles )
    {
        if ( listFiles != null )
        {
            _listFiles = (List<BusinessFileConfig>) ( ( (ArrayList<BusinessFileConfig>) listFiles ).clone( ) );
        }
        else
        {
            _listFiles = null;
        }
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public Map<String, String> generate( PluginModel pm, String generationSchemeName )
    {
        HashMap<String, String> map = new HashMap<>( );
        Collection<BusinessClass> listAllBusinessClasses = pm.getBusinessClasses( );

        String strPluginName = pm.getPluginNameAsPackage( );
        String strRadicalPackage = pm.getPluginNameAsRadicalPackage( );
        String strRadicalPath = pm.getPluginNameAsRadicalPath( );

        for ( BusinessClass businessClass : listAllBusinessClasses )
        {
            for ( BusinessFileConfig file : _listFiles )
            {
                String strClassName = file.getPrefix( ) + businessClass.getBusinessClass( ) + file.getSuffix( );
                String strFilename = strClassName + ".java";
Fichier Ligne
fr/paris/lutece/plugins/pluginwizard/business/model/PluginModelDAO.java 140
fr/paris/lutece/plugins/pluginwizard/business/model/PluginModelDAO.java 234
                pluginModel = new PluginModel( );

                pluginModel.setIdPlugin( daoUtil.getInt( 1 ) );
                pluginModel.setPluginName( daoUtil.getString( 2 ) );
                pluginModel.setPluginClass( daoUtil.getString( 3 ) );
                pluginModel.setPluginDescription( daoUtil.getString( 4 ) );
                pluginModel.setPluginDocumentation( daoUtil.getString( 5 ) );
                pluginModel.setPluginInstallation( daoUtil.getString( 6 ) );
                pluginModel.setPluginChanges( daoUtil.getString( 7 ) );
                pluginModel.setPluginUserGuide( daoUtil.getString( 8 ) );
                pluginModel.setPluginVersion( daoUtil.getString( 9 ) );
                pluginModel.setPluginCopyright( daoUtil.getString( 10 ) );
                pluginModel.setPluginIconUrl( daoUtil.getString( 11 ) );
                pluginModel.setPluginProvider( daoUtil.getString( 12 ) );
                pluginModel.setPluginProviderUrl( daoUtil.getString( 13 ) );
                pluginModel.setPluginDbPoolRequired( daoUtil.getString( 14 ) );
Fichier Ligne
fr/paris/lutece/plugins/pluginwizard/business/model/PluginModel.java 357
fr/paris/lutece/plugins/pluginwizard/web/formbean/DescriptionFormBean.java 161
    }

    /**
     * Returns the PluginVersion
     * 
     * @return The PluginVersion
     */
    public String getPluginVersion( )
    {
        return _strPluginVersion;
    }

    /**
     * Sets the PluginVersion
     * 
     * @param strPluginVersion
     *            The PluginVersion
     */
    public void setPluginVersion( String strPluginVersion )
    {
        _strPluginVersion = strPluginVersion;
    }

    /**
     * Returns the PluginCopyright
     * 
     * @return The PluginCopyright
     */
    public String getPluginCopyright( )
    {
        return _strPluginCopyright;
    }

    /**
     * Sets the PluginCopyright
     * 
     * @param strPluginCopyright
     *            The PluginCopyright
     */
    public void setPluginCopyright( String strPluginCopyright )
    {
        _strPluginCopyright = strPluginCopyright;
    }

    /**
     * Returns the PluginIconUrl
     * 
     * @return The PluginIconUrl
     */
    public String getPluginIconUrl( )
    {
        return _strPluginIconUrl;
    }

    /**
     * Sets the PluginIconUrl
     * 
     * @param strPluginIconUrl
     *            The PluginIconUrl
     */
    public void setPluginIconUrl( String strPluginIconUrl )
    {
        _strPluginIconUrl = strPluginIconUrl;
    }

    /**
     * Returns the PluginProvider
     * 
     * @return The PluginProvider
     */
    public String getPluginProvider( )
    {
        return _strPluginProvider;
    }

    /**
     * Sets the PluginProvider
     * 
     * @param strPluginProvider
     *            The PluginProvider
     */
    public void setPluginProvider( String strPluginProvider )
    {
        _strPluginProvider = strPluginProvider;
    }

    /**
     * Returns the PluginProviderUrl
     * 
     * @return The PluginProviderUrl
     */
    public String getPluginProviderUrl( )
    {
        return _strPluginProviderUrl;
    }

    /**
     * Sets the PluginProviderUrl
     * 
     * @param strPluginProviderUrl
     *            The PluginProviderUrl
     */
    public void setPluginProviderUrl( String strPluginProviderUrl )
    {
        _strPluginProviderUrl = strPluginProviderUrl;
    }

    /**
     * Returns the PluginDbPoolRequired
     * 
     * @return The PluginDbPoolRequired
     */
    public String getPluginDbPoolRequired( )
    {
        return _strPluginDbPoolRequired;
    }

    /**
     * Sets the PluginDbPoolRequired
     * 
     * @param strPluginDbPoolRequired
     *            The PluginDbPoolRequired
     */
    public void setPluginDbPoolRequired( String strPluginDbPoolRequired )
    {
        _strPluginDbPoolRequired = strPluginDbPoolRequired;
    }

    /**
     * Gets the locale of the plugin
     * 
     * @return The Locale
     */
    public Locale getLocale( )
Fichier Ligne
fr/paris/lutece/plugins/pluginwizard/service/generator/BusinessFileConfig.java 40
fr/paris/lutece/plugins/pluginwizard/service/generator/XPageFileConfig.java 40
{
    // Variables declarations
    private String _strPrefix = "";
    private String _strSuffix = "";
    private String _strPath = "src";
    private String _strTemplate;

    /**
     * Returns the Prefix
     * 
     * @return The Prefix
     */
    public String getPrefix( )
    {
        return _strPrefix;
    }

    /**
     * Sets the Prefix
     * 
     * @param strPrefix
     *            The Prefix
     */
    public void setPrefix( String strPrefix )
    {
        _strPrefix = strPrefix;
    }

    /**
     * Returns the Suffix
     * 
     * @return The Suffix
     */
    public String getSuffix( )
    {
        return _strSuffix;
    }

    /**
     * Sets the Suffix
     * 
     * @param strSuffix
     *            The Suffix
     */
    public void setSuffix( String strSuffix )
    {
        _strSuffix = strSuffix;
    }

    /**
     * Returns the Path
     * 
     * @return The Path
     */
    public String getSourcePath( )
    {
        return _strPath;
    }

    /**
     * Sets the Path
     * 
     * @param strPath
     *            The Path
     */
    public void setSourcePath( String strPath )
    {
        _strPath = strPath;
    }

    /**
     * Returns the Template
     * 
     * @return The Template
     */
    public String getTemplate( )
    {
        return _strTemplate;
    }

    /**
     * Sets the Template
     * 
     * @param strTemplate
     *            The Template
     */
    public void setTemplate( String strTemplate )
    {
        _strTemplate = strTemplate;
    }
}